summaryrefslogtreecommitdiff
path: root/tix/tests/xpm
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2000-02-07 00:19:28 +0000
committerJason Molenda <jmolenda@apple.com>2000-02-07 00:19:28 +0000
commitb111a96ea19bde1004ecea63c7827a1d4b0b73ef (patch)
tree2b8155215201f5224d8f68ec53f9720a89dfbdd9 /tix/tests/xpm
parentb73e43e34794f4903b0bf2e0fc1298547ef01faf (diff)
downloadgdb-b111a96ea19bde1004ecea63c7827a1d4b0b73ef.tar.gz
import insight-2000-02-04 snapshot (2nd try)
Diffstat (limited to 'tix/tests/xpm')
-rw-r--r--tix/tests/xpm/2cpp.xpm11
-rw-r--r--tix/tests/xpm/brace.xpm19
-rw-r--r--tix/tests/xpm/comments.xpm21
-rw-r--r--tix/tests/xpm/compound.tcl47
-rw-r--r--tix/tests/xpm/f-badcol.xpm21
-rw-r--r--tix/tests/xpm/f-badpix.xpm21
-rw-r--r--tix/tests/xpm/f-commt.xpm32
-rw-r--r--tix/tests/xpm/f-missline.xpm19
-rw-r--r--tix/tests/xpm/f-ok.xpm21
-rw-r--r--tix/tests/xpm/f-shortln.xpm21
-rw-r--r--tix/tests/xpm/files2
-rw-r--r--tix/tests/xpm/folder.xpm21
-rw-r--r--tix/tests/xpm/xpm.tcl145
13 files changed, 401 insertions, 0 deletions
diff --git a/tix/tests/xpm/2cpp.xpm b/tix/tests/xpm/2cpp.xpm
new file mode 100644
index 00000000000..bd559d249c3
--- /dev/null
+++ b/tix/tests/xpm/2cpp.xpm
@@ -0,0 +1,11 @@
+/* XPM */
+static char * folder_xpm[] = {
+"4 4 3 2",
+ "AA c black",
+".. c white",
+"XY c yellow",
+"AAAAAAXY",
+"XYAAAAAA",
+"..AA..AA",
+"..AAAA..",
+};
diff --git a/tix/tests/xpm/brace.xpm b/tix/tests/xpm/brace.xpm
new file mode 100644
index 00000000000..805494c4ea9
--- /dev/null
+++ b/tix/tests/xpm/brace.xpm
@@ -0,0 +1,19 @@
+/* XPM */
+static char * tmp [] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"10 10 2 1 -1 -1",
+/* colors */
+" s iconColor1 m black c gray",
+"} s iconColor2 m white c white",
+/* pixels */
+" ",
+" ",
+" ",
+" ",
+" ",
+"}}}}}}}}}}",
+"}}}}}}}}}}",
+"}}}}}}}}}}",
+"}}}}}}}}}}",
+"}}}}}}}}}}"};
+
diff --git a/tix/tests/xpm/comments.xpm b/tix/tests/xpm/comments.xpm
new file mode 100644
index 00000000000..de45058d570
--- /dev/null
+++ b/tix/tests/xpm/comments.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static char * tmp [] = {
+/* width height ncolors cpp [x_hot y_hot] */
+/* width height ncolors cpp [x_hot y_hot] */ /* Some comments */
+"10 10 2 1 -1 -1",
+/* colors */
+" s iconColor1 m black c gray",
+"} s iconColor2 m white c white",
+/* pixels */
+" ",
+" ",
+" ",
+" ",
+ /* Some comments */
+" ",
+"}}}}}}}}}}",
+"}}}}}}}}}}",
+"}}}}}}}}}}" /* Some comments */,
+"}}}}}}}}}}",
+"}}}}}}}}}}" /* Some comments */};
+
diff --git a/tix/tests/xpm/compound.tcl b/tix/tests/xpm/compound.tcl
new file mode 100644
index 00000000000..603db3d39b3
--- /dev/null
+++ b/tix/tests/xpm/compound.tcl
@@ -0,0 +1,47 @@
+proc About {} {
+ return "the compound image type"
+}
+
+proc Test {} {
+ set num 3
+ # Test for create
+ #
+ #
+ test {image create compound -foo} {missing}
+ test {image create compound -window} {missing}
+ test {image create compound -window foo} {path name}
+ test {set image1 [image create compound -window .b]} {path name}
+
+ for {set i 0} {$i < $num} {incr i} {
+ button .b$i
+ pack .b$i
+ }
+
+ # (0) Empty image
+ #
+ test {set image0 [image create compound -window .b0]}
+
+ # (1) Simple image
+ #
+ test {set image1 [image create compound -window .b1]}
+
+ $image1 add line
+ $image1 add text -text Hello
+
+ # (2) Two lines
+ #
+ test {set image2 [image create compound -window .b2]}
+
+ $image2 add line
+ $image2 add text -text "Line One"
+ $image2 add line
+ $image2 add text -text "Line Two"
+
+
+ # Display them
+ #
+ for {set i 0} {$i < $num} {incr i} {
+ .b$i config -image [set image$i]
+ }
+
+}
diff --git a/tix/tests/xpm/f-badcol.xpm b/tix/tests/xpm/f-badcol.xpm
new file mode 100644
index 00000000000..7e27b863d43
--- /dev/null
+++ b/tix/tests/xpm/f-badcol.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static char * folder_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"16 12 3 1",
+/* colors */
+" s None c None",
+". c black",
+"X c foooo",
+/* pixels */
+" .... ",
+" .XXXX. ",
+" .XXXXXX. ",
+"............. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+"............. "};
diff --git a/tix/tests/xpm/f-badpix.xpm b/tix/tests/xpm/f-badpix.xpm
new file mode 100644
index 00000000000..fdb4cb13f5b
--- /dev/null
+++ b/tix/tests/xpm/f-badpix.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static char * folder_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"16 12 3 1",
+/* colors */
+" s None c None",
+". c black",
+"X c #f0ff80",
+/* pixels */
+" .... ",
+" .XXXX. ",
+" .XXXXXX. ",
+"............. ",
+".XBBBBBBXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXBBXXX. ",
+".XXBBBBBBXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXNNXXX. ",
+".XXXXXXXXXXX. ",
+"............. "};
diff --git a/tix/tests/xpm/f-commt.xpm b/tix/tests/xpm/f-commt.xpm
new file mode 100644
index 00000000000..3158fd20782
--- /dev/null
+++ b/tix/tests/xpm/f-commt.xpm
@@ -0,0 +1,32 @@
+/* XPM */
+static char * folder_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"16 12 3 1",
+/* colors */
+" s None c None",
+". c black",
+"X c #f0ff80",
+/* pixels
+
+asd
+a
+sd
+as
+da
+sd
+asad
+
+
+ */
+" .... ",
+" .XXXX. ",
+" .XXXXXX. ",
+"............. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+"............. "};
diff --git a/tix/tests/xpm/f-missline.xpm b/tix/tests/xpm/f-missline.xpm
new file mode 100644
index 00000000000..e9f04c0f78c
--- /dev/null
+++ b/tix/tests/xpm/f-missline.xpm
@@ -0,0 +1,19 @@
+/* XPM */
+static char * folder_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"16 12 3 1",
+/* colors */
+" s None c None",
+". c black",
+"X c foooo",
+/* pixels */
+" .... ",
+" .XXXX. ",
+" .XXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+"............. "};
diff --git a/tix/tests/xpm/f-ok.xpm b/tix/tests/xpm/f-ok.xpm
new file mode 100644
index 00000000000..fda7c15a549
--- /dev/null
+++ b/tix/tests/xpm/f-ok.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static char * folder_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"16 12 3 1",
+/* colors */
+" s None c None",
+". c black",
+"X c #f0ff80",
+/* pixels */
+" .... ",
+" .XXXX. ",
+" .XXXXXX. ",
+"............. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+"............. "};
diff --git a/tix/tests/xpm/f-shortln.xpm b/tix/tests/xpm/f-shortln.xpm
new file mode 100644
index 00000000000..6a6f8f2ac45
--- /dev/null
+++ b/tix/tests/xpm/f-shortln.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static char * folder_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"16 12 3 1",
+/* colors */
+" s None c None",
+". c black",
+"X c #f0ff80",
+/* pixels */
+" .... ",
+" .XXXX. ",
+" .XXXXXX. ",
+"............. ",
+".XXXXXXXXXXX. ",
+".XX",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XX. ",
+".XX. ",
+".XX. ",
+"............. "};
diff --git a/tix/tests/xpm/files b/tix/tests/xpm/files
new file mode 100644
index 00000000000..73010a9b47e
--- /dev/null
+++ b/tix/tests/xpm/files
@@ -0,0 +1,2 @@
+xpm.tcl
+compound.tcl \ No newline at end of file
diff --git a/tix/tests/xpm/folder.xpm b/tix/tests/xpm/folder.xpm
new file mode 100644
index 00000000000..fda7c15a549
--- /dev/null
+++ b/tix/tests/xpm/folder.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static char * folder_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"16 12 3 1",
+/* colors */
+" s None c None",
+". c black",
+"X c #f0ff80",
+/* pixels */
+" .... ",
+" .XXXX. ",
+" .XXXXXX. ",
+"............. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+".XXXXXXXXXXX. ",
+"............. "};
diff --git a/tix/tests/xpm/xpm.tcl b/tix/tests/xpm/xpm.tcl
new file mode 100644
index 00000000000..f1eee30932c
--- /dev/null
+++ b/tix/tests/xpm/xpm.tcl
@@ -0,0 +1,145 @@
+proc About {} {
+ return "the pixmap image reader"
+}
+
+proc Test {} {
+
+ set data {
+/* XPM */
+static char * folder_xpm[] = {
+/* width height num_colors chars_per_pixel */
+"16 12 4 1",
+/* colors */
+" s None c None",
+". c black",
+"X c #f0ff80",
+"+ c red",
+/* pixels */
+" .... ",
+" .XXXX. ",
+" .XXXXXX. ",
+"............. ",
+".XXXXXXXXXXX. ",
+".XXXXX+XXXXX. ",
+".XXXXX+XXXXX. ",
+".XX+++++++XX. ",
+".XXXXX+XXXXX. ",
+".XXXXX+XXXXX. ",
+".XXXXXXXXXXX. ",
+"............. "};
+ }
+
+set data1 {
+/* XPM */
+static char * news4_xpm[] = {
+/* width height ncolors chars_per_pixel */
+"45 34 6 1",
+/* colors */
+" s None c None",
+". c black",
+"X c lemon chiffon",
+"o c tan",
+"O c blue",
+"+ c dark slate grey",
+/* pixels */
+" ",
+" ",
+" . ",
+" .X. ",
+" ..XX. ",
+" .XXX.X. ",
+" .XXX.XX. ",
+" .XXX.XXXX. ",
+" ..XXX.XXX.XX. ",
+" .XX...XXX.o..X. ",
+" .XX.OO.XX.oooo.X.. ",
+" .XXX..O.X.oo..oo..X.. ",
+" ..XXX.X..XX..o...oo.XXX. ",
+" .XXXX.XXXXX.XX.oo...XXXXX. ",
+" .XX..XXXX..XXXX.o.XXXX.XXX. ",
+" .X.X.XXXX.XXX.XX..XXX..XXXX. ",
+" ..X.XXXXX.XX..XXXXXXX.XXXX.XX. ",
+" .X.X.XXX.XX.XXXX.XXX.XXXX.XXX. ",
+" .X.X.X.XX.XXXX.XXXXXXX..XXX.. ",
+" .X.X.XX.XXX..XX.XXXX.XXX...+ ",
+" ++.X.X.XXXX.XXX.XXXX.XXX..++ ",
+" ++++.X.X.XX.XX..XXX.XXXX..++ ",
+" +++++.X.X.XXX.XXXX.XXX...++ ",
+" +++++.X.X.X.XXX..XXX..+++ ",
+" +++++.X.X.XXX.XXXX..++ ",
+" +++++.X.X.X.XXX...++ ",
+" ++++.X.X.XXX..+++ ",
+" ++++.X.X.X..++ ",
+" +++.XX...++ ",
+" ++...+++ ",
+" ++++ ",
+" ",
+" ",
+" "};
+}
+
+
+ # Test for create
+ #
+ #
+
+ # Good pixmap
+ #
+ test {set pixmap1 [image create pixmap -file f-ok.xpm]}
+
+ # With some comments
+ #
+ test {set pixmap2 [image create pixmap -file f-commt.xpm]}
+
+ # Bad color (should use "black" by default)
+ #
+ test {set pixmap3 [image create pixmap -file f-badcol.xpm]}
+
+ # Shortened lines (should show garbage, shouldn't core dump)
+ #
+ test {set pixmap4 [image create pixmap -file f-shortln.xpm]}
+
+ # Two chars per pixel
+ #
+ test {set pixmap5 [image create pixmap -file 2cpp.xpm]}
+
+ # Bad pixel (should show garbage for undefined pixels)
+ #
+ test {set pixmap6 [image create pixmap -file f-badpix.xpm]}
+
+
+ # Data switch
+ #
+ test {set pixmap7 [image create pixmap -data $data]}
+
+
+ # Missing one line
+ #
+ test {image create pixmap -file f-missline.xpm} {File For}
+
+ # Multi-word color names
+ #
+ test {set pixmap8 [image create pixmap -data $data1]}
+
+ # Brace used as pixel value
+ #
+ test {set pixmap9 [image create pixmap -file brace.xpm]}
+
+ # Many /* ... */ comments
+ #
+ test {set pixmap10 [image create pixmap -file brace.xpm]}
+
+ set num 10
+ for {set i 1} {$i < $num} {incr i} {
+ button .b$i -image [set pixmap$i] -bg red
+ pack .b$i
+ }
+
+ update
+
+ for {set i 1} {$i < $num} {incr i} {
+ destroy .b$i
+ image delete [set pixmap$i]
+ }
+
+}