diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-01 10:10:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-01 10:10:44 (GMT) |
commit | c7cabc58dd1096add0d3d34a4fe54fd1d6eebff4 (patch) | |
tree | 2b9070fa31fdd49d1781d702b5428710bb2c8a1e /tests | |
parent | 491465f7f1042b9a347f579cc49f5ba49e9377dc (diff) | |
parent | 3fa7a16d212c7d1b6252294cadf3e5d35e47ec69 (diff) | |
download | tk-c7cabc58dd1096add0d3d34a4fe54fd1d6eebff4.zip tk-c7cabc58dd1096add0d3d34a4fe54fd1d6eebff4.tar.gz tk-c7cabc58dd1096add0d3d34a4fe54fd1d6eebff4.tar.bz2 |
Fix [e4336bef5d58cc96a438ba0fb5553ea57e94f4d8|e4336bef5d]: Unexpected result when copying a photo image to itself. Thanks to Simon Bachmann for bug report and fix!
Diffstat (limited to 'tests')
-rw-r--r-- | tests/imgBmap.test | 3 | ||||
-rw-r--r-- | tests/imgPhoto.test | 73 |
2 files changed, 75 insertions, 1 deletions
diff --git a/tests/imgBmap.test b/tests/imgBmap.test index 5ffd7c4..e7f2c7e 100644 --- a/tests/imgBmap.test +++ b/tests/imgBmap.test @@ -380,7 +380,8 @@ test imageBmap-7.9 {ImgBmapCmd procedure} -body { test imageBmap-7.10 {ImgBmapCmd procedure} -body { i1 gorp } -returnCodes error -result {bad option "gorp": must be cget or configure} - +# Clean it up after use!! +imageCleanup test imageBmap-8.1 {ImgBmapGet/Free procedures, shared instances} -setup { destroy .c diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index f9ffa94..86da23d 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -953,6 +953,44 @@ test imgPhoto-10.1 {Tk_ImgPhotoPutBlock procedure} -setup { photo1 put "{#00ff00 #00ff00}" -to 2 0 list [photo1 get 2 0] [photo1 get 3 0] [photo1 get 4 0] } -result {{0 255 0} {0 255 0} {255 0 0}} +test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints { + hasTeapotPhoto +} -setup { + imageCleanup +} -body { + # Test for bug e4336bef5d + image create photo photo1 -file $teapotPhotoFile + image create photo photo2 -file $teapotPhotoFile + photo2 copy photo1 -to 1 2 + photo1 copy photo1 -to 1 2 + string equal [photo1 data] [photo2 data] +} -cleanup { + imageCleanup +} -result {1} +test imgPhoto-10.3 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints { + hasTeapotPhoto +} -setup { + imageCleanup +} -body { + # Test for bug e4336bef5d + image create photo photo1 -file $teapotPhotoFile + image create photo photo2 -file $teapotPhotoFile + photo2 copy photo1 -from 2 1 -to 4 5 300 300 + photo1 copy photo1 -from 2 1 -to 4 5 300 300 + string equal [photo1 data] [photo2 data] +} -cleanup { + imageCleanup +} -result {1} +test imgPhoto-10.4 {Tk_ImgPhotoPutBlock, empty image} -setup { + imageCleanup +} -body { + image create photo photo1 + photo1 copy photo1 -to 0 5 10 20 + list [image width photo1] [image height photo1] +} -cleanup { + imageCleanup +} -result {0 0} + test imgPhoto-11.1 {Tk_FindPhoto} -setup { imageCleanup @@ -972,6 +1010,41 @@ test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -constraints hasTeapotPhoto -body { } -cleanup { image delete p3 } -result {{19 92 192} {169 117 90} 512 512 {19 92 192}} +test imgPhoto-12.2 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -constraints { + hasTeapotPhoto +} -setup { + imageCleanup +} -body { + # Test for bug e4336bef5d + image create photo photo1 -file $teapotPhotoFile + image create photo photo2 -file $teapotPhotoFile + photo2 copy photo1 -to 0 1 200 200 -zoom 2 3 + photo1 copy photo1 -to 0 1 200 200 -zoom 2 3 + string equal [photo1 data] [photo2 data] +} -cleanup { + imageCleanup +} -result {1} +test imgPhoto-12.3 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -setup { + imageCleanup +} -body { + # Test for bug e4336bef5d + image create photo photo1 -file $teapotPhotoFile + image create photo photo2 -file $teapotPhotoFile + photo2 copy photo1 -from 1 0 -to 4 5 300 300 -zoom 1 2 + photo1 copy photo1 -from 1 0 -to 4 5 300 300 -zoom 1 2 + string equal [photo1 data] [photo2 data] +} -cleanup { + imageCleanup +} -result {1} +test imgPhoto-12.4 {Tk_ImgPhotoPutZoomedBlock, empty image} -setup { + imageCleanup +} -body { + image create photo photo1 + photo1 copy photo1 -to 0 5 10 20 + list [image width photo1] [image height photo1] +} -cleanup { + imageCleanup +} -result {0 0} test imgPhoto-13.1 {check separation of images in different interpreters} -setup { imageCleanup |