about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-10-10 16:11:43 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-10-10 16:11:43 +0000
commit059c2601ade1db66a667bd875c73b4b9f51112ec (patch)
treec0e1de76874fa83c90bd88f47ba867940b465acc /test
parent32205e919627a931b98986c661b4df2741e76754 (diff)
downloadnetpbm-mirror-059c2601ade1db66a667bd875c73b4b9f51112ec.tar.gz
netpbm-mirror-059c2601ade1db66a667bd875c73b4b9f51112ec.tar.xz
netpbm-mirror-059c2601ade1db66a667bd875c73b4b9f51112ec.zip
Add gif-transparent1, pbm-ppm-roundtrip, improve pamflip-roundtrip, pgmtoppm
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4153 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test')
-rw-r--r--test/Test-Order3
-rw-r--r--test/gif-transparent1.ok99
-rwxr-xr-xtest/gif-transparent1.test224
-rw-r--r--test/pamflip-roundtrip.ok10
-rwxr-xr-xtest/pamflip-roundtrip.test21
-rw-r--r--test/pbm-ppm-roundtrip.ok39
-rwxr-xr-xtest/pbm-ppm-roundtrip.test35
-rw-r--r--test/pgmtoppm.ok36
-rwxr-xr-xtest/pgmtoppm.test137
-rwxr-xr-xtest/random-generator.test2
10 files changed, 595 insertions, 11 deletions
diff --git a/test/Test-Order b/test/Test-Order
index 6f4334af..67ce0831 100644
--- a/test/Test-Order
+++ b/test/Test-Order
@@ -136,6 +136,8 @@ rawtoppm.test
 
 pbm-misc-converters.test
 
+gif-transparent1.test
+
 # Miscellaneous utility tests
 
 ppmdfont.test
@@ -152,6 +154,7 @@ pnminvert-roundtrip.test
 pamflip-roundtrip.test
 pamdepth-roundtrip.test
 pad-crop-roundtrip.test
+pbm-ppm-roundtrip.test
 cut-paste-roundtrip.test
 rgb3-roundtrip.test
 ppmchange-roundtrip.test
diff --git a/test/gif-transparent1.ok b/test/gif-transparent1.ok
new file mode 100644
index 00000000..a531329a
--- /dev/null
+++ b/test/gif-transparent1.ok
@@ -0,0 +1,99 @@
+Test 0.
+Should print 0 or 1 0.
+Image 1: 1 0
+Image 2: 1 0
+Image 3: 0
+Image 4: 0
+Image 5: 0
+Test 1.
+Should print 0 unless otherwise stated.
+Image 1
+a1: 1 (should print 1)
+a2: 0
+a3: 0
+b1: 1 (should print 1)
+b2: 0
+b3: 0
+c1: 0
+c2: 0
+c3: 0
+c4: 0
+d1: 0
+d2: 0
+Image 2
+a1: 1 (should print 1)
+a2: 0
+a3: 0
+b1: 1 (should print 1)
+b2: 0
+b3: 0
+c1: 0
+c2: 0
+c3: 0
+c4: 0
+d1: 0
+d2: 0
+Image 3
+a1: 1 (should print 1)
+a2: 0
+a3: 0
+b1: 1 (should print 1)
+b2: 0
+b3: 0
+c1: 0
+c2: 0
+c3: 0
+c4: 0
+d1: 0
+d2: 0
+Test 2.
+Should print 0 unless otherwise stated.
+Image 1
+cl1: 0
+cl2: 0
+op1: 1 (should print 1)
+op2: 0
+Image 2
+cl1: 0
+cl2: 0
+op1: 1 (should print 1)
+op2: 0
+Image 3
+cl1: 0
+cl2: 0
+op1: 1 (should print 1)
+op2: 0
+Test 3.
+Should print 0 in all cases.
+Image 1
+a2: 0
+a3: 0
+b2: 0
+b3: 0
+c4: 0
+Image 2
+a2: 0
+a3: 0
+b2: 0
+b3: 0
+c4: 0
+Image 3
+a2: 0
+a3: 0
+b2: 0
+b3: 0
+c4: 0
+Test 4.
+Should print 0 in all cases.
+color=rgb:0f/0f/0f
+0
+0
+0
+color=rgb:ff/00/00
+0
+0
+0
+color=rgb:00/ff/00
+0
+0
+0
diff --git a/test/gif-transparent1.test b/test/gif-transparent1.test
new file mode 100755
index 00000000..4684d1fc
--- /dev/null
+++ b/test/gif-transparent1.test
@@ -0,0 +1,224 @@
+#! /bin/bash
+# This script tests: giftopnm pamtogif ppmtogif
+# Also requires: pamarith pamcomp pamdepth pamenlarge pamstack pbmmake
+# Also requires: pnminvert ppmchange ppmpat ppmtopgm ppmtoppm 
+
+tmpdir=${tmpdir:-/tmp}
+
+madras_ppm=${tmpdir}/madras.ppm
+gingham_ppm=${tmpdir}/gingham.ppm
+argyle_ppm=${tmpdir}/argyle.ppm
+
+alpha0_pbm=${tmpdir}/alpha0.pbm
+alpha1_pbm=${tmpdir}/alpha1.pbm
+clear_pbm=${tmpdir}/clear.pbm
+opaque_pbm=${tmpdir}/opaque.pbm
+alpha0_pam=${tmpdir}/alpha0.pam
+alpha1_pam=${tmpdir}/alpha1.pam
+clear_pam=${tmpdir}/clear.pam
+opaque_pam=${tmpdir}/opaque.pam
+
+image0_alpha_pam=${tmpdir}/image0.alpha.pam
+image1_alpha_pam=${tmpdir}/image1.alpha.pam
+
+out_pnm=${tmpdir}/out.pnm
+out0_ppm=${tmpdir}/out0.ppm
+out1_ppm=${tmpdir}/out1.ppm
+out2_ppm=${tmpdir}/out2.ppm
+a0_out_pbm=${tmpdir}/a0.out.pbm
+a1_out_pbm=${tmpdir}/a1.out.pbm
+
+# Make test images & alpha masks
+
+ppmpat -argyle2 \
+  -color=rgb:00/00/00,rgb:ff/ff/ff,rgb:ff/ff/ff 40 24 > ${argyle_ppm}
+ppmpat -gingham3 \
+  -color=rgb:3f/3f/3f,rgb:7f/7f/7f,rgb:ef/ef/ef 40 24 > ${gingham_ppm}
+ppmpat -madras \
+       -color=rgb:0f/0f/0f,rgb:ff/00/00,rgb:00/ff/00 40 24 > ${madras_ppm}
+
+pbmmake -g 5 3 | pamenlarge 8 | tee ${alpha0_pbm} | \
+  pamdepth 255 > ${alpha0_pam}
+pnminvert ${alpha0_pbm} | tee ${alpha1_pbm} | \
+  pamdepth 255 > ${alpha1_pam}
+
+pbmmake -w 40 24 | tee ${clear_pbm} | pamdepth 255 > ${clear_pam}
+pbmmake -b 40 24 | tee ${opaque_pbm} | pamdepth 255 > ${opaque_pam}
+
+
+echo "Test 0."
+echo "Should print 0 or 1 0."
+i=1
+for test_pnm in ${argyle_ppm} ${gingham_ppm} ${madras_ppm} \
+			      ${alpha0_pbm} ${alpha1_pbm}
+  do
+  echo -n "Image $i: "; i=$((i+1));
+  pamtogif ${test_pnm} | giftopnm | tee ${out_pnm} | \
+    cmp -s - ${test_pnm}; result=$?
+
+  if [ $result -eq 0 ];
+    then echo $?;
+  else
+    ppmtoppm < ${out_pnm} | cmp -s - ${test_pnm}; echo $result $?
+  fi
+  # madras, alpha, alpha1 : should match
+  # argyle: giftopnm produces PBM, gingham: giftopnm produces PGM
+  rm ${out_pnm}
+  done
+
+
+echo "Test 1."  # Color + alpha channel
+echo "Should print 0 unless otherwise stated."
+
+i=1
+for test_pnm in  ${argyle_ppm} ${gingham_ppm} ${madras_ppm}
+  do
+  echo "Image $i"; i=$((i+1));
+
+  pamstack -tupletype="RGB_ALPHA" ${test_pnm} ${alpha0_pam} > \
+    ${image0_alpha_pam}
+  pamstack -tupletype="RGB_ALPHA" ${test_pnm} ${alpha1_pam} > \
+    ${image1_alpha_pam}
+
+  pamtogif ${image0_alpha_pam} | giftopnm -alphaout=${a0_out_pbm} | \
+    ppmtoppm | tee ${out0_ppm} | \
+    cmp -s - ${test_pnm}; echo "a1:" $? "(should print 1)"
+  cmp -s ${alpha0_pbm} ${a0_out_pbm}; echo "a2:" $?  # Should match
+
+  pamarith -multiply ${test_pnm} ${alpha0_pbm} | \
+    cmp -s - ${out0_ppm}; echo "a3:" $? # Should match
+
+  pamtogif ${image1_alpha_pam} | giftopnm -alphaout=${a1_out_pbm} | \
+    ppmtoppm | tee ${out1_ppm} | \
+    cmp -s - ${test_pnm}; echo "b1:" $? "(should print 1)"
+
+  cmp -s ${alpha1_pbm} ${a1_out_pbm}; echo "b2:" $?  # Should match
+
+  pamarith -multiply ${test_pnm} ${alpha1_pam} | \
+    cmp -s - ${out1_ppm}; echo "b3:" $?    # Should match
+
+  pamarith -multiply ${test_pnm} ${alpha0_pbm} | \
+    cmp -s - ${out0_ppm}; echo "c1:" $?    # Should match
+
+  pamarith -multiply ${test_pnm} ${alpha1_pbm} | \
+    cmp -s - ${out1_ppm}; echo "c2:" $?    # Should match
+
+  pamcomp -alpha=${alpha0_pbm} ${out0_ppm} ${out1_ppm} | \
+    cmp -s - ${test_pnm}; echo "c3:" $?    # Should match
+
+  pamcomp -alpha=${alpha1_pbm} ${out1_ppm} ${out0_ppm} | \
+    cmp -s - ${test_pnm}; echo "c4:" $?    # Should match
+
+  pamtogif ${image0_alpha_pam} -alphacolor=rgb:00/00/80 | \
+    giftopnm  -alphaout=${a0_out_pbm} > /dev/null
+    cmp -s ${a0_out_pbm} ${alpha0_pbm}; echo "d1:" $?    # Should match
+
+  pamtogif ${image0_alpha_pam} -alphacolor=rgb:00/00/80 | \
+    giftopnm | ppmtoppm | \
+    ppmchange rgb:00/00/80 rgb:00/00/00 -remainder=rgb:ff/ff/ff | \
+    ppmtopgm | \
+    cmp -s - ${alpha0_pam}; echo "d2:" $?    # Should match
+
+  rm ${image0_alpha_pam} ${image1_alpha_pam}
+  rm ${out0_ppm} ${out1_ppm} # ${out0_pnm} ${out1_pnm}
+  rm ${a0_out_pbm} ${a1_out_pbm}
+
+  done
+
+echo "Test 2."  # clear/opaque alpha channel
+echo "Should print 0 unless otherwise stated."
+
+i=1
+for test_pnm in  ${argyle_ppm} ${gingham_ppm} ${madras_ppm}
+  do
+  echo "Image $i"; i=$((i+1));
+
+  pamstack -tupletype="RGB_ALPHA" ${test_pnm} ${clear_pam} > \
+    ${image0_alpha_pam}
+  pamstack -tupletype="RGB_ALPHA" ${test_pnm} ${opaque_pam} > \
+    ${image1_alpha_pam}
+
+  # clear
+  pamtogif ${image0_alpha_pam} | giftopnm -alphaout=${a0_out_pbm} | \
+    ppmtoppm | tee ${out0_ppm} | \
+    cmp -s - ${test_pnm}; echo "cl1:" $? # Should match
+  cmp -s ${clear_pbm} ${a0_out_pbm}; echo "cl2:" $?  # Should match
+
+  # opaque
+  pamtogif ${image1_alpha_pam} | giftopnm -alphaout=${a1_out_pbm} | \
+    tee ${out1_ppm} | \
+    cmp -s - ${test_pnm}; echo "op1:" $? "(should print 1)"
+
+  cmp -s ${opaque_pbm} ${a1_out_pbm}; echo "op2:" $?  # Should match
+
+  rm ${image0_alpha_pam} ${image1_alpha_pam}
+  rm ${out0_ppm} ${out1_ppm}
+  rm ${a0_out_pbm} ${a1_out_pbm}
+
+  done
+
+rm ${clear_pbm} ${clear_pam} ${opaque_pbm} ${opaque_pam}
+
+
+echo "Test 3."  # ppmtogif
+echo "Should print 0 in all cases."
+
+i=1
+for test_pnm in  ${argyle_ppm} ${gingham_ppm} ${madras_ppm}
+  do
+  echo "Image $i"; i=$((i+1));
+
+  ppmtogif -alpha=${alpha0_pbm} ${test_pnm} | \
+    giftopnm -alphaout=${a0_out_pbm} | \
+    ppmtoppm > ${out0_ppm}
+    cmp -s ${alpha0_pbm} ${a0_out_pbm}; echo "a2:" $?  # Should match
+  pamarith -multiply ${test_pnm} ${alpha0_pbm} | \
+    cmp -s - ${out0_ppm}; echo "a3:" $? # Should match
+
+  ppmtogif -alpha=${alpha1_pbm} ${test_pnm} | \
+    giftopnm -alphaout=${a1_out_pbm} | \
+    ppmtoppm > ${out1_ppm}
+    cmp -s ${alpha1_pbm} ${a1_out_pbm}; echo "b2:" $?  # Should match
+  pamarith -multiply ${test_pnm} ${alpha1_pam} | \
+    cmp -s - ${out1_ppm}; echo "b3:" $?    # Should match
+
+  pamcomp -alpha=${alpha1_pbm} ${out1_ppm} ${out0_ppm} | \
+    cmp -s - ${test_pnm}; echo "c4:" $?    # Should match
+
+  rm ${out0_ppm} ${out1_ppm}
+  rm ${a0_out_pbm} ${a1_out_pbm}
+
+  done
+
+rm ${alpha0_pbm} ${alpha1_pbm}
+rm ${alpha0_pam} ${alpha1_pam}
+rm ${argyle_ppm} ${gingham_ppm}
+
+
+echo "Test 4."
+echo "Should print 0 in all cases."
+# no separate alpha channel
+# designate colors which appear in madras as transparent 
+
+for color in "0f/0f/0f" "ff/00/00" "00/ff/00"
+  do
+  echo "color=rgb:"${color}
+  pamtogif -transparent=rgb:${color} ${madras_ppm} | \
+    giftopnm -alphaout=${a0_out_pbm} > ${out0_ppm}
+    cmp -s ${madras_ppm} ${out0_ppm}; echo $?   # Should match 
+
+  pbmmake -g 40 24 | pamdepth 255 | pamstack ${madras_ppm} - | 
+  pamtogif -transparent=rgb:${color} - | \
+    giftopnm -alphaout=${a1_out_pbm} > ${out1_ppm}
+    cmp -s ${madras_ppm} ${out1_ppm}; echo $?   # Should match 
+
+  ppmchange rgb:${color} rgb:00/00/00 \
+    -remainder=rgb:ff/ff/ff ${madras_ppm} > ${out2_ppm}
+
+  ppmtoppm < ${a0_out_pbm} | \
+    cmp -s ${out2_ppm} -; echo $?   # Should match 
+
+  rm ${out0_ppm} ${out1_ppm} ${out2_ppm} ${a0_out_pbm} ${a1_out_pbm}
+  done
+
+rm ${madras_ppm} 
diff --git a/test/pamflip-roundtrip.ok b/test/pamflip-roundtrip.ok
index 653ab007..ff469d0b 100644
--- a/test/pamflip-roundtrip.ok
+++ b/test/pamflip-roundtrip.ok
@@ -1,9 +1,19 @@
+Test 1.  Should produce 1926073387 101484 14 times
 1926073387 101484
 1926073387 101484
 1926073387 101484
 1926073387 101484
 1926073387 101484
 1926073387 101484
+1926073387 101484
+1926073387 101484
+1926073387 101484
+1926073387 101484
+1926073387 101484
+1926073387 101484
+1926073387 101484
+1926073387 101484
+Test 2.  Should produce 2425386270 41 6 times
 2425386270 41
 2425386270 41
 2425386270 41
diff --git a/test/pamflip-roundtrip.test b/test/pamflip-roundtrip.test
index c5a34ad9..d188c1a0 100755
--- a/test/pamflip-roundtrip.test
+++ b/test/pamflip-roundtrip.test
@@ -2,6 +2,9 @@
 # This script tests: pamflip
 # Also requires:
 
+echo "Test 1.  Should produce 1926073387 101484 14 times"
+
+# TODO use smaller image
 
 pamflip -lr testimg.ppm | pamflip -lr | cksum
 pamflip -tb testimg.ppm | pamflip -tb | cksum
@@ -16,6 +19,19 @@ pamflip -r270 testimg.ppm | \
   pamflip -r270 | \
   pamflip -r270 | \
   pamflip -r270 | cksum
+pamflip -xform=leftright testimg.ppm | pamflip -leftright | cksum
+pamflip -xform=topbottom testimg.ppm | pamflip -topbottom | cksum
+pamflip -xform=transpose testimg.ppm | pamflip -transpose | cksum
+pamflip -xform=leftright,leftright testimg.ppm | cksum
+pamflip -xform=topbottom,topbottom testimg.ppm | cksum
+pamflip -xform=transpose,transpose testimg.ppm | cksum
+pamflip -tb testimg.ppm | pamflip -lr | \
+  pamflip -xform=leftright,topbottom | cksum
+pamflip -tb testimg.ppm | pamflip -lr | pamflip -xy | \
+  pamflip -xform=leftright,topbottom,transpose | cksum
+
+
+echo "Test 2.  Should produce 2425386270 41 6 times"
 
 pamflip -lr testgrid.pbm | \
   pamflip -lr | cksum
@@ -33,3 +49,8 @@ pamflip -r270 testgrid.pbm | \
   pamflip -r270 | \
   pamflip -r270 | \
   pamflip -r270 | cksum
+
+
+# TODO: single pixel image, one-dimensional (single row, single column) image
+# PBM various lengths: samples with -lr
+
diff --git a/test/pbm-ppm-roundtrip.ok b/test/pbm-ppm-roundtrip.ok
new file mode 100644
index 00000000..bcc090b6
--- /dev/null
+++ b/test/pbm-ppm-roundtrip.ok
@@ -0,0 +1,39 @@
+Test 1.  Should print 2425386270 41 five times.
+2425386270 41
+2425386270 41
+2425386270 41
+2425386270 41
+2425386270 41
+Test 2.
+P1
+7 3
+0000000
+0000000
+0000000
+
+P1
+7 3
+0000000
+0000000
+0000000
+
+P1
+7 3
+0000000
+0000000
+0000000
+
+P1
+17 2
+11111111111111111
+11111111111111111
+
+P1
+17 2
+11111111111111111
+11111111111111111
+
+P1
+17 2
+11111111111111111
+11111111111111111
diff --git a/test/pbm-ppm-roundtrip.test b/test/pbm-ppm-roundtrip.test
new file mode 100755
index 00000000..b8ef0ef6
--- /dev/null
+++ b/test/pbm-ppm-roundtrip.test
@@ -0,0 +1,35 @@
+#! /bin/bash
+# This script tests: pgmtoppm ppmtopgm ppmtoppm pgmtopbm
+# Also requires: pbmmake pgmcolormask pnminvert
+
+echo "Test 1.  Should print 2425386270 41 five times."
+
+cat testgrid.pbm | cksum
+pgmtoppm black-white testgrid.pbm | ppmtopgm | \
+  pgmtopbm -th -val=0.5 | cksum
+pgmtoppm white-black testgrid.pbm | ppmtopgm | \
+  pgmtopbm -th -val=0.5 | pnminvert | cksum
+pgmtoppm white-black testgrid.pbm | ppmcolormask white | cksum
+ppmtoppm < testgrid.pbm | ppmtopgm | pgmtopbm -th -val=0.5 | cksum
+
+echo "Test 2."
+
+pbmmake -w 7 3  -plain
+echo
+
+pbmmake -w 7 3 | pgmtoppm black-white | ppmtopgm | \
+  pgmtopbm -th -val=0.5 -plain
+echo
+pbmmake -w 7 3 | ppmtoppm | ppmtopgm | \
+  pgmtopbm -th -val=0.5 -plain
+echo
+
+pbmmake -b 17 2 -plain
+echo
+
+pbmmake -b 17 2 | pgmtoppm black-white | ppmtopgm | \
+  pgmtopbm -th -val=0.5 -plain
+echo
+pbmmake -b 17 2 | ppmtoppm | ppmtopgm | \
+  pgmtopbm -th -val=0.5 -plain
+
diff --git a/test/pgmtoppm.ok b/test/pgmtoppm.ok
index 55e5af95..2484c487 100644
--- a/test/pgmtoppm.ok
+++ b/test/pgmtoppm.ok
@@ -1,3 +1,39 @@
+Test 1.  Should print 1767073524 779 twice, then 1676700883 779
+1767073524 779
 1767073524 779
 1676700883 779
+Test 2.  Should print 718580145 779 twice
+718580145 779
+718580145 779
+Test 3.  Should print 718580145 779 twice
+718580145 779
 718580145 779
+Test 4.  Should print 829921912 685 seven times
+829921912 685
+829921912 685
+829921912 685
+829921912 685
+829921912 685
+829921912 685
+829921912 685
+Test 5.  Should print 934505096 685 four times
+934505096 685
+934505096 685
+934505096 685
+934505096 685
+Test 6. Should print 3083028153 685 three times
+3083028153 685
+3083028153 685
+3083028153 685
+Test 7 Invalid
+Expected failure 1 1
+Expected failure 2 1
+Expected failure 3 1
+Expected failure 4 1
+Expected failure 5 1
+Expected failure 6 1
+Expected failure 7 1
+Expected failure 8 1
+Expected failure 9 1
+Expected failure 10 1
+Expected failure 11 1
diff --git a/test/pgmtoppm.test b/test/pgmtoppm.test
index 70df0d97..e9bd1a59 100755
--- a/test/pgmtoppm.test
+++ b/test/pgmtoppm.test
@@ -1,22 +1,139 @@
 #! /bin/bash
 # This script tests: pgmtoppm
-# Also requires: pamseq pamtopnm pgmramp
-
+# Also requires: pamtopnm pgmtoppm pnminvert pamseq pgmramp
 
 tmpdir=${tmpdir:-/tmp}
 
+echo "Test 1.  Should print 1767073524 779 twice, then 1676700883 779"
+
 test_pgm=${tmpdir}/test.pgm
-palette=${tmpdir}/palette
+palette_pam=${tmpdir}/palette.pam
+palette_ppm=${tmpdir}/palette.ppm
 
-pgmramp -maxval=5 -lr 256 1 >${test_pgm}
-pamseq 3 5 -tupletype=RGB | pamtopnm \
-  >${palette}
+pgmramp -maxval=5 -lr 256 1 > ${test_pgm}
 
-# Test 1.
 pgmtoppm green ${test_pgm} | cksum
-
+pgmtoppm black-green ${test_pgm} | cksum
 pgmtoppm yellow-blue ${test_pgm} | cksum
 
-pgmtoppm -map=${palette} ${test_pgm} | cksum
 
-rm ${test_pgm} ${palette}
+echo "Test 2.  Should print 718580145 779 twice"
+pamseq 3 5 -tupletype=RGB | tee ${palette_pam} | pamtopnm > ${palette_ppm}
+pgmtoppm -map=${palette_pam} ${test_pgm} | cksum
+pgmtoppm -map=${palette_ppm} ${test_pgm} | cksum
+
+rm ${palette_pam}
+
+echo "Test 3.  Should print 718580145 779 twice"
+
+pgmtoppm white-black ${test_pgm} | pnminvert | cksum
+pnminvert ${test_pgm} | pgmtoppm white-black | cksum
+
+rm ${test_pgm}
+
+echo "Test 4.  Should print 829921912 685 seven times"
+
+pgmtoppm white testgrid.pbm | cksum
+pgmtoppm black-white testgrid.pbm | cksum
+pgmtoppm rgb:ff/ff/ff testgrid.pbm | cksum
+pgmtoppm -white=rgb-255:255/255/255 testgrid.pbm | cksum
+pgmtoppm rgb:00/00/00-rgb:ff/ff/ff testgrid.pbm | cksum
+pgmtoppm rgbi:0/0/0-rgbi:1/1/1 testgrid.pbm | cksum
+pgmtoppm -black=rgb-255:0/0/0 -white=rgb-255:255/255/255 testgrid.pbm | cksum
+
+echo "Test 5.  Should print 934505096 685 four times"
+
+pgmtoppm white-black testgrid.pbm | cksum
+pgmtoppm white testgrid.pbm | pnminvert| cksum
+pnminvert testgrid.pbm | pgmtoppm black-white | cksum
+pnminvert testgrid.pbm | pgmtoppm white | cksum
+
+echo "Test 6. Should print 3083028153 685 three times"
+
+pgmtoppm black testgrid.pbm | cksum
+pgmtoppm black-black testgrid.pbm | cksum
+pgmtoppm rgbi:0/0/0-rgbi:0/0/0 testgrid.pbm | cksum
+
+echo "Test 7 Invalid"
+
+tmpdir=${tmpdir:-/tmp}
+test_out=${tmpdir}/test_out
+
+echo 1>&2
+echo "Invalid command-line argument combinations." 1>&2
+echo "Error messages should appear below the line." 1>&2
+echo "-----------------------------------------------------------" 1>&2
+
+pgmtoppm white testimg.ppm > \
+  ${test_out} || \
+  echo -n "Expected failure 1"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm -map=/dev/null testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 2"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm black white testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 3"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm hwite testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 4"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm off-color testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 5"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm rgb-255:7/7/7 testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 6"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm -black=black -white=white white testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 7"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm -black=rgb:0/0/0 -map=${palette_ppm} testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 8"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm -white=rgb:ff/ff/ff -map=${palette_ppm} testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 9"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm rgb:ff/ff/ff -map=${palette_ppm} testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 10"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+pgmtoppm rgb:00/00/00-rgb:ff/ff/ff -map=${palette_ppm} testgrid.pbm > \
+  ${test_out} || \
+  echo -n "Expected failure 11"
+  test -s ${test_out}; echo " "$?
+  rm -f {test_out}
+
+#pgmtoppm rgb-255:7/7/7 testgrid.pbm > \
+#  ${test_out} || \
+#  echo -n "Expected failure 12"
+#  test -s ${test_out}; echo " "$?
+#  rm -f {test_out}
+
+rm -f ${palette_ppm}
diff --git a/test/random-generator.test b/test/random-generator.test
index ef204e4b..23dc1903 100755
--- a/test/random-generator.test
+++ b/test/random-generator.test
@@ -55,7 +55,7 @@ perlPgmProcessorProgram='
   }
 '
 
-pgmnoise -randomseed=5489 -plain -maxval=65535 10 200 | tee /tmp/z |
+pgmnoise -randomseed=5489 -plain -maxval=65535 10 200 | \
   perl -walne "$perlPgmProcessorProgram"
 
 # The above outputs (10 * 200 / 2) = 1000 samples.