diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2021-01-23 13:23:20 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2021-01-23 13:23:20 (GMT) |
commit | 3348d98619c7b4ae631bde35f8e384360fd8c3de (patch) | |
tree | b3a458cc075cbbc01f08699fb78158b178a46e59 /tests/imgPhoto.test | |
parent | be894d0b4df59a4717ecf07ccd8ffd5c62c811fd (diff) | |
parent | 6567f685e6ec1b046219ee8c5615ba4a084ac231 (diff) | |
download | tk-3348d98619c7b4ae631bde35f8e384360fd8c3de.zip tk-3348d98619c7b4ae631bde35f8e384360fd8c3de.tar.gz tk-3348d98619c7b4ae631bde35f8e384360fd8c3de.tar.bz2 |
Merge main, Tk_CreatePhotoImageFormatVersion3: stubs position from 279 to 280, masterPtr->modelPtr
Diffstat (limited to 'tests/imgPhoto.test')
-rw-r--r-- | tests/imgPhoto.test | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 3ecd2b4..1ab5a65 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -2,10 +2,10 @@ # procedures in the file tkImgPhoto.c. It is organized in the standard fashion # for Tcl tests. # -# Copyright (c) 1994 The Australian National University -# Copyright (c) 1994-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# Copyright (c) 2002-2008 Donal K. Fellows +# Copyright © 1994 The Australian National University +# Copyright © 1994-1997 Sun Microsystems, Inc. +# Copyright © 1998-1999 Scriptics Corporation. +# Copyright © 2002-2008 Donal K. Fellows # All rights reserved. # # Author: Paul Mackerras (paulus@cs.anu.edu.au) @@ -32,7 +32,7 @@ # ImgPhotoCmd imgPhoto-4.*, imgPhoto-17.* # GetExtension: no tests # ParseSubcommandOptions: imgPhoto-1.* -# ImgPhotoConfigureMaster: imgPhoto-3.*, imgPhoto-15.* +# ImgPhotoConfigureModel: imgPhoto-3.*, imgPhoto-15.* # toggleComplexAlphaIfNeeded: no tests # ImgPhotoDelete: imgPhoto-8.* # ImgPhotoCmdDeleteProc: imgPhoto-9.* @@ -131,7 +131,9 @@ testConstraint hasTeapotPhoto [file exists $teapotPhotoFile] # let's see if we have the semi-transparent one as well set transpTeapotPhotoFile [file join [file dirname [info script]] teapotTransparent.png] testConstraint hasTranspTeapotPhoto [file exists $transpTeapotPhotoFile] - +testConstraint needsTcl867 [package vsatisfies [package provide Tcl] 8.6.7-] + + test imgPhoto-1.1 {options for photo images} -body { image create photo photo1 -width 79 -height 83 list [photo1 cget -width] [photo1 cget -height] \ @@ -223,7 +225,7 @@ test imgPhoto-2.2 {ImgPhotoCreate procedure} -setup { # set msg # } {couldn't open "bogus.img": no such file or directory} -test imgPhoto-3.1 {ImgPhotoConfigureMaster procedure} -constraints { +test imgPhoto-3.1 {ImgPhotoConfigureModel procedure} -constraints { hasTeapotPhoto } -body { image create photo photo1 -file $teapotPhotoFile @@ -231,7 +233,7 @@ test imgPhoto-3.1 {ImgPhotoConfigureMaster procedure} -constraints { } -cleanup { image delete photo1 } -result {} -test imgPhoto-3.2 {ImgPhotoConfigureMaster procedure} -constraints { +test imgPhoto-3.2 {ImgPhotoConfigureModel procedure} -constraints { hasTeapotPhoto } -body { image create photo photo1 -file $teapotPhotoFile @@ -240,7 +242,7 @@ test imgPhoto-3.2 {ImgPhotoConfigureMaster procedure} -constraints { } -cleanup { image delete photo1 } -result {1 {couldn't open "bogus": no such file or directory} 256 256} -test imgPhoto-3.3 {ImgPhotoConfigureMaster procedure} -constraints { +test imgPhoto-3.3 {ImgPhotoConfigureModel procedure} -constraints { hasTeapotPhoto } -setup { destroy .c @@ -258,7 +260,7 @@ test imgPhoto-3.3 {ImgPhotoConfigureMaster procedure} -constraints { destroy .c image delete photo1 } -result {256 256 {10 10 266 266} {300 10 556 266}} -test imgPhoto-3.4 {ImgPhotoConfigureMaster: -data <ppm>} -constraints { +test imgPhoto-3.4 {ImgPhotoConfigureModel: -data <ppm>} -constraints { hasTeapotPhoto } -setup { image create photo photo1 -file $teapotPhotoFile @@ -269,8 +271,9 @@ test imgPhoto-3.4 {ImgPhotoConfigureMaster: -data <ppm>} -constraints { } -cleanup { imageCleanup } -result {20 20} -test imgPhoto-3.5 {ImgPhotoConfigureMaster: -data <png>} -constraints { - hasTeapotPhoto +# This testcase fails with Tcl < 8.6.7, due to [25842c] +test imgPhoto-3.5 {ImgPhotoConfigureModel: -data <png>} -constraints { + hasTeapotPhoto needsTcl867 } -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 @@ -280,7 +283,7 @@ test imgPhoto-3.5 {ImgPhotoConfigureMaster: -data <png>} -constraints { } -cleanup { imageCleanup } -result {20 20} -test imgPhoto-3.6 {ImgPhotoConfigureMaster: -data <default>} -constraints { +test imgPhoto-3.6 {ImgPhotoConfigureModel: -data <default>} -constraints { hasTeapotPhoto } -setup { image create photo photo1 -file $teapotPhotoFile @@ -956,7 +959,7 @@ test imgPhoto-4.75 {<photo> read command: filename starting with '-'} -constrain image delete photo1 file delete ./-teapotPhotoFile } -result {} -test imgPhoto-4.76 {ImgPhotoCmd procedure: copy to same image} -constraints { +test imgPhoto-4.75.1 {ImgPhotoCmd procedure: copy to same image} -constraints { hasTeapotPhoto } -setup { imageCleanup @@ -968,7 +971,7 @@ test imgPhoto-4.76 {ImgPhotoCmd procedure: copy to same image} -constraints { } -cleanup { imageCleanup } -result {} -test imgPhoto-4.76 {ImgPhotoCmd, transparancy get: too many options} -setup { +test imgPhoto-4.76 {ImgPhotoCmd, transparency get: too many options} -setup { image create photo photo1 } -body { photo1 put white -to 0 0 1 1 @@ -1337,10 +1340,10 @@ test imgPhoto-4.117 {ImgPhotoCmd data: list colorformat} -setup { } -body { photo1 data -format {default -colorformat list} } -result {{{255 0 0 170} {0 128 0 255}} {{0 0 255 204} {255 255 255 221}}} +# This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image results in same image as orignial } -constraints { - hasTeapotPhoto - hasTranspTeapotPhoto + hasTeapotPhoto hasTranspTeapotPhoto needsTcl867 } -setup { image create photo teapot -file $teapotPhotoFile teapot copy teapot -from 50 60 70 80 -shrink @@ -1500,8 +1503,8 @@ test imgPhoto-9.1 {ImgPhotoCmdDeletedProc procedure} -constraints { } -body { image create photo photo2 -file $teapotPhotoFile rename photo2 {} - list [lsearch -exact [imageNames] photo2] [catch {photo2 foo} msg] $msg -} -result {-1 1 {invalid command name "photo2"}} + list [expr {"photo2" in [imageNames]}] [catch {photo2 foo} msg] $msg +} -result {0 1 {invalid command name "photo2"}} test imgPhoto-10.1 {Tk_ImgPhotoPutBlock procedure} -setup { imageCleanup @@ -1946,9 +1949,9 @@ test imgPhoto-19.8 {MatchStirngFormat: invalid data for gif} -setup { } -returnCodes error -result {couldn't recognize image data} # Reject corrupted or truncated image [Bug b601ce3ab1]. -# WARNING - tests 18.1-18.9 will cause a segfault on 8.5.19 and lower, +# WARNING - tests 20.1-20.9 will cause a segfault on 8.5.19 and lower, # and on 8.6.6 and lower. -test imgPhoto-18.1 {Reject corrupted GIF (binary string)} -setup { +test imgPhoto-20.1 {Reject corrupted GIF (binary string)} -setup { set data [binary decode base64 { R0lGODlhAAQABP8zM/8z/zP/MzP/////M////yH5CiwheLrcLTBCd6Tv2qW16tdK4jhV 5qpraXIvM1JlNyAgOw== @@ -1958,7 +1961,7 @@ test imgPhoto-18.1 {Reject corrupted GIF (binary string)} -setup { } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp -test imgPhoto-18.2 {Reject corrupted GIF (base 64 string)} -setup { +test imgPhoto-20.2 {Reject corrupted GIF (base 64 string)} -setup { set data { R0lGODlhAAQABP8zM/8z/zP/MzP/////M////yH5CiwheLrcLTBCd6Tv2qW16tdK4jhV 5qpraXIvM1JlNyAgOw== @@ -1968,14 +1971,14 @@ test imgPhoto-18.2 {Reject corrupted GIF (base 64 string)} -setup { } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp -test imgPhoto-18.3 {Reject corrupted GIF (file)} -setup { +test imgPhoto-20.3 {Reject corrupted GIF (file)} -setup { set fileName [file join [file dirname [info script]] corruptMangled.gif] } -body { image create photo gif1 -file $fileName } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp -test imgPhoto-18.4 {Reject truncated GIF (binary string)} -setup { +test imgPhoto-20.4 {Reject truncated GIF (binary string)} -setup { set data [binary decode base64 { R0lGODlhEAAQAMIHAAAAADMz//8zM/8z/zP/MzP///8= }] @@ -1984,7 +1987,7 @@ test imgPhoto-18.4 {Reject truncated GIF (binary string)} -setup { } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map} -test imgPhoto-18.5 {Reject truncated GIF (base 64 string)} -setup { +test imgPhoto-20.5 {Reject truncated GIF (base 64 string)} -setup { set data { R0lGODlhEAAQAMIHAAAAADMz//8zM/8z/zP/MzP///8= } @@ -1993,14 +1996,14 @@ test imgPhoto-18.5 {Reject truncated GIF (base 64 string)} -setup { } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map} -test imgPhoto-18.6 {Reject truncated GIF (file)} -setup { +test imgPhoto-20.6 {Reject truncated GIF (file)} -setup { set fileName [file join [file dirname [info script]] corruptTruncated.gif] } -body { image create photo gif1 -file $fileName } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map} -test imgPhoto-18.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints { +test imgPhoto-20.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints { nonPortable } -setup { # About the non portability constraint of this test: see ticket [cc42cc18a5] @@ -2016,7 +2019,7 @@ test imgPhoto-18.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints { } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp -test imgPhoto-18.8 {Reject corrupted GIF (> 4Gb) (base 64 string)} -constraints { +test imgPhoto-20.8 {Reject corrupted GIF (> 4Gb) (base 64 string)} -constraints { nonPortable } -setup { # About the non portability constraint of this test: see ticket [cc42cc18a5] @@ -2032,7 +2035,7 @@ test imgPhoto-18.8 {Reject corrupted GIF (> 4Gb) (base 64 string)} -constraints } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp -test imgPhoto-18.9 {Reject corrupted GIF (> 4Gb) (file)} -constraints { +test imgPhoto-20.9 {Reject corrupted GIF (> 4Gb) (file)} -constraints { nonPortable } -setup { # About the non portability constraint of this test: see ticket [cc42cc18a5] @@ -2045,10 +2048,10 @@ test imgPhoto-18.9 {Reject corrupted GIF (> 4Gb) (file)} -constraints { } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map|not enough free memory for image buffer} -match regexp -test imgPhoto-18.10 {Valid GIF (binary string)} -setup { +test imgPhoto-20.10 {Valid GIF (binary string)} -setup { # Test the binary string reader with a valid GIF. # This is not tested elsewhere. - # Tests 18.11, 18.12, with matching data, are included for completeness. + # Tests 20.11, 20.12, with matching data, are included for completeness. set data [binary decode base64 { R0lGODlhEAAQAMIHAAAAADMz//8zM/8z/zP/MzP/////M////yH5BAEKAAcALAAA AAAQABAAAAMheLrcLTBCd6QV79qlterXB0riOFXmmapraXIvM1IdZTcJADs= @@ -2058,7 +2061,7 @@ test imgPhoto-18.10 {Valid GIF (binary string)} -setup { } -cleanup { catch {image delete gif1} } -result gif1 -test imgPhoto-18.11 {Valid GIF (base 64 string)} -setup { +test imgPhoto-20.11 {Valid GIF (base 64 string)} -setup { set data { R0lGODlhEAAQAMIHAAAAADMz//8zM/8z/zP/MzP/////M////yH5BAEKAAcALAAA AAAQABAAAAMheLrcLTBCd6QV79qlterXB0riOFXmmapraXIvM1IdZTcJADs= @@ -2068,7 +2071,7 @@ test imgPhoto-18.11 {Valid GIF (base 64 string)} -setup { } -cleanup { catch {image delete gif1} } -result gif1 -test imgPhoto-18.12 {Valid GIF (file)} -setup { +test imgPhoto-20.12 {Valid GIF (file)} -setup { set fileName [file join [file dirname [info script]] red.gif] } -body { image create photo gif1 -file $fileName |