about summary refs log tree commit diff
path: root/test/ppmshift.test
blob: cd086d688c501af729aa3f2cd84bc2a34c166533 (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
#! /bin/bash
# This script tests: ppmshift
# Also requires:

echo "Test 1. Should print: 3705777303 101484"
ppmshift -seed=1 10 testimg.ppm | cksum

echo "Test 2. Should print: 202790723 685"
ppmshift -seed=1 1 testgrid.pbm | cksum

echo "Test 3. Should print: 0 : 0"
ppmshift -seed=1 0 testimg.ppm | cmp -s - testimg.ppm | \
  echo ${PIPESTATUS[@]} ":" $?

tmpdir=${tmpdir:-/tmp}
test_pbm=${tmpdir}/test.pbm

ppmshift -seed=2 14 testgrid.pbm > ${test_pbm}

for i in 15 16 20 1000
  do
  echo "Test 4. ("$i") Should print: 0 : 0"
  ppmshift -seed=2 $i testgrid.pbm > ${test_pbm} | cmp -s - testgrid.ppm | \
    echo ${PIPESTATUS[@]} ":" $?
  done

rm ${test_pbm}