diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-01-03 21:52:18 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-01-03 21:52:18 (GMT) |
commit | 4302a869f0212a3e4878e66a7260b434f6584476 (patch) | |
tree | e6976e66edf648406e32b092395121e045301692 /tkimg/ico/tests/ico.test | |
parent | a780057cc1b51dd3a557549c3cf2431f09136c0d (diff) | |
parent | 60d692811c12788ed4468d5ff680633304e8f641 (diff) | |
download | blt-4302a869f0212a3e4878e66a7260b434f6584476.zip blt-4302a869f0212a3e4878e66a7260b434f6584476.tar.gz blt-4302a869f0212a3e4878e66a7260b434f6584476.tar.bz2 |
Merge commit '60d692811c12788ed4468d5ff680633304e8f641' as 'tkimg'
Diffstat (limited to 'tkimg/ico/tests/ico.test')
-rwxr-xr-x | tkimg/ico/tests/ico.test | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/tkimg/ico/tests/ico.test b/tkimg/ico/tests/ico.test new file mode 100755 index 0000000..51c0997 --- /dev/null +++ b/tkimg/ico/tests/ico.test @@ -0,0 +1,83 @@ +# This file is a Tcl script to test out ICO reading and writing.
+# It is organized in the standard fashion for Tcl tests.
+#
+
+puts "img::ico [package require img::ico]"
+
+set icodata \
+{AAABAAEAICAAAAEACACoCAAAFgAAACgAAAAgAAAAQAAAAAEACAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAD/AYCAAAH//wABAP//AQAAgAEAgAABAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAA////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+/////////wYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgb/////////BgYGBgYGBgYGBgYGBgYG
+BgYGBgYGBgYGBv////////8GBgYGBv8GBgYGBgYGBgYGBgYGBgYGBgYG/////////wMDAwMD
+/wMDAwMDAwMFBQUFBQUFBQMDAwP/////////AwMDAwP/AwMDAwMDAwUFBQUFBQUFAwMDA///
+//////8DAwMDAwH/AwMDAwMDBQUFBQUFBQUDAwMD/////////wMDAwMDAf8BAQMDAwMFBQUF
+BQUFBQMDAwP/////////AwMDAwMB/wEBAwMDAwUFBQUFBQUFAwMDA/////////8DAwMDAwEB
+/wEBAwMDAwUFBQUFBQMDAwMD/////////wMDAwMDAwH//wEBAwMDAwUFBQUDAwMDAwP/////
+////AwMDAwMDAQH//wEDAwMDAwUFAwMDAwMDA/////////8DAwMDAwMBAQH/AQEDAwMDAwMD
+AwMDAwMD/////////wMDAwMDAwMBAQH/AQMDAwMDAwMDAwMDAwP/////////AwMDBAQDAwMB
+Af8BAQMDAwMDAwMDAwMDA/////////8DAwMEBAMDAwEB//8BAwMDAwMDAwMDAwMD////////
+/wMDAwMDAwMDAQEB/wEBAwMDAwMDAwMDAwP/////////AwMDAwMDAwMDAQH//wEBAwMDAwMD
+AwMDA///////////////////////AQH/AQH///////////////////////////////////8B
+Af8BAQH//////////////////////////////////wEBAf8BAQH/////////////////////
+/////////////wEBAf8BAQH/////////////////////////////////AQEBAf8BAQH/////
+/////////////////////////////wEBAf//AQL/////////////////////////////////
+AgEBAf8BAf///////////////////////////////////wEBAf8B////////////////////
+//////////////////8BAf//////////////////////////////////////////////////
+///////////////////////////AAAAHwAAAB8AAAAfAAAAHwAAAB8AAAAfAAAAHwAAAB8AA
+AAfAAAAHwAAAB8AAAAfAAAAHwAAAB8AAAAfAAAAHwAAAB8AAAAfAAAAH+fgfP/54DP//nAP/
+/+QD///5Af///gH////B////8f//////}
+
+test ico-1.1 {} {
+ catch {image delete i}
+ image create photo i -file [file join $tcltest::testsDirectory img.ico]
+ i data -format ico
+} $icodata
+test ico-1.2 {} {
+ catch {image delete i}
+ image create photo i -data $icodata
+ set data [i data -format ico]
+} $icodata
+test ico-1.3 {} {
+ i blank
+ i put $icodata
+ set data [i data -format ico]
+} $icodata
+test ico-1.4 {} {
+ i blank
+ i put $icodata -format ico
+ set data [i data -format ico]
+} $icodata
+
+if {[info tclversion] < 8.0} {
+ return
+}
+
+test ico-2.0 {Binary I/O with ICO images} {
+ i blank
+ set f [open [file join $tcltest::testsDirectory img.ico] r]
+ fconfigure $f -translation binary
+ set return [catch {i put [read $f]} msg]
+ close $f
+ lappend return $msg
+} {0 {}}
|