blob: f56be1bf14aadcbf48c7aaca3cfdfa64ab455305 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#! /bin/bash
# This script tests: pamtopdbimg pdbimgtopam
# Also requires: pbmnoise pgmramp pamtopnm pamdepth
tmpdir=${tmpdir:-/tmp}
noise_pbm=${tmpdir}/noise.pbm
ellipse_pgm=${tmpdir}/ellipse.pgm
echo "Test 1: pbm grid : Should print 2224198737 25671 three times"
for flag in "-compressed" "-maybecompressed" "-uncompressed"
do
pamtopdbimg ${flag} testgrid.pbm | pdbimgtopam | cksum
done
echo "Test 2: pbmnoise : Should print 0 0 0 0 : 0 four times"
pbmnoise -randomseed=1 160 160 > ${noise_pbm}
for flag in "" "-compressed" "-maybecompressed" "-uncompressed"
do
pamtopdbimg ${flag} ${noise_pbm} | pdbimgtopam | pamtopnm | \
cmp -s - ${noise_pbm}
echo ${PIPESTATUS[@]} ":" $?
done
rm ${noise_pbm}
echo "Test 3: pgm ellipse : Should print 0 0 0 0 0 : 0 four times"
pgmramp -ellipse 160 160 -maxval=3 > ${ellipse_pgm}
for flag in "" "-compressed" "-maybecompressed" "-uncompressed"
do
pamtopdbimg ${flag} ${ellipse_pgm} | pdbimgtopam | \
pamtopnm | pamdepth 3 | cmp -s - ${ellipse_pgm}
echo ${PIPESTATUS[@]} ":" $?
done
rm ${ellipse_pgm}
echo "Test 4: pgm ellipse -4depth : Should print 0 0 0 0 0 : 0 three times"
pgmramp -ellipse 160 160 -maxval=15 > ${ellipse_pgm}
for flag in "-compressed" "-maybecompressed" "-uncompressed"
do
pamtopdbimg -4depth ${flag} ${ellipse_pgm} | pdbimgtopam | \
pamtopnm | pamdepth 15 | cmp -s - ${ellipse_pgm}
echo ${PIPESTATUS[@]} ":" $?
done
rm ${ellipse_pgm}
|