diff options
Diffstat (limited to 'tkimg/bmp/tests')
-rw-r--r-- | tkimg/bmp/tests/WizImg.bmp | bin | 0 -> 26410 bytes | |||
-rw-r--r-- | tkimg/bmp/tests/all.tcl | 24 | ||||
-rw-r--r-- | tkimg/bmp/tests/bmp.test | 53 | ||||
-rw-r--r-- | tkimg/bmp/tests/bmp4r.bmp | bin | 0 -> 876 bytes | |||
-rw-r--r-- | tkimg/bmp/tests/bmp8r.bmp | bin | 0 -> 2226 bytes | |||
-rw-r--r-- | tkimg/bmp/tests/folder.bmp | bin | 0 -> 162 bytes | |||
-rw-r--r-- | tkimg/bmp/tests/img.bmp | bin | 0 -> 1658 bytes |
7 files changed, 77 insertions, 0 deletions
diff --git a/tkimg/bmp/tests/WizImg.bmp b/tkimg/bmp/tests/WizImg.bmp Binary files differnew file mode 100644 index 0000000..075f68e --- /dev/null +++ b/tkimg/bmp/tests/WizImg.bmp diff --git a/tkimg/bmp/tests/all.tcl b/tkimg/bmp/tests/all.tcl new file mode 100644 index 0000000..de0116b --- /dev/null +++ b/tkimg/bmp/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/bmp/tests/bmp.test b/tkimg/bmp/tests/bmp.test new file mode 100644 index 0000000..eb5fd1a --- /dev/null +++ b/tkimg/bmp/tests/bmp.test @@ -0,0 +1,53 @@ +# This file is a Tcl script to test out BMP reading and writing. +# It is organized in the standard fashion for Tcl tests. +# + +puts "img::bmp [package require img::bmp]" + +set bmpdata \ +{Qk12AgAAAAAAADYAAAAoAAAAEAAAAAwAAAABABgAAAAAAEACAABtCwAAbQsAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2dnZ2dnZ2dnZAAAAgP/w +gP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wAAAA2dnZ2dnZ2dnZAAAAgP/wgP/wgP/w +gP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wAAAA2dnZ2dnZ2dnZAAAAgP/wgP/wgP/wgP/wgP/w +gP/wgP/wgP/wgP/wgP/wgP/wAAAA2dnZ2dnZ2dnZAAAAgP/wgP/wgP/wgP/wgP/wgP/wgP/w +gP/wgP/wgP/wgP/wAAAA2dnZ2dnZ2dnZAAAAgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/w +gP/wgP/wAAAA2dnZ2dnZ2dnZAAAAgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/w +AAAA2dnZ2dnZ2dnZAAAAgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wgP/wAAAA2dnZ +2dnZ2dnZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2dnZ2dnZ2dnZ +2dnZAAAAgP/wgP/wgP/wgP/wgP/wgP/wAAAA2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ +AAAAgP/wgP/wgP/wgP/wAAAA2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZAAAA +AAAAAAAAAAAA2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ} + + +test bmp-1.1 {} { + catch {image delete i} + image create photo i -file [file join $tcltest::testsDirectory folder.bmp] + i data -format bmp +} $bmpdata +test bmp-1.2 {} { + catch {image delete i} + image create photo i -data $bmpdata + set data [i data -format bmp] +} $bmpdata +test bmp-1.3 {} { + i blank + i put $bmpdata + set data [i data -format bmp] +} $bmpdata +test bmp-1.4 {} { + i blank + i put $bmpdata -format bmp + set data [i data -format bmp] +} $bmpdata +if {[info tclversion] < 8.0} { + return +} + +test bmp-2.0 {Binary I/O with BMP images} { + i blank + set f [open [file join $tcltest::testsDirectory folder.bmp] r] + fconfigure $f -translation binary + set return [catch {i put [read $f]} msg] + close $f + lappend return $msg +} {0 {}} diff --git a/tkimg/bmp/tests/bmp4r.bmp b/tkimg/bmp/tests/bmp4r.bmp Binary files differnew file mode 100644 index 0000000..a0ff045 --- /dev/null +++ b/tkimg/bmp/tests/bmp4r.bmp diff --git a/tkimg/bmp/tests/bmp8r.bmp b/tkimg/bmp/tests/bmp8r.bmp Binary files differnew file mode 100644 index 0000000..bef0039 --- /dev/null +++ b/tkimg/bmp/tests/bmp8r.bmp diff --git a/tkimg/bmp/tests/folder.bmp b/tkimg/bmp/tests/folder.bmp Binary files differnew file mode 100644 index 0000000..b8cd319 --- /dev/null +++ b/tkimg/bmp/tests/folder.bmp diff --git a/tkimg/bmp/tests/img.bmp b/tkimg/bmp/tests/img.bmp Binary files differnew file mode 100644 index 0000000..0744441 --- /dev/null +++ b/tkimg/bmp/tests/img.bmp |