about summary refs log tree commit diff
path: root/test/sunicon-roundtrip.test
blob: 38513ea85d8c2ff3c9dcd1397dfff60c1088edf3 (plain) (blame)
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
#! /bin/sh
# This script tests: pbmtosunicon sunicontopnm
# Also requires: pbmnoise

# Width of a Sun icon is always a multiple of 8.

tmpdir=${tmpdir:-/tmp}

noise16_pbm=${tmpdir}/noise16.pbm
noise32_pbm=${tmpdir}/noise32.pbm
noise64_pbm=${tmpdir}/noise64.pbm

echo "Test.  Should print 0 three times"
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 ${noise16_pbm} ${noise32_pbm} ${noise64_pbm}