summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-20 11:09:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-20 11:09:53 (GMT)
commitac0ac59425874c951ee09237bf6b71a35f732389 (patch)
tree4f1c2dfd2c6489570af70b35f37a6f7cd4134c27
parent3995dc62be9c998621195585e1eed2bad0152a17 (diff)
downloadtk-ac0ac59425874c951ee09237bf6b71a35f732389.zip
tk-ac0ac59425874c951ee09237bf6b71a35f732389.tar.gz
tk-ac0ac59425874c951ee09237bf6b71a35f732389.tar.bz2
Since TK_OPTION_ANCHOR doesn't support the TK_CONFIG_NULL_OK flag, don't set this flag here. Adapt testcases to use -relief instead, which _does_ support TK_CONFIG_NULL_OK
-rw-r--r--generic/tkTest.c12
-rw-r--r--tests/config.test26
2 files changed, 19 insertions, 19 deletions
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 0ca5fea..13d8392 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -618,7 +618,7 @@ TestobjconfigObjCmd(
{TK_OPTION_BORDER, "-border", "border", "Border",
"blue", Tk_Offset(TypesRecord, borderPtr), -1,
TK_CONFIG_NULL_OK, "white", 0x100},
- {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "raised",
+ {TK_OPTION_RELIEF, "-relief", "relief", "Relief", NULL,
Tk_Offset(TypesRecord, reliefPtr), -1,
TK_CONFIG_NULL_OK, 0, 0x200},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", "xterm",
@@ -627,9 +627,9 @@ TestobjconfigObjCmd(
{TK_OPTION_JUSTIFY, "-justify", NULL, NULL, "left",
Tk_Offset(TypesRecord, justifyPtr), -1,
0, 0, 0x800},
- {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", NULL,
+ {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", "center",
Tk_Offset(TypesRecord, anchorPtr), -1,
- TK_CONFIG_NULL_OK, 0, 0x1000},
+ 0, 0, 0x1000},
{TK_OPTION_PIXELS, "-pixel", "pixel", "Pixel",
"1", Tk_Offset(TypesRecord, pixelPtr), -1,
TK_CONFIG_NULL_OK, 0, 0x2000},
@@ -891,7 +891,7 @@ TestobjconfigObjCmd(
{TK_OPTION_BORDER, "-border", "border", "Border", "blue",
-1, Tk_Offset(InternalRecord, border),
TK_CONFIG_NULL_OK, "white", 0x100},
- {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "raised",
+ {TK_OPTION_RELIEF, "-relief", "relief", "Relief", NULL,
-1, Tk_Offset(InternalRecord, relief),
TK_CONFIG_NULL_OK, 0, 0x200},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", "xterm",
@@ -900,9 +900,9 @@ TestobjconfigObjCmd(
{TK_OPTION_JUSTIFY, "-justify", NULL, NULL, "left",
-1, Tk_Offset(InternalRecord, justify),
0, 0, 0x800},
- {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", NULL,
+ {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", "center",
-1, Tk_Offset(InternalRecord, anchor),
- TK_CONFIG_NULL_OK, 0, 0x1000},
+ 0, 0, 0x1000},
{TK_OPTION_PIXELS, "-pixel", "pixel", "Pixel", "1",
-1, Tk_Offset(InternalRecord, pixels),
TK_CONFIG_NULL_OK, 0, 0x2000},
diff --git a/tests/config.test b/tests/config.test
index 60ca8de..7ae7ae3 100644
--- a/tests/config.test
+++ b/tests/config.test
@@ -77,10 +77,10 @@ test config-1.5 {Tk_CreateOptionTable - default initialization} -constraints {
testobjconfig
} -body {
testobjconfig alltypes .a
- .a cget -relief
+ .a cget -anchor
} -cleanup {
killTables
-} -result raised
+} -result center
test config-1.6 {Tk_CreateOptionTable - chained tables} -constraints {
testobjconfig
} -body {
@@ -179,7 +179,7 @@ test config-3.5 {Tk_InitOptions - no initial value} -constraints {
testobjconfig
} -body {
testobjconfig alltypes .a
- .a cget -anchor
+ .a cget -relief
} -cleanup {
killTables
} -result {}
@@ -1408,15 +1408,15 @@ test config-8.14 {Tk_RestoreSavedOptions - border internal form} -constraints {
} -cleanup {
killTables
} -result blue
-test config-8.15 {Tk_RestoreSavedOptions - relief internal form} -constraints {
+test config-8.15 {Tk_RestoreSavedOptions - anchor internal form} -constraints {
testobjconfig
} -body {
testobjconfig internal .a
- catch {.a csave -relief sunken -color bogus}
- .a cget -relief
+ catch {.a csave -anchor e -color bogus}
+ .a cget -anchor
} -cleanup {
killTables
-} -result raised
+} -result center
test config-8.16 {Tk_RestoreSavedOptions - cursor internal form} -constraints {
testobjconfig
} -body {
@@ -1566,11 +1566,11 @@ if {[testConstraint testobjconfig]} {
test config-10.1 {Tk_GetOptionInfo - one item} -constraints testobjconfig -body {
testobjconfig alltypes .foo
- .foo configure -relief groove
- .foo configure -relief
+ .foo configure -anchor e
+ .foo configure -anchor
} -cleanup {
destroy .foo
-} -result {-relief relief Relief raised groove}
+} -result {-anchor anchor Anchor center e}
test config-10.2 {Tk_GetOptionInfo - one item, synonym} -constraints {
testobjconfig
} -body {
@@ -1587,7 +1587,7 @@ test config-10.3 {Tk_GetOptionInfo - all items} -constraints {
.foo configure
} -cleanup {
destroy .foo
-} -result {{-boolean boolean Boolean 1 1} {-integer integer Integer 7 13563} {-double double Double 3.14159 3.14159} {-string string String foo foo} {-stringtable StringTable stringTable one one} {-stringtable2 StringTable2 stringTable2 two two} {-color color Color red red} {-font font Font {Helvetica 12} {Helvetica 18}} {-bitmap bitmap Bitmap gray50 gray50} {-border border Border blue blue} {-relief relief Relief raised raised} {-cursor cursor Cursor xterm xterm} {-justify {} {} left left} {-anchor anchor Anchor {} {}} {-pixel pixel Pixel 1 1} {-custom {} {} {} {}} {-synonym -color}}
+} -result {{-boolean boolean Boolean 1 1} {-integer integer Integer 7 13563} {-double double Double 3.14159 3.14159} {-string string String foo foo} {-stringtable StringTable stringTable one one} {-stringtable2 StringTable2 stringTable2 two two} {-color color Color red red} {-font font Font {Helvetica 12} {Helvetica 18}} {-bitmap bitmap Bitmap gray50 gray50} {-border border Border blue blue} {-relief relief Relief {} {}} {-cursor cursor Cursor xterm xterm} {-justify {} {} left left} {-anchor anchor Anchor center center} {-pixel pixel Pixel 1 1} {-custom {} {} {} {}} {-synonym -color}}
test config-10.4 {Tk_GetOptionInfo - chaining through tables} -constraints testobjconfig -body {
testobjconfig chain2 .foo -one asdf -three xyzzy
.foo configure
@@ -1613,8 +1613,8 @@ test config-11.2 {GetConfigList - null database names} -constraints {
test config-11.3 {GetConfigList - null default and current value} -constraints {
testobjconfig
} -body {
- .a configure -anchor
-} -result {-anchor anchor Anchor {} {}}
+ .a configure -relief
+} -result {-relief relief Relief {} {}}
if {[testConstraint testobjconfig]} {
killTables
}