summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2024-06-08 20:39:55 (GMT)
committerfvogel <fvogelnew1@free.fr>2024-06-08 20:39:55 (GMT)
commit5f282fbabb61c71f5dcac0a3664bd3e6061585fe (patch)
tree29c4ebedf57e0e6b7a8ae9d9beddcbd3fa9dc460
parentda20d6adfe8b9d1d363dc3db29569367ffce2115 (diff)
downloadtk-5f282fbabb61c71f5dcac0a3664bd3e6061585fe.zip
tk-5f282fbabb61c71f5dcac0a3664bd3e6061585fe.tar.gz
tk-5f282fbabb61c71f5dcac0a3664bd3e6061585fe.tar.bz2
Add test imgPhoto-19.1 demonstrating bug [1576528] for the GIF case, and imgPhoto-19.2 (which shows a workaround and passes).
-rw-r--r--tests/constraints.tcl4
-rw-r--r--tests/imgPhoto.test16
-rw-r--r--tests/menu.test3
3 files changed, 20 insertions, 3 deletions
diff --git a/tests/constraints.tcl b/tests/constraints.tcl
index ad0ca85..22bc52d 100644
--- a/tests/constraints.tcl
+++ b/tests/constraints.tcl
@@ -296,6 +296,10 @@ testConstraint testtext [llength [info commands testtext]]
testConstraint testwinevent [llength [info commands testwinevent]]
testConstraint testwrapper [llength [info commands testwrapper]]
+# the earth.gif file is used in some tests
+set earthPhotoFile [file join [file dirname [info script]] earth.gif]
+testConstraint hasEarthPhoto [file exists $earthPhotoFile]
+
# constraints about what sort of fonts are available
testConstraint fonts 1
destroy .e
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index 1d3b6e5..54294b9 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -1425,6 +1425,22 @@ test imgPhoto-18.12 {Valid GIF (file)} -setup {
catch {image delete gif1}
} -result gif1
+test imgPhoto-19.1 {Read GIF file with -from option - Bug [1576528]} -constraints hasEarthPhoto -body {
+ image create photo gif1
+ gif1 read $earthPhotoFile -from 152 62 185 97
+ lindex [lindex [gif1 data] 0] 0
+} -cleanup {
+ catch {image delete gif1}
+} -result {#d8c8b8}
+test imgPhoto-19.2 {Read GIF file, copy with -from option} -constraints hasEarthPhoto -body {
+ image create photo gif1 -file $earthPhotoFile
+ image create photo gif2
+ gif2 copy gif1 -from 152 62 185 97
+ lindex [lindex [gif2 data] 0] 0
+} -cleanup {
+ catch {image delete gif1 ; image delete gif2}
+} -result {#d8c8b8}
+
catch {rename foreachPixel {}}
catch {rename checkImgTrans {}}
catch {rename checkImgTransLoop {}}
diff --git a/tests/menu.test b/tests/menu.test
index 7fed665..8b3b556 100644
--- a/tests/menu.test
+++ b/tests/menu.test
@@ -11,9 +11,6 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
imageInit
-# find the earth.gif file for use in these tests (tests 2.*)
-set earthPhotoFile [file join [file dirname [info script]] earth.gif]
-testConstraint hasEarthPhoto [file exists $earthPhotoFile]
testConstraint pressbutton [llength [info commands pressbutton]]
testConstraint movemouse [llength [info commands movemouse]]