summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2020-07-24 15:32:53 (GMT)
committerculler <culler>2020-07-24 15:32:53 (GMT)
commita965e9c43e2e9889b4cb3581bc91221c087a7c25 (patch)
treee04bdcb3494f97272c3dec08a93468bfc6dfc2c3
parent45c939237b9e173457e588379c906a8e82211b78 (diff)
downloadtk-a965e9c43e2e9889b4cb3581bc91221c087a7c25.zip
tk-a965e9c43e2e9889b4cb3581bc91221c087a7c25.tar.gz
tk-a965e9c43e2e9889b4cb3581bc91221c087a7c25.tar.bz2
Fix Windows tests which were affected by the Mac changes.
-rw-r--r--tests/canvImg.test10
-rw-r--r--tests/pack.test18
-rw-r--r--tests/place.test14
-rw-r--r--tests/textDisp.test22
4 files changed, 39 insertions, 25 deletions
diff --git a/tests/canvImg.test b/tests/canvImg.test
index b57e21d..a3524f1 100644
--- a/tests/canvImg.test
+++ b/tests/canvImg.test
@@ -778,13 +778,7 @@ test canvImg-11.2 {ImageChangedProc procedure} -constraints {
.c delete all
image delete foo
} -result {30 75 70 125}
-if {[tk windowingsystem] == "aqua"} {
-# # For this test only the 20x40 upper left corner of foo2 needs
-# # to be redrawn, but Aqua redraws the entire image.
- set result_11_3 {{foo2 display 0 0 80 60}}
- } else {
- set result_11_3 {{foo2 display 0 0 20 40}}
-}
+
test canvImg-11.3 {ImageChangedProc procedure} -constraints {
testImageType
} -setup {
@@ -806,7 +800,7 @@ test canvImg-11.3 {ImageChangedProc procedure} -constraints {
} -cleanup {
.c delete all
image delete foo2
-} -result $result_11_3
+} -result {{foo2 display 0 0 80 60}}
# cleanup
imageFinish
diff --git a/tests/pack.test b/tests/pack.test
index 04e84b9..86fcad2 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -1549,12 +1549,19 @@ test pack-17.2 {PackLostSlaveProc procedure} -setup {
pack info .pack.a
} -returnCodes error -result {window ".pack.a" isn't packed}
+if {[tk windowingsystem] == "win32"} {
+ proc packUpdate {} {
+ update
+ }
+} else {
+ proc packUpdate {} {
+ }
+}
test pack-18.1 {unmap slaves when master unmapped} -constraints {
tempNotPc
} -setup {
eval destroy [winfo child .pack]
- update idletasks
} -body {
# adjust the position of .pack before test to avoid a screen switch
@@ -1562,29 +1569,27 @@ test pack-18.1 {unmap slaves when master unmapped} -constraints {
# as the screen (screen switch causes scale and other tests to fail).
wm geometry .pack +100+100
- update idletasks
# On the PC, when the width/height is configured while the window is
# unmapped, the changes don't take effect until the window is remapped.
# Who knows why?
eval destroy [winfo child .pack]
- update idletasks
frame .pack.a -width 100 -height 50 -relief raised -bd 2
pack .pack.a
update idletasks
set result [winfo ismapped .pack.a]
wm iconify .pack
- update idletasks
lappend result [winfo ismapped .pack.a]
.pack.a configure -width 200 -height 75
update idletasks
lappend result [winfo width .pack.a ] [winfo height .pack.a] \
[winfo ismapped .pack.a]
wm deiconify .pack
- update idletasks
+ packUpdate
lappend result [winfo ismapped .pack.a]
} -result {1 0 200 75 0 1}
+
test pack-18.2 {unmap slaves when master unmapped} -setup {
eval destroy [winfo child .pack]
} -body {
@@ -1601,14 +1606,13 @@ test pack-18.2 {unmap slaves when master unmapped} -setup {
update idletasks
set result [winfo ismapped .pack.b]
wm iconify .pack
- update idletasks
lappend result [winfo ismapped .pack.b]
.pack.b configure -width 100 -height 30
update idletasks
lappend result [winfo width .pack.b ] [winfo height .pack.b] \
[winfo ismapped .pack.b]
wm deiconify .pack
- update idletasks
+ packUpdate
lappend result [winfo ismapped .pack.b]
} -result {1 0 100 30 0 1}
diff --git a/tests/place.test b/tests/place.test
index 56ddde4..0a5e22f 100644
--- a/tests/place.test
+++ b/tests/place.test
@@ -258,6 +258,14 @@ test place-7.10 {ReconfigurePlacement procedure, computing size} -setup {
list [winfo width .t.f2] [winfo height .t.f2]
} -result {30 60}
+if {[tk windowingsystem] == "win32"} {
+ proc placeUpdate {} {
+ update
+ }
+} else {
+ proc placeUpdate {} {
+ }
+}
test place-8.1 {MasterStructureProc, mapping and unmapping slaves} -setup {
place forget .t.f2
@@ -267,13 +275,12 @@ test place-8.1 {MasterStructureProc, mapping and unmapping slaves} -setup {
update idletasks
set result [winfo ismapped .t.f2]
wm iconify .t
- update idletasks
lappend result [winfo ismapped .t.f2]
place .t.f2 -x 40 -y 30 -relx 0 -rely 0 -anchor nw
update idletasks
lappend result [winfo x .t.f2] [winfo y .t.f2] [winfo ismapped .t.f2]
wm deiconify .t
- update idletasks
+ placeUpdate
lappend result [winfo ismapped .t.f2]
} -result {1 0 40 30 0 1}
test place-8.2 {MasterStructureProc, mapping and unmapping slaves} -setup {
@@ -286,13 +293,12 @@ test place-8.2 {MasterStructureProc, mapping and unmapping slaves} -setup {
update idletasks
set result [winfo ismapped .t.f2]
wm iconify .t
- update idletasks
lappend result [winfo ismapped .t.f2]
place .t.f2 -x 40 -y 30 -relx 0 -rely 0 -anchor nw
update idletasks
lappend result [winfo x .t.f2] [winfo y .t.f2] [winfo ismapped .t.f2]
wm deiconify .t
- update idletasks
+ placeUpdate
lappend result [winfo ismapped .t.f2]
} -result {1 0 42 32 0 1}
destroy .t
diff --git a/tests/textDisp.test b/tests/textDisp.test
index b0560d8..0881102 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -17,10 +17,20 @@ if {[tk windowingsystem] == "aqua"} {
proc updateText {} {
update idletasks
}
+ proc delay {} {
+ update idletasks
+ after 100
+ update idletasks
+ }
} else {
proc updateText {} {
update
}
+ proc delay {} {
+ update
+ after 100
+ update
+ }
}
# The procedure below is used as the scrolling command for the text;
@@ -3961,12 +3971,12 @@ test textDisp-31.3 {line update index shifting} {
.t insert 1.0 "abc\n"
.t insert 1.0 "abc\n"
lappend res [.t count -ypixels 1.0 end]
- update idletasks ; after 100 ; update idletasks
+ delay
lappend res [.t count -ypixels 1.0 end]
.t.f configure -height 100
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
- update idletasks ; after 100 ; update idletasks
+ delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
@@ -4014,12 +4024,12 @@ test textDisp-31.6 {line update index shifting} {
.t insert 1.0 "abc\n"
.t insert 1.0 "abc\n"
lappend res [.t count -ypixels 1.0 end]
- update idletasks ; after 100 ; update idletasks
+ delay
lappend res [.t count -ypixels 1.0 end]
textest configure -height 100
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
- update idletasks ; after 100 ; update idletasks
+ delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
@@ -4036,11 +4046,11 @@ test textDisp-31.7 {line update index shifting, elided} {
.t tag configure elide -elide 1
.t tag add elide 1.3 2.1
lappend res [.t count -ypixels 1.0 end]
- update idletasks ; after 100 ; update idletasks
+ delay
lappend res [.t count -ypixels 1.0 end]
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
- update idletasks ; after 100 ; update idletasks
+ delay
lappend res [.t count -ypixels 1.0 end]
set res
} [list [expr {$fixedHeight * 1}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 2}] [expr {$fixedHeight * 1}] [expr {$fixedHeight * 1}]]