about summary refs log tree commit diff
path: root/test/pamtopam.test
blob: c12470ec50a3b4ac53c59262ac0c81d025e50438 (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
#! /bin/sh
# This script tests: pamtopam
# Also requires: pgmmake pamseq

echo "Test 1. Should print five PAM headers"

pamtopam < testgrid.pbm | sed '/ENDHDR/q'
pgmmake 0.5 1 1 | pamtopam | sed '/ENDHDR/q'
pamtopam < testimg.ppm  | sed '/ENDHDR/q'
pamseq -tupletype="GRAYSCALE_ALPHA" 2 7 | pamtopam | sed '/ENDHDR/q'
pamseq -tupletype="RGB_ALPHA" 4 1 | pamtopam | sed '/ENDHDR/q'

echo "Test 2. Should print 2260748250 293"
pamtopam < testgrid.pbm  | cksum

echo "Test 3. Should print 1873848880 101532"
pamtopam < testimg.ppm   | cksum

echo "Test 4. Should print 1475247910 3432 twice"
pamtopam < maze.pbm  | cksum
pamtopam < maze.pbm  | pamtopam | cksum

echo "Test 5. Should print 2347274358 101825 twice"
cat testgrid.pbm testimg.ppm | pamtopam | cksum
( pamtopam  < testgrid.pbm; pamtopam < testimg.ppm ) | cksum