diff options
Diffstat (limited to 'test/sunicon-roundtrip.test')
-rwxr-xr-x | test/sunicon-roundtrip.test | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/test/sunicon-roundtrip.test b/test/sunicon-roundtrip.test index c5b85909..38513ea8 100755 --- a/test/sunicon-roundtrip.test +++ b/test/sunicon-roundtrip.test @@ -1,27 +1,26 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtosunicon sunicontopnm -# Also requires: pamcut pnmpad +# Also requires: pbmnoise -# Width of Sun icons are multiples of 8. - -#imgsize=$(pamfile -size maze.pbm | awk '{print "-width="$1, "-height="$2}') +# Width of a Sun icon is always a multiple of 8. tmpdir=${tmpdir:-/tmp} -maze16_pbm=${tmpdir}/maze16.pbm -maze32_pbm=${tmpdir}/maze32.pbm -maze64_pbm=${tmpdir}/maze64.pbm - -pamcut -top=0 -left=0 -width=16 -height=16 maze.pbm > ${maze16_pbm} -pamcut -top=0 -left=0 -width=32 -height=32 maze.pbm > ${maze32_pbm} -pnmpad -width=64 -height=64 maze.pbm > ${maze64_pbm} +noise16_pbm=${tmpdir}/noise16.pbm +noise32_pbm=${tmpdir}/noise32.pbm +noise64_pbm=${tmpdir}/noise64.pbm echo "Test. Should print 0 three times" -pbmtosunicon ${maze16_pbm} | sunicontopnm | cmp -s - ${maze16_pbm} -echo $? -pbmtosunicon ${maze32_pbm} | sunicontopnm | cmp -s - ${maze32_pbm} -echo $? -pbmtosunicon ${maze64_pbm} | sunicontopnm | cmp -s - ${maze64_pbm} -echo $? +pbmnoise -randomseed=1 16 16 > ${noise16_pbm} && \ + pbmtosunicon ${noise16_pbm} | sunicontopnm | cmp -s - ${noise16_pbm} + echo $? + +pbmnoise -randomseed=1 32 32 > ${noise32_pbm} && \ + pbmtosunicon ${noise32_pbm} | sunicontopnm | cmp -s - ${noise32_pbm} + echo $? + +pbmnoise -randomseed=1 64 64 > ${noise64_pbm} && \ + pbmtosunicon ${noise64_pbm} | sunicontopnm | cmp -s - ${noise64_pbm} + echo $? -rm ${maze16_pbm} ${maze32_pbm} ${maze64_pbm} \ No newline at end of file +rm ${noise16_pbm} ${noise32_pbm} ${noise64_pbm} \ No newline at end of file |