summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorculler <culler>2019-10-11 20:14:40 (GMT)
committerculler <culler>2019-10-11 20:14:40 (GMT)
commit09bb06b273610a411d611b606b08cb6b6b30eec7 (patch)
treec343ed5a57457d05a7017d6147c9933dd012b21b /tests
parent624d527a6a5bb7228d19aa80b8307151c47c2692 (diff)
downloadtk-09bb06b273610a411d611b606b08cb6b6b30eec7.zip
tk-09bb06b273610a411d611b606b08cb6b6b30eec7.tar.gz
tk-09bb06b273610a411d611b606b08cb6b6b30eec7.tar.bz2
Use vwait instead of after in canvImg.test. On macOS protect against exceptions
when periodic events are scheduled.
Diffstat (limited to 'tests')
-rw-r--r--tests/canvImg.test20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/canvImg.test b/tests/canvImg.test
index aa6781d..ea4aa3a 100644
--- a/tests/canvImg.test
+++ b/tests/canvImg.test
@@ -166,12 +166,12 @@ test canvImg-4.2 {ConfigureImage procedure} -constraints testImageType -setup {
update
set x {}
set y {}
- set timer [after 300 {lappend y "timeout"}]
+ set timer [after 300 {lappend y "timed out"}]
.c itemconfigure i1 -image foo2
update idletasks
update
# On MacOS we need to wait for the test image display procedure to run.
- while {"timeout" ni $y && [lindex $y end 1] ne "display"} {
+ while {"timed out" ni $y && [lindex $y end 1] ne "display"} {
vwait y
}
after cancel timer
@@ -741,9 +741,10 @@ test canvImg-10.1 {TranslateImage procedure} -constraints testImageType -setup {
.c create image 50 100 -image foo -tags image -anchor nw
update
set x {}
+ set timer [after 500 {lappend x "timed out"}]
foo changed 2 4 6 8 30 15
- # macOS Catalina needs a delay here.
- after 20
+ vwait x
+ after cancel $timer
update
return $x
} -cleanup {
@@ -759,9 +760,10 @@ test canvImg-11.1 {TranslateImage procedure} -constraints testImageType -setup {
.c create image 50 100 -image foo -tags image -anchor nw
update
set x {}
+ set timer [after 500 {lappend x "timed out"}]
foo changed 2 4 6 8 40 50
- # macOS Catalina needs a delay here.
- after 20
+ vwait x
+ after cancel $timer
update
return $x
} -cleanup {
@@ -799,14 +801,14 @@ test canvImg-11.3 {ImageChangedProc procedure} -constraints {
image create test foo2 -variable y
foo changed 0 0 0 0 40 50
foo2 changed 0 0 0 0 80 60
-
.c create image 50 100 -image foo -tags image -anchor nw
.c create image 70 110 -image foo2 -anchor nw
update
set y {}
+ set timer [after 500 {lappend y "timed out"}]
image create test foo -variable x
- # macOS Catalina needs a delay here.
- after 20
+ vwait x
+ after cancel $timer
update
return $y
} -cleanup {