diff options
Diffstat (limited to 'tkimg/pcx/tests')
-rw-r--r-- | tkimg/pcx/tests/all.tcl | 24 | ||||
-rw-r--r-- | tkimg/pcx/tests/hori.pcx | bin | 0 -> 716 bytes | |||
-rw-r--r-- | tkimg/pcx/tests/hori_bw.pcx | bin | 0 -> 297 bytes | |||
-rw-r--r-- | tkimg/pcx/tests/hori_bwmask.pcx | bin | 0 -> 297 bytes | |||
-rw-r--r-- | tkimg/pcx/tests/hori_grey8.pcx | bin | 0 -> 1156 bytes | |||
-rw-r--r-- | tkimg/pcx/tests/hori_ind8.pcx | bin | 0 -> 1136 bytes | |||
-rw-r--r-- | tkimg/pcx/tests/hori_rle.pcx | bin | 0 -> 716 bytes | |||
-rw-r--r-- | tkimg/pcx/tests/pcx.test | 77 |
8 files changed, 101 insertions, 0 deletions
diff --git a/tkimg/pcx/tests/all.tcl b/tkimg/pcx/tests/all.tcl new file mode 100644 index 0000000..de0116b --- /dev/null +++ b/tkimg/pcx/tests/all.tcl @@ -0,0 +1,24 @@ +# all.tcl -- -*- tcl -*- +# +# Import common functionality, then run the tests in this directory. +# +# Copyright (c) 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net> +# All rights reserved. +# +# RCS: @(#) $Id: all.tcl,v 1.1.1.1 2016/01/25 21:20:46 joye Exp $ + +set _pwd [pwd] +cd [file dirname [file join [pwd] [info script]]] +set _here [pwd] +cd $_pwd +source [file join [file dirname [file dirname $_here]] tests all.tcl] +unset _pwd _here + +set ::tcltest::testSingleFile false +set ::tcltest::testsDirectory [file dirname [info script]] + +# We need to ensure that the testsDirectory is absolute +::tcltest::normalizePath ::tcltest::testsDirectory + +run_tests +exit diff --git a/tkimg/pcx/tests/hori.pcx b/tkimg/pcx/tests/hori.pcx Binary files differnew file mode 100644 index 0000000..5828573 --- /dev/null +++ b/tkimg/pcx/tests/hori.pcx diff --git a/tkimg/pcx/tests/hori_bw.pcx b/tkimg/pcx/tests/hori_bw.pcx Binary files differnew file mode 100644 index 0000000..4e4f32a --- /dev/null +++ b/tkimg/pcx/tests/hori_bw.pcx diff --git a/tkimg/pcx/tests/hori_bwmask.pcx b/tkimg/pcx/tests/hori_bwmask.pcx Binary files differnew file mode 100644 index 0000000..4e4f32a --- /dev/null +++ b/tkimg/pcx/tests/hori_bwmask.pcx diff --git a/tkimg/pcx/tests/hori_grey8.pcx b/tkimg/pcx/tests/hori_grey8.pcx Binary files differnew file mode 100644 index 0000000..0e83a28 --- /dev/null +++ b/tkimg/pcx/tests/hori_grey8.pcx diff --git a/tkimg/pcx/tests/hori_ind8.pcx b/tkimg/pcx/tests/hori_ind8.pcx Binary files differnew file mode 100644 index 0000000..34ff8f4 --- /dev/null +++ b/tkimg/pcx/tests/hori_ind8.pcx diff --git a/tkimg/pcx/tests/hori_rle.pcx b/tkimg/pcx/tests/hori_rle.pcx Binary files differnew file mode 100644 index 0000000..0d9e36e --- /dev/null +++ b/tkimg/pcx/tests/hori_rle.pcx diff --git a/tkimg/pcx/tests/pcx.test b/tkimg/pcx/tests/pcx.test new file mode 100644 index 0000000..e19803d --- /dev/null +++ b/tkimg/pcx/tests/pcx.test @@ -0,0 +1,77 @@ +# This file is a Tcl script to test out PCX reading and writing. +# It is organized in the standard fashion for Tcl tests. +# + +puts "img::pcx [package require img::pcx]" + +set pcxdata \ +{CgUBCAAAAABRAAsALAEsAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAADUgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAADB/wDE/wDC/wDC/wDC/wDC/wDE/wDC/wDC/wDC/wDC/wDE +/wDC/wDC/wDC/wDC/wDE/wDC/wDC/wDC/wDH/wDC/wDC/wDC/wDE/wDC/wDC/wDC/wDC/wDE +/wDC/wDC/wDC/wDC/wDE/wDC/wDC/wDC/wDC/wDE/wDC/wDC/wDC/wDH/wDC/wDC/wDC/w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AML/AMH/wgDB/8IAwf8Awv8Awv8Awf/CAMH/ +wgDB/8IAwf8Awv8Awv8Awf/CAMH/wgDB/8IAwf8Awv8Awv8Awf/CAMH/wgDB/wDC/wDC/wDC +/wDB/8IAwf/CAMH/AML/AML/AMH/} + + +test pcx-1.1 {} { + catch {image delete i} + image create photo i -file [file join $tcltest::testsDirectory hori_bw.pcx] + i data -format pcx +} $pcxdata +test pcx-1.2 {} { + catch {image delete i} + image create photo i -data $pcxdata + set data [i data -format pcx] +} $pcxdata +test pcx-1.3 {} { + i blank + i put $pcxdata + set data [i data -format pcx] +} $pcxdata +test pcx-1.4 {} { + i blank + i put $pcxdata -format pcx + set data [i data -format pcx] +} $pcxdata +if {[info tclversion] < 8.0} { + return +} + +test pcx-2.0 {Binary I/O with PCX images} { + i blank + set f [open [file join $tcltest::testsDirectory hori_bw.pcx] r] + fconfigure $f -translation binary + set return [catch {i put [read $f]} msg] + close $f + lappend return $msg +} {0 {}} |