@@ -12,21 +12,45 @@ rose_red=${tmpdir}/rose.red
12
12
rose_grn=${tmpdir} /rose.grn
13
13
rose_blu=${tmpdir} /rose.blu
14
14
15
- pnmquantall 20 ${rose_red} ${rose_grn} ${rose_blu}
15
+ cp ${rose_red} ${rose_red} .1
16
+ cp ${rose_grn} ${rose_grn} .1
17
+ cp ${rose_blu} ${rose_blu} .1
16
18
17
- for i in ${rose_red} ${rose_grn} ${rose_blu}
19
+ echo " Test 1."
20
+
21
+ pnmquantall 20 ${rose_red} .1 ${rose_grn} .1 ${rose_blu} .1
22
+
23
+ for i in ${rose_red} .1 ${rose_grn} .1 ${rose_blu} .1
18
24
do
19
25
cat $i | cksum
20
26
done
21
27
22
- # Should print 1
28
+ pamcat ${rose_red} .1 ${rose_grn} .1 ${rose_blu} .1 -tb | \
29
+ pgmhist -m | \
30
+ awk ' $2>0 {s++};
31
+ END { printf("color count %u: %s\n", s,
32
+ (s==20) ? "success" : "failure") }'
23
33
24
- pamcat ${rose_red} ${rose_grn} ${rose_blu} -tb | \
25
- pgmhist -m | awk ' $2>0 {s++}; END { print (s<=20) }'
34
+ rm ${rose_red} .1 ${rose_grn} .1 ${rose_blu} .1
26
35
36
+ echo " Test 2."
27
37
28
- tmpdir=${tmpdir:-/ tmp}
29
- rose_out=${tmpdir} /rose_out
38
+ pnmquantall -ext .2 1 ${rose_red} ${rose_grn} ${rose_blu}
39
+
40
+ for i in ${rose_red} .2 ${rose_grn} .2 ${rose_blu} .2
41
+ do
42
+ cat $i | cksum
43
+ done
44
+
45
+ pamcat ${rose_red} .2 ${rose_grn} .2 ${rose_blu} .2 -tb | \
46
+ pgmhist -m | \
47
+ awk ' $2>0 {s++};
48
+ END { printf("color count %u: %s\n", s,
49
+ (s==1) ? "success" : "failure") }'
50
+
51
+ rm ${rose_red} .2 ${rose_grn} .2 ${rose_blu} .2
52
+
53
+ echo " Test Invalid"
30
54
31
55
echo 1>&2
32
56
echo " Invalid command-line argument combinations." 1>&2
@@ -37,11 +61,11 @@ pnmquantall -ext xx 0 ${rose_red} ${rose_grn} ${rose_blu} || \
37
61
echo " Expected failure 1"
38
62
rm ${rose_red} xx ${rose_grn} xx ${rose_blu} xx || \
39
63
echo " Expected failure 1.rm"
40
- pnmquantall -ext xx 1 ${rose_red} ${rose_grn} ${rose_blu} || \
64
+ pnmquantall -ext yy ${rose_red} ${rose_grn} ${rose_blu} || \
41
65
echo " Expected failure 2"
42
- rm ${rose_red} xx ${rose_grn} xx ${rose_blu} xx || \
66
+ rm ${rose_red} yy ${rose_grn} yy ${rose_blu} yy || \
43
67
echo " Expected failure 2.rm"
44
- pnmquantall -ext xx 2 || \
68
+ pnmquantall -ext zz 2 || \
45
69
echo " Expected failure 3"
46
70
47
71
rm ${rose_red} ${rose_grn} ${rose_blu} ${rose_ppm}
0 commit comments