summaryrefslogtreecommitdiffstats
path: root/tkimg/tests/xpm.test
blob: 8e8de2b8b7bd589e58aa5cbc616a9f591af914f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# This file is a Tcl script to test out GIF reading and writing.
# It is organized in the standard fashion for Tcl tests.
#

if {[string compare test [info procs test]] == 1} {
    source defs
}

catch {image delete i}

set xpmdata \
{/* XPM */
static char * InlineData[] = {
"16 12 3 1",
"  s None c None",
". c #000000",
"# c #f0ff80",
"   ....         ",
"  .####.        ",
" .######.       ",
".............   ",
".###########.   ",
".###########.   ",
".###########.   ",
".###########.   ",
".###########.   ",
".###########.   ",
".###########.   ",
".............   "};}

test xpm-1.1 {} {
    image create photo i -file 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