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

echo "Test: should print 1518149010 3065"
ppmmake rgb:0/0/0 255 12 | ppmtoapplevol | cksum

echo "Invalid input." 1>&2
echo "Error messages should appear below the line." 1>&2
echo "-----------------------------------------------------------" 1>&2

echo "Test Invalid"

tmpdir=${tmpdir:-/tmp}
test_out=${tmpdir}/test_out

pbmmake 10 11 | ppmtoapplevol > ${test_out} || \
  printf "Expected failure 1 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}
 
pbmmake 10 13 | ppmtoapplevol > ${test_out} || \
  printf "Expected failure 2 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}
 
pbmmake 256 12 | ppmtoapplevol > ${test_out} || \
  printf "Expected failure 3 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}