diff options
author | culler <culler> | 2019-05-21 14:47:49 (GMT) |
---|---|---|
committer | culler <culler> | 2019-05-21 14:47:49 (GMT) |
commit | 86e901296548ba764d26db646f01e23c00f2f009 (patch) | |
tree | d23996367e4838a5c10ff49ed683787a0d0682a5 /tests | |
parent | 4d732c5dd328c77dadb4a85a47e7f36cf8a4cb0b (diff) | |
download | tk-86e901296548ba764d26db646f01e23c00f2f009.zip tk-86e901296548ba764d26db646f01e23c00f2f009.tar.gz tk-86e901296548ba764d26db646f01e23c00f2f009.tar.bz2 |
Rework image testing to better deal with Aqua
Diffstat (limited to 'tests')
-rw-r--r-- | tests/canvImg.test | 23 | ||||
-rw-r--r-- | tests/image.test | 20 |
2 files changed, 34 insertions, 9 deletions
diff --git a/tests/canvImg.test b/tests/canvImg.test index ea413bb..f2bea27 100644 --- a/tests/canvImg.test +++ b/tests/canvImg.test @@ -156,10 +156,10 @@ test canvImg-4.1 {ConfiugreImage procedure} -constraints testImageType -setup { .c delete all image delete foo } -result {{{foo free}} {}} -test canvImg-4.2 {ConfiugreImage procedure} -constraints testImageType -setup { +test canvImg-4.2 {ConfigureImage procedure} -constraints testImageType -setup { .c delete all } -body { - image create test foo -variable x + image create test foo -variable x image create test foo2 -variable y foo2 changed 0 0 0 0 80 60 .c create image 50 100 -image foo -tags i1 -anchor nw @@ -167,6 +167,7 @@ test canvImg-4.2 {ConfiugreImage procedure} -constraints testImageType -setup { set x {} set y {} .c itemconfigure i1 -image foo2 + update idletasks update list $x $y [.c bbox i1] } -cleanup { @@ -720,6 +721,12 @@ test canvImg-9.1 {DisplayImage procedure} -constraints testImageType -setup { image delete foo } -result {75 150 105 165} +if {[tk windowingsystem] == "aqua"} { + # Aqua will redraw the entire image if the redraw occurs in drawRect. + set result_10_1 {{foo display 0 0 30 15}} +} else { + set result_10_1 {{foo display 2 4 6 8}} +} test canvImg-10.1 {TranslateImage procedure} -constraints testImageType -setup { .c delete all update @@ -734,7 +741,7 @@ test canvImg-10.1 {TranslateImage procedure} -constraints testImageType -setup { } -cleanup { .c delete all image delete foo -} -result {{foo display 2 4 6 8}} +} -result $result_10_1 test canvImg-11.1 {TranslateImage procedure} -constraints testImageType -setup { .c delete all @@ -766,6 +773,12 @@ test canvImg-11.2 {ImageChangedProc procedure} -constraints { .c delete all image delete foo } -result {30 75 70 125} +if {[tk windowingsystem] == "aqua"} { + # Aqua will redraw the entire image if the redraw occurs in drawRect. + 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 { @@ -773,7 +786,7 @@ test canvImg-11.3 {ImageChangedProc procedure} -constraints { update } -body { image create test foo -variable x - image create test foo2 -variable y + image create test foo2 -variable y foo changed 0 0 0 0 40 50 foo2 changed 0 0 0 0 80 60 @@ -787,7 +800,7 @@ test canvImg-11.3 {ImageChangedProc procedure} -constraints { } -cleanup { .c delete all image delete foo foo2 -} -result {{foo2 display 0 0 20 40}} +} -result $result_11_3 # cleanup imageFinish diff --git a/tests/image.test b/tests/image.test index d4ea745..6a2c731 100644 --- a/tests/image.test +++ b/tests/image.test @@ -63,6 +63,7 @@ test image-1.7 {Tk_ImageCmd procedure, "create" option} -constraints { update set x {} image create test myimage -variable x + update idletasks update return $x } -cleanup { @@ -344,8 +345,13 @@ test image-8.1 {Tk_ImageCmd procedure, "inuse" option} -constraints { imageCleanup catch {destroy .b} } -result [list 0 1] - +if {[tk windowingsystem] == "aqua"} { + # Aqua will redraw the entire image if the redraw occurs in drawRect. + set result_9_1 {{foo display 0 0 30 15}} +} else { + set result_9_1 {{foo display 5 6 7 8}} +} test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup { .c delete all imageCleanup @@ -356,12 +362,19 @@ test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup { update set x {} foo changed 5 6 7 8 30 15 + update idletasks update return $x } -cleanup { .c delete all imageCleanup -} -result {{foo display 5 6 7 8}} +} -result $result_9_1 +if {[tk windowingsystem] == "aqua"} { + # Aqua will redraw the entire image if the redraw occurs in drawRect. + set result_9_2 {{foo display 0 0 30 15} {foo display 0 0 30 15}} +} else { + set result_9_2 {{foo display 5 6 25 9} {foo display 0 0 12 14}} +} test image-9.2 {Tk_ImageChanged procedure} -constraints testImageType -setup { .c delete all imageCleanup @@ -378,8 +391,7 @@ test image-9.2 {Tk_ImageChanged procedure} -constraints testImageType -setup { } -cleanup { .c delete all imageCleanup -} -result {{foo display 5 6 25 9} {foo display 0 0 12 14}} - +} -result $result_9_2 test image-10.1 {Tk_GetImage procedure} -setup { imageCleanup |