about summary refs log tree commit diff
path: root/test/pamchannel.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/pamchannel.test')
-rwxr-xr-xtest/pamchannel.test33
1 files changed, 12 insertions, 21 deletions
diff --git a/test/pamchannel.test b/test/pamchannel.test
index 2e017ef2..f3399343 100755
--- a/test/pamchannel.test
+++ b/test/pamchannel.test
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
 # This script tests: pamchannel
 # Also requires: pamtopam pamtopnm
 
@@ -12,27 +12,23 @@
 # 3164158573 33838 testimg.blu
 
 
-# Test 1. red channel
-# Should produce 1571496937 33838
-echo "Test 1"
-
+echo "Test 1:red-channel  Should produce 1571496937 33838"
 pamchannel -infile testimg.ppm 0 | \
   pamtopnm --assume | cksum
 
-# Test 2. green channel
-# Should produce  394856971 33838
-echo "Test 2"
-
+echo "Test 2:green-channel  Should produce 394856971 33838"
 pamchannel -infile testimg.ppm -tupletype="GRAYSCALE" 1 | \
   pamtopnm | cksum
 
-# Test 3. blue channel
-# Should produce 3164158573 33838
-echo "Test 3"
+echo "Test 3:blue-channel  Should produce 3164158573 33838"
 
 pamchannel -infile testimg.ppm 2 | \
   pamtopnm --assume | cksum
 
+echo "Test 4:single-channel  Should produce 281226646 481"
+pamchannel -infile maze.pbm 0 | \
+  pamtopnm --assume | cksum
+
 # Test invalid: specified channel does not exist
 
 echo 1>&2
@@ -45,13 +41,8 @@ test_out=${tmpdir}/test_out
 
 echo "Test Invalid"
 
-pamchannel  -infile testgrid.pbm 1 > ${test_out} || \
-   echo -n "Expected failure 1"; test -s ${test_out}; echo " "$?
-
-pamchannel  -infile testimg.ppm 3 > ${test_out} || \
-   echo -n "Expected failure 2"; test -s ${test_out}; echo " "$?
-
-pamtopam testimg.ppm | pamchannel -infile=- 4 > ${test_out} || \
-   echo -n "Expected failure 3"; test -s ${test_out}; echo " "$?
+. ${srcdir}/test-invalid.inc
 
-rm ${test_out}
\ No newline at end of file
+invCmd "pamchannel  -infile testgrid.pbm 1"
+invCmd "pamchannel  -infile testimg.ppm 3"
+invCmd "pamtopam testimg.ppm | pamchannel -infile=- 4"