summaryrefslogtreecommitdiffstats
path: root/tkimg/xpm/tests
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-01-03 21:52:18 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-01-03 21:52:18 (GMT)
commit4302a869f0212a3e4878e66a7260b434f6584476 (patch)
treee6976e66edf648406e32b092395121e045301692 /tkimg/xpm/tests
parenta780057cc1b51dd3a557549c3cf2431f09136c0d (diff)
parent60d692811c12788ed4468d5ff680633304e8f641 (diff)
downloadblt-4302a869f0212a3e4878e66a7260b434f6584476.zip
blt-4302a869f0212a3e4878e66a7260b434f6584476.tar.gz
blt-4302a869f0212a3e4878e66a7260b434f6584476.tar.bz2
Merge commit '60d692811c12788ed4468d5ff680633304e8f641' as 'tkimg'
Diffstat (limited to 'tkimg/xpm/tests')
-rwxr-xr-xtkimg/xpm/tests/all.tcl24
-rwxr-xr-xtkimg/xpm/tests/folder.xpm18
-rwxr-xr-xtkimg/xpm/tests/xpm.test46
3 files changed, 88 insertions, 0 deletions
diff --git a/tkimg/xpm/tests/all.tcl b/tkimg/xpm/tests/all.tcl
new file mode 100755
index 0000000..7010d2d
--- /dev/null
+++ b/tkimg/xpm/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 224 2009-07-27 08:47:46Z nijtmans $
+
+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/xpm/tests/folder.xpm b/tkimg/xpm/tests/folder.xpm
new file mode 100755
index 0000000..44ba7ae
--- /dev/null
+++ b/tkimg/xpm/tests/folder.xpm
@@ -0,0 +1,18 @@
+/* XPM */
+static char * folder[] = {
+"16 12 3 1",
+" s None c None",
+". c #000000",
+"# c #f0ff80",
+" .... ",
+" .####. ",
+" .######. ",
+"............. ",
+".###########. ",
+".###########. ",
+".###########. ",
+".###########. ",
+".###########. ",
+".###########. ",
+".###########. ",
+"............. "}; \ No newline at end of file
diff --git a/tkimg/xpm/tests/xpm.test b/tkimg/xpm/tests/xpm.test
new file mode 100755
index 0000000..2b7f6a8
--- /dev/null
+++ b/tkimg/xpm/tests/xpm.test
@@ -0,0 +1,46 @@
+# This file is a Tcl script to test out GIF reading and writing.
+# It is organized in the standard fashion for Tcl tests.
+#
+
+puts "img::xpm [package require img::xpm]"
+
+set xpmdata \
+{/* XPM */
+static char * InlineData[] = {
+"16 12 3 1",
+" s None c None",
+". c #000000",
+"# c #f0ff80",
+" .... ",
+" .####. ",
+" .######. ",
+"............. ",
+".###########. ",
+".###########. ",
+".###########. ",
+".###########. ",
+".###########. ",
+".###########. ",
+".###########. ",
+"............. "};}
+
+test xpm-1.1 {} {
+ catch {image delete i}
+ image create photo i -file [file join $tcltest::testsDirectory folder.xpm]
+ i data -format xpm
+} $xpmdata
+test xpm-1.2 {} {
+ catch {image delete i}
+ image create photo i -data $xpmdata
+ set data [i data -format xpm]
+} $xpmdata
+test xpm-1.3 {} {
+ i blank
+ i put $data
+ set data [i data -format xpm]
+} $xpmdata
+test xpm-1.4 {} {
+ i blank
+ i put $data -format xpm
+ set data [i data -format xpm]
+} $xpmdata