diff options
Diffstat (limited to 'tkimg/tga/tests/tga.test')
-rwxr-xr-x | tkimg/tga/tests/tga.test | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tkimg/tga/tests/tga.test b/tkimg/tga/tests/tga.test new file mode 100755 index 0000000..2f00fb7 --- /dev/null +++ b/tkimg/tga/tests/tga.test @@ -0,0 +1,56 @@ +# This file is a Tcl script to test out TGA reading and writing.
+# It is organized in the standard fashion for Tcl tests.
+#
+
+puts "img::tga [package require img::tga]"
+
+set tgadata \
+{AAAKAAAAAAAAAAAAUgAMACAg0d/b3/8A39vf/4kAAAD/iP////8AAAAA/4gAAP//AAAAAP+I
+AP8A/wAAAAD/iP8AAP8AAAAA/4j//wD/AAAAAP+I/wD//wAAAAD/iAD///8BAAAA/9/b3/8A
+39vf/4kAAAD/iP////8AAAAA/4gAAP//AAAAAP+IAP8A/wAAAAD/iP8AAP8AAAAA/4j//wD/
+AAAAAP+I/wD//wAAAAD/iAD///8BAAAA/9/b3/8A39vf/4kAAAD/iP////8AAAAA/4gAAP//
+AAAAAP+IAP8A/wAAAAD/iP8AAP8AAAAA/4j//wD/AAAAAP+I/wD//wAAAAD/iAD///8BAAAA
+/9/b3/8A39vf/4kAAAD/iP////8AAAAA/4gAAP//AAAAAP+IAP8A/wAAAAD/iP8AAP8AAAAA
+/4j//wD/AAAAAP+I/wD//wAAAAD/iAD///8BAAAA/9/b3/8A39vf/4kAAAD/iP////8AAAAA
+/4gAAP//AAAAAP+IAP8A/wAAAAD/iP8AAP8AAAAA/4j//wD/AAAAAP+I/wD//wAAAAD/iAD/
+//8BAAAA/9/b3/8A39vf/4kAAAD/iP////8AAAAA/4gAAP//AAAAAP+IAP8A/wAAAAD/iP8A
+AP8AAAAA/4j//wD/AAAAAP+I/wD//wAAAAD/iAD///8BAAAA/9/b3/8A39vf/4kAAAD/iP//
+//8AAAAA/4gAAP//AAAAAP+IAP8A/wAAAAD/iP8AAP8AAAAA/4j//wD/AAAAAP+I/wD//wAA
+AAD/iAD///8BAAAA/9/b3/8A39vf/4kAAAD/iP////8AAAAA/4gAAP//AAAAAP+IAP8A/wAA
+AAD/iP8AAP8AAAAA/4j//wD/AAAAAP+I/wD//wAAAAD/iAD///8BAAAA/9/b3/8A39vf/4kA
+AAD/iP////8AAAAA/4gAAP//AAAAAP+IAP8A/wAAAAD/iP8AAP8AAAAA/4j//wD/AAAAAP+I
+/wD//wAAAAD/iAD///8BAAAA/9/b3/8A39vf/88AAAD/AN/b3//R39vf/w==}
+
+
+test tga-1.1 {} {
+ catch {image delete i}
+ image create photo i -file [file join $tcltest::testsDirectory hori.tga]
+ i data -format tga
+} $tgadata
+test tga-1.2 {} {
+ catch {image delete i}
+ image create photo i -data $tgadata
+ set data [i data -format tga]
+} $tgadata
+test tga-1.3 {} {
+ i blank
+ i put $tgadata
+ set data [i data -format tga]
+} $tgadata
+test tga-1.4 {} {
+ i blank
+ i put $tgadata -format tga
+ set data [i data -format tga]
+} $tgadata
+if {[info tclversion] < 8.0} {
+ return
+}
+
+test tga-2.0 {Binary I/O with TGA images} {
+ i blank
+ set f [open [file join $tcltest::testsDirectory hori.tga] r]
+ fconfigure $f -translation binary
+ set return [catch {i put [read $f]} msg]
+ close $f
+ lappend return $msg
+} {0 {}}
|