about summary refs log tree commit diff
path: root/test/ppmspread.test
blob: d7e0fb372e2039e2ad6eb4c6c1d1da8ec03ec0d6 (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
#! /bin/sh
# This script tests: ppmspread
# Also requires: pamfile ppmtopgm pgmtopbm

# Input/output size does not change

echo "Test 1."
cat testimg.ppm | pamfile -machine
ppmspread -randomseed=100 20 testimg.ppm | pamfile -machine

echo "Test 2."
pamfile -size maze.pbm
ppmspread -randomseed=100 20 maze.pbm | pamfile -size

# No change when spread distance value is 0

echo "Test 3. Should print 281226646 481"
ppmspread -randomseed=1 0 maze.pbm | ppmtopgm | pgmtopbm | cksum

# The following tests will fail when changes are made to the random
# number generator

echo "Test 4. Should print 639729144 101484"
ppmspread -randomseed=1 10 testimg.ppm | cksum

echo "Test 5. Should print 3278353642 685"
ppmspread -randomseed=1 1 testgrid.pbm | cksum