summaryrefslogtreecommitdiffstats
path: root/tests/imgPhoto.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-06-07 20:11:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-06-07 20:11:24 (GMT)
commitc9f936a48137826608f43e2c8a767b8ca4e3cc04 (patch)
treef93244d1cf1cde2420bf55da108d1380eb1e9096 /tests/imgPhoto.test
parent9017a71055f5441adf6512571efb0b4b832d13bb (diff)
parent84cfc97d7f9469cb9f4406c0f26a15941de718d6 (diff)
downloadtk-c9f936a48137826608f43e2c8a767b8ca4e3cc04.zip
tk-c9f936a48137826608f43e2c8a767b8ca4e3cc04.tar.gz
tk-c9f936a48137826608f43e2c8a767b8ca4e3cc04.tar.bz2
Merge 8.6
Diffstat (limited to 'tests/imgPhoto.test')
-rw-r--r--tests/imgPhoto.test34
1 files changed, 8 insertions, 26 deletions
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index b5a91fe..efe0a74 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -130,14 +130,6 @@ testConstraint hasTeapotPhoto [file exists $teapotPhotoFile]
set transpTeapotPhotoFile [file join [file dirname [info script]] teapotTransparent.png]
testConstraint hasTranspTeapotPhoto [file exists $transpTeapotPhotoFile]
-proc base64ok {} {
- expr {
- ![catch {package require base64}]
- }
-}
-
-testConstraint base64PackageNeeded [base64ok]
-
test imgPhoto-1.1 {options for photo images} -body {
image create photo photo1 -width 79 -height 83
list [photo1 cget -width] [photo1 cget -height] \
@@ -1951,11 +1943,8 @@ test imgPhoto-19.8 {MatchStirngFormat: invalid data for gif} -setup {
# Reject corrupted or truncated image [Bug b601ce3ab1].
# WARNING - tests 18.1-18.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)} -constraints {
- base64PackageNeeded
-} -setup {
- package require base64
- set data [base64::decode {
+test imgPhoto-18.1 {Reject corrupted GIF (binary string)} -setup {
+ set data [binary decode base64 {
R0lGODlhAAQABP8zM/8z/zP/MzP/////M////yH5CiwheLrcLTBCd6Tv2qW16tdK4jhV
5qpraXIvM1JlNyAgOw==
}]
@@ -1981,11 +1970,8 @@ test imgPhoto-18.3 {Reject corrupted GIF (file)} -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.4 {Reject truncated GIF (binary string)} -constraints {
- base64PackageNeeded
-} -setup {
- package require base64
- set data [base64::decode {
+test imgPhoto-18.4 {Reject truncated GIF (binary string)} -setup {
+ set data [binary decode base64 {
R0lGODlhEAAQAMIHAAAAADMz//8zM/8z/zP/MzP///8=
}]
} -body {
@@ -2010,14 +1996,13 @@ test imgPhoto-18.6 {Reject truncated GIF (file)} -setup {
catch {image delete gif1}
} -returnCodes error -result {error reading color map}
test imgPhoto-18.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints {
- base64PackageNeeded nonPortable
+ nonPortable
} -setup {
# About the non portability constraint of this test: see ticket [cc42cc18a5]
# If there is insufficient memory, the error message
# {not enough free memory for image buffer} should be returned.
# Instead, some systems (e.g. FreeBSD 11.1) terminate the test interpreter.
- package require base64
- set data [base64::decode {
+ set data [binary decode base64 {
R0lGODlhwmYz//8zM/8z/zP/MzP/////M////yH5Ciwhe
LrcLTBCd6Tv2qW16tdK4jhV5qpraXIvM1JlNyAgOw==
}]
@@ -2055,14 +2040,11 @@ 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)} -constraints {
- base64PackageNeeded
-} -setup {
+test imgPhoto-18.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.
- package require base64
- set data [base64::decode {
+ set data [binary decode base64 {
R0lGODlhEAAQAMIHAAAAADMz//8zM/8z/zP/MzP/////M////yH5BAEKAAcALAAA
AAAQABAAAAMheLrcLTBCd6QV79qlterXB0riOFXmmapraXIvM1IdZTcJADs=
}]