about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-06-29 19:02:18 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-06-29 19:02:18 +0000
commit9602cdc10e7e2321ced1f30053a0b7b22edd433d (patch)
tree9a947bdd3cb43d45a8bfa3fc4288cac44ae4835e
parentfe835f6d3d19026dc3316de80062b44cfa78f7f9 (diff)
downloadnetpbm-mirror-9602cdc10e7e2321ced1f30053a0b7b22edd433d.tar.gz
netpbm-mirror-9602cdc10e7e2321ced1f30053a0b7b22edd433d.tar.xz
netpbm-mirror-9602cdc10e7e2321ced1f30053a0b7b22edd433d.zip
New tests
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1964 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rwxr-xr-xtest/Execute-Tests39
-rw-r--r--test/Test-Order10
-rw-r--r--test/all-in-place.ok4
-rwxr-xr-xtest/all-in-place.test426
-rwxr-xr-xtest/g3-roundtrip.test8
-rwxr-xr-xtest/gem-roundtrip.test2
-rw-r--r--test/gif-quant-roundtrip.ok1
-rw-r--r--test/gif-quant-roundtrip.test15
-rw-r--r--test/gif-roundtrip.ok1
-rwxr-xr-xtest/gif-roundtrip.test11
-rwxr-xr-xtest/pad-crop-roundtrip.test2
-rw-r--r--test/pamchannel.ok3
-rw-r--r--test/pamchannel.test32
-rwxr-xr-xtest/pamslice-roundtrip.test2
-rwxr-xr-xtest/pbmclean.test2
-rwxr-xr-xtest/pbmminkowski.test2
-rw-r--r--test/pgmcrater.ok1
-rw-r--r--test/pgmcrater.test29
-rw-r--r--test/pgmnoise.ok1
-rw-r--r--test/pgmnoise.test22
-rwxr-xr-xtest/pnm-plain-roundtrip.test2
-rw-r--r--test/pnmremap1.ok2
-rwxr-xr-xtest/pnmtile.test3
-rwxr-xr-xtest/pnmtopnm-plain.test2
-rw-r--r--test/ppmcie.out-641
-rwxr-xr-xtest/ppmdfont.test10
-rwxr-xr-xtest/ppmdim.test2
-rw-r--r--test/ppmforge.ok1
-rw-r--r--test/ppmforge.test20
-rwxr-xr-xtest/ppmhist.test2
-rwxr-xr-xtest/ppmmake.test2
-rwxr-xr-xtest/ppmmix.test1
-rwxr-xr-xtest/ppmpat.test39
-rw-r--r--test/ppmrough.ok1
-rw-r--r--test/ppmrough.test18
-rw-r--r--test/ps-roundtrip.ok1
-rwxr-xr-xtest/ps-roundtrip.test33
-rw-r--r--test/rgb3-roundtrip.ok1
-rwxr-xr-xtest/rgb3-roundtrip.test9
-rw-r--r--test/winicon-roundtrip.ok2
-rw-r--r--test/winicon-roundtrip.test13
-rwxr-xr-xtest/yuv-roundtrip.test3
42 files changed, 654 insertions, 127 deletions
diff --git a/test/Execute-Tests b/test/Execute-Tests
index bec1cd56..39fab58c 100755
--- a/test/Execute-Tests
+++ b/test/Execute-Tests
@@ -53,6 +53,9 @@ fi
 
 srcdir=$(dirname $0)
 
+# Provision to run programs under valgrind.
+# export PBM_TESTPREFIX="valgrind --log-fd=4 "${PBM_TESTPREFIX}
+
 # Set tmpdir, which is used in some of the test scripts.  By default
 # this is created by mktemp.  The user can override and specify tmpdir,
 # but in this case it must be an existing directory and must not be
@@ -60,7 +63,7 @@ srcdir=$(dirname $0)
 
 if [ -z $tmpdir ]
   then
-  tmpdir_created=$(mktemp -d TestPBM-XXXXXXX) || exit 1;
+    tmpdir_created=$(mktemp -d) || exit 1;
   export tmpdir=${tmpdir_created}
   else
   tmpdir_created="";
@@ -90,7 +93,13 @@ declare -a status=("SUCCESS" "FAILURE" "UNEXPECTED SUCCESS"
 
 # Copy test files to the current work directory
 
-cp -n -t . ${srcdir}/testgrid.pbm ${srcdir}/testimg.ppm 
+if [ ! -f ./testgrid.pbm ]
+  then cp -v ${srcdir}/testgrid.pbm ./testgrid.pbm
+fi
+
+if [ ! -f ./testimg.ppm ]
+  then cp -v ${srcdir}/testimg.ppm  ./testimg.ppm 
+fi
 
 # Execute the tests, as described in the "Test-Order" file.
 #
@@ -103,31 +112,31 @@ cp -n -t . ${srcdir}/testgrid.pbm ${srcdir}/testimg.ppm
 #
 # All tests are self-contained.
 #
-# By defeault the tests are executed in the order described in the
-# file Test-Order.  Normally the Test-Order in the source directory
-# will be used, but the user can override this with a file named
-# Test-Order placed in the work directory.  (This feature comes useful
-# when you want to pare down the list.)
-
-if [ ! -f ./Test-Order ]
-then cp ${srcdir}/Test-Order ./Test-Order
-fi
+# By default the tests are executed in the order described in the
+# file Test-Order.  Copy this file from the source directory
+# to the work directory.
+# 
+# The --no-clobber version comes useful when the user wants a modified
+# (pared-down) version of Test-Order.
+
+cp ${srcdir}/Test-Order ./Test-Order
+#cp --no-clobber ${srcdir}/Test-Order ./Test-Order
 
 for t in `grep -v "^#" ./Test-Order | fgrep ".test"`
 do
 echo == $t ==
 ${srcdir}/$t >  ${t%.test}.out ; let result=$?
 case $result in
-0)   cmp --quiet ${t%.test}.out ${srcdir}/${t%.test}.ok ;
+0)   cmp -s ${t%.test}.out ${srcdir}/${t%.test}.ok ;
      if [ $? -eq 0 ]
         then let result=0;  rm  ${t%.test}.out ;
         else let result=1;
      fi
      let supported=1 ;;
-*) let result=1 ; let supported=1;;
+80) let result=4 ; let supported=0;;
+*)  let result=1 ; let supported=1;;
 esac
 
-
 # Report whether a single test succeeded or failed.
 # Increment counters.
 
@@ -168,7 +177,7 @@ for s in 0 1 2 3 4 5
 
 echo ==================
 echo "All tests done."
-date --rfc-3339=seconds
+date -R -u
 
 
 # Exit with status 0 if all supported tests succeeded, 1 otherwise.
diff --git a/test/Test-Order b/test/Test-Order
index a23bdd92..698552b9 100644
--- a/test/Test-Order
+++ b/test/Test-Order
@@ -16,7 +16,14 @@ pgmramp.test
 ppmgauss.test
 ppmcie.test
 ppmwheel.test
+
+# Generators with random components
+
+pgmnoise.test
 ppmpat.test
+pgmcrater.test
+ppmforge.test
+ppmrough.test
 
 # Analyzer tests
 
@@ -46,6 +53,7 @@ pnmcat.test
 pamflip.test
 pamenlarge.test
 pnminvert.test
+pamchannel.test
 
 pbmpscale.test
 pnmremap1.test
@@ -93,6 +101,7 @@ fits-roundtrip.test
 g3-roundtrip.test
 gem-roundtrip.test
 gif-roundtrip.test
+gif-quant-roundtrip.test
 hdiff-roundtrip.test
 leaf-roundtrip.test
 mgr-roundtrip.test
@@ -105,6 +114,7 @@ targa-roundtrip.test
 tiff-roundtrip.test
 utahrle-roundtrip.test
 wbmp-roundtrip.test
+winicon-roundtrip.test
 xbm-roundtrip.test
 xpm-roundtrip.test
 xwd-roundtrip.test
diff --git a/test/all-in-place.ok b/test/all-in-place.ok
index 75e1e01a..1510f2e7 100644
--- a/test/all-in-place.ok
+++ b/test/all-in-place.ok
@@ -102,6 +102,7 @@ pamtosvg: ok
 pamtotga: ok
 pamtotiff: ok
 pamtouil: ok
+pamtowinicon: ok
 pamtoxvmini: ok
 pamundice: ok
 pamwipeout: ok
@@ -329,6 +330,7 @@ ximtoppm: ok
 xpmtoppm: ok
 xvminitoppm: ok
 xwdtopnm: ok
+winicontopam: ok
 ybmtopbm: ok
 yuvsplittoppm: ok
 yuvtoppm: ok
@@ -348,3 +350,5 @@ ppmquant: ok
 ppmquantall: ok
 ppmrainbow: ok
 ppmfade: ok
+pamstretch-gen: ok
+pcdovtoppm: ok
diff --git a/test/all-in-place.test b/test/all-in-place.test
index ae67e809..87ddfad8 100755
--- a/test/all-in-place.test
+++ b/test/all-in-place.test
@@ -16,11 +16,15 @@ function testExitStatus () {
 
     case $3 in
       $2)  echo $1": ok" ;;
-      126) if [ ! -z ${PBM_TESTPREFIX} ] && [ ! -x ${PBM_TESTPREFIX}/$1 ]
+      126) if [ ! -z "${PBM_TESTPREFIX}" ] && \
+              [   -d "${PBM_TESTPREFIX}" ] && \
+              [ ! -x "${PBM_TESTPREFIX}/$1" ]
              then echo $1": NOT EXECUTABLE";
              else echo $1": ERROR: "$3;    echo $1": error: "$3 1>&2 ;
            fi ;;
-      127) if [ ! -z ${PBM_TESTPREFIX} ] && [ ! -f ${PBM_TESTPREFIX}/$1 ]
+      127) if [ ! -z "${PBM_TESTPREFIX}" ] && \
+              [   -d "${PBM_TESTPREFIX}" ] && \
+              [ ! -f "${PBM_TESTPREFIX}/$1" ]
              then echo $1": NO SUCH FILE";
              else echo $1": ERROR: "$3;    echo $1": error: "$3 1>&2 ;
            fi ;;
@@ -29,70 +33,350 @@ function testExitStatus () {
 }
 
 
-# Test programs which support the --version flag.
+# Test programs which have the --version flag.
 # See showVersion() in lib/libpm.c for the standard version announcement.
 
-for i in \
-  411toppm asciitopgm atktopbm avstopam bioradtopgm \
-  bmptopnm bmptoppm brushtopbm cameratopam cistopbm \
-  cmuwmtopbm ddbugtopbm escp2topbm eyuvtoppm fitstopnm \
-  fstopgm g3topbm gemtopbm gemtopnm giftopnm gouldtoppm \
-  hdifftopam hipstopgm icontopbm ilbmtoppm imgtoppm infotopam \
-  jbigtopnm jpeg2ktopam jpegtopnm leaftoppm lispmtopgm \
-  macptopbm mdatopbm mgrtopbm mrftopbm mtvtoppm neotoppm \
-  palmtopnm pamaddnoise pamarith pambackground pambayer \
-  pamchannel pamcomp pamcut pamdeinterlace pamdepth \
-  pamdice pamditherbw pamedge pamendian pamenlarge \
-  pamexec pamfile pamfixtrunc pamflip pamfunc pamgauss \
-  pamgradient pamlookup pammasksharpen pammixinterlace \
-  pammosaicknit pamoil pampaintspill pamperspective pampick \
-  pampop9 pamrecolor pamrgbatopng pamrubber pamscale pamseq \
-  pamsharpmap pamsharpness pamsistoaglyph pamslice pamsplit \
-  pamstack pamstereogram pamstretch pamsumm pamsummcol \
-  pamthreshold pamtilt pamtoavs pamtodjvurle pamtofits \
-  pamtogif pamtohdiff pamtohtmltbl pamtojpeg2k pamtompfont \
-  pamtooctaveimg pamtopam pamtopdbimg pamtopfm pamtopnm \
-  pamtosrf pamtosvg pamtotga pamtotiff pamtouil pamtoxvmini \
-  pamundice pamwipeout pamx pbmclean pbmlife pbmmake pbmmask \
-  pbmminkowski pbmpage pbmpscale pbmreduce pbmtext pbmtextps \
-  pbmto10x pbmto4425 pbmtoascii pbmtoatk pbmtobbnbg pbmtocis \
-  pbmtocmuwm pbmtodjvurle pbmtoepsi pbmtoepson pbmtoescp2 \
-  pbmtog3 pbmtogem pbmtogo pbmtoibm23xx pbmtoicon pbmtolj \
-  pbmtoln03 pbmtolps pbmtomacp pbmtomatrixorbital pbmtomda \
-  pbmtomgr pbmtomrf pbmtonokia pbmtopgm pbmtopi3 pbmtopk \
-  pbmtoplot pbmtoppa pbmtopsg3 pbmtoptx pbmtosunicon \
-  pbmtowbmp pbmtoxbm pbmtoybm pbmtozinc pbmupc pc1toppm \
-  pcxtoppm pdbimgtopam pfmtopam pgmabel pgmbentley pgmcrater \
-  pgmdeshadow pgmedge pgmenhance pgmhist pgmkernel pgmmake \
-  pgmmedian pgmminkowski pgmmorphconv pgmnoise pgmnorm \
-  pgmoil pgmramp pgmslice pgmtexture pgmtofs pgmtolispm \
-  pgmtopbm pgmtopgm pgmtoppm pi1toppm pi3topbm picttoppm \
-  pjtoppm pktopbm pngtopam pngtopnm pnmalias pnmarith pnmcat \
-  pnmcolormap pnmcomp pnmconvol pnmcrop pnmcut pnmdepth \
-  pnmenlarge pnmfile pnmflip pnmgamma pnmhisteq pnmhistmap \
-  pnmindex pnminterp pnminvert pnmmercator pnmmontage \
-  pnmnlfilt pnmnorm pnmpad pnmpaste pnmpsnr pnmremap \
-  pnmrotate pnmscale pnmscalefixed pnmshear pnmsmooth \
-  pnmsplit pnmstitch pnmtile pnmtoddif pnmtofiasco pnmtofits \
-  pnmtojbig pnmtojpeg pnmtopalm pnmtopclxl pnmtopng pnmtopnm \
-  pnmtops pnmtorast pnmtorle pnmtosgi pnmtosir pnmtotiff \
-  pnmtotiffcmyk pnmtoxwd ppm3d ppmbrighten ppmchange \
-  ppmcie ppmcolormask ppmcolors ppmdcfont ppmddumpfont \
-  ppmdim ppmdist ppmdither ppmdmkfont ppmdraw ppmflash \
-  ppmforge ppmglobe ppmhist ppmlabel ppmmake ppmmix ppmnorm \
-  ppmntsc ppmpat ppmrelief ppmrough ppmshift \
-  ppmspread ppmtoacad ppmtoapplevol ppmtoarbtxt ppmtoascii \
-  ppmtobmp ppmtoeyuv ppmtogif ppmtoicr ppmtoilbm ppmtojpeg \
-  ppmtoleaf ppmtolj ppmtomitsu ppmtompeg ppmtoneo ppmtopcx \
-  ppmtopgm ppmtopi1 ppmtopict ppmtopj ppmtopjxl ppmtoppm \
-  ppmtopuzz ppmtorgb3 ppmtosixel ppmtospu ppmtoterm ppmtouil \
-  ppmtowinicon ppmtoxpm ppmtoyuv ppmtoyuvsplit ppmtv ppmwheel \
-  psidtopgm pstopnm qrttoppm rasttopnm rawtopgm rawtoppm \
-  rgb3toppm rlatopam rletopnm sbigtopgm sgitopnm sirtopnm \
-  sldtoppm spctoppm spottopgm sputoppm srftopam sunicontopnm \
-  svgtopam tgatoppm thinkjettopbm tifftopnm wbmptopbm \
-  winicontoppm xbmtopbm ximtoppm xpmtoppm xvminitoppm \
-  xwdtopnm ybmtopbm yuvsplittoppm yuvtoppm zeisstopnm
+ordinary_testprogs="\
+  411toppm \
+  asciitopgm \
+  atktopbm \
+  avstopam \
+  bioradtopgm \
+  bmptopnm \
+  bmptoppm \
+  brushtopbm \
+  cameratopam \
+  cistopbm \
+  cmuwmtopbm \
+  ddbugtopbm \
+  escp2topbm \
+  eyuvtoppm \
+  fitstopnm \
+  fstopgm \
+  g3topbm \
+  gemtopbm \
+  gemtopnm \
+  giftopnm \
+  gouldtoppm \
+  hdifftopam \
+  hipstopgm \
+  icontopbm \
+  ilbmtoppm \
+  imgtoppm \
+  infotopam \
+  jbigtopnm \
+  jpeg2ktopam \
+  jpegtopnm \
+  leaftoppm \
+  lispmtopgm \
+  macptopbm \
+  mdatopbm \
+  mgrtopbm \
+  mrftopbm \
+  mtvtoppm \
+  neotoppm \
+  palmtopnm \
+  pamaddnoise \
+  pamarith \
+  pambackground \
+  pambayer \
+  pamchannel \
+  pamcomp \
+  pamcut \
+  pamdeinterlace \
+  pamdepth \
+  pamdice \
+  pamditherbw \
+  pamedge \
+  pamendian \
+  pamenlarge \
+  pamexec \
+  pamfile \
+  pamfixtrunc \
+  pamflip \
+  pamfunc \
+  pamgauss \
+  pamgradient \
+  pamlookup \
+  pammasksharpen \
+  pammixinterlace \
+  pammosaicknit \
+  pamoil \
+  pampaintspill \
+  pamperspective \
+  pampick \
+  pampop9 \
+  pamrecolor \
+  pamrgbatopng \
+  pamrubber \
+  pamscale \
+  pamseq \
+  pamsharpmap \
+  pamsharpness \
+  pamsistoaglyph \
+  pamslice \
+  pamsplit \
+  pamstack \
+  pamstereogram \
+  pamstretch \
+  pamsumm \
+  pamsummcol \
+  pamthreshold \
+  pamtilt \
+  pamtoavs \
+  pamtodjvurle \
+  pamtofits \
+  pamtogif \
+  pamtohdiff \
+  pamtohtmltbl \
+  pamtojpeg2k \
+  pamtompfont \
+  pamtooctaveimg \
+  pamtopam \
+  pamtopdbimg \
+  pamtopfm \
+  pamtopnm \
+  pamtosrf \
+  pamtosvg \
+  pamtotga \
+  pamtotiff \
+  pamtouil \
+  pamtowinicon \
+  pamtoxvmini \
+  pamundice \
+  pamwipeout \
+  pamx \
+  pbmclean \
+  pbmlife \
+  pbmmake \
+  pbmmask \
+  pbmminkowski \
+  pbmpage \
+  pbmpscale \
+  pbmreduce \
+  pbmtext \
+  pbmtextps \
+  pbmto10x \
+  pbmto4425 \
+  pbmtoascii \
+  pbmtoatk \
+  pbmtobbnbg \
+  pbmtocis \
+  pbmtocmuwm \
+  pbmtodjvurle \
+  pbmtoepsi \
+  pbmtoepson \
+  pbmtoescp2 \
+  pbmtog3 \
+  pbmtogem \
+  pbmtogo \
+  pbmtoibm23xx \
+  pbmtoicon \
+  pbmtolj \
+  pbmtoln03 \
+  pbmtolps \
+  pbmtomacp \
+  pbmtomatrixorbital \
+  pbmtomda \
+  pbmtomgr \
+  pbmtomrf \
+  pbmtonokia \
+  pbmtopgm \
+  pbmtopi3 \
+  pbmtopk \
+  pbmtoplot \
+  pbmtoppa \
+  pbmtopsg3 \
+  pbmtoptx \
+  pbmtosunicon \
+  pbmtowbmp \
+  pbmtoxbm \
+  pbmtoybm \
+  pbmtozinc \
+  pbmupc \
+  pc1toppm \
+  pcxtoppm \
+  pdbimgtopam \
+  pfmtopam \
+  pgmabel \
+  pgmbentley \
+  pgmcrater \
+  pgmdeshadow \
+  pgmedge \
+  pgmenhance \
+  pgmhist \
+  pgmkernel \
+  pgmmake \
+  pgmmedian \
+  pgmminkowski \
+  pgmmorphconv \
+  pgmnoise \
+  pgmnorm \
+  pgmoil \
+  pgmramp \
+  pgmslice \
+  pgmtexture \
+  pgmtofs \
+  pgmtolispm \
+  pgmtopbm \
+  pgmtopgm \
+  pgmtoppm \
+  pi1toppm \
+  pi3topbm \
+  picttoppm \
+  pjtoppm \
+  pktopbm \
+  pngtopam \
+  pngtopnm \
+  pnmalias \
+  pnmarith \
+  pnmcat \
+  pnmcolormap \
+  pnmcomp \
+  pnmconvol \
+  pnmcrop \
+  pnmcut \
+  pnmdepth \
+  pnmenlarge \
+  pnmfile \
+  pnmflip \
+  pnmgamma \
+  pnmhisteq \
+  pnmhistmap \
+  pnmindex \
+  pnminterp \
+  pnminvert \
+  pnmmercator \
+  pnmmontage \
+  pnmnlfilt \
+  pnmnorm \
+  pnmpad \
+  pnmpaste \
+  pnmpsnr \
+  pnmremap \
+  pnmrotate \
+  pnmscale \
+  pnmscalefixed \
+  pnmshear \
+  pnmsmooth \
+  pnmsplit \
+  pnmstitch \
+  pnmtile \
+  pnmtoddif \
+  pnmtofiasco \
+  pnmtofits \
+  pnmtojbig \
+  pnmtojpeg \
+  pnmtopalm \
+  pnmtopclxl \
+  pnmtopng \
+  pnmtopnm \
+  pnmtops \
+  pnmtorast \
+  pnmtorle \
+  pnmtosgi \
+  pnmtosir \
+  pnmtotiff \
+  pnmtotiffcmyk \
+  pnmtoxwd \
+  ppm3d \
+  ppmbrighten \
+  ppmchange \
+  ppmcie \
+  ppmcolormask \
+  ppmcolors \
+  ppmdcfont \
+  ppmddumpfont \
+  ppmdim \
+  ppmdist \
+  ppmdither \
+  ppmdmkfont \
+  ppmdraw \
+  ppmflash \
+  ppmforge \
+  ppmglobe \
+  ppmhist \
+  ppmlabel \
+  ppmmake \
+  ppmmix \
+  ppmnorm \
+  ppmntsc \
+  ppmpat \
+  ppmrelief \
+  ppmrough \
+  ppmshift \
+  ppmspread \
+  ppmtoacad \
+  ppmtoapplevol \
+  ppmtoarbtxt \
+  ppmtoascii \
+  ppmtobmp \
+  ppmtoeyuv \
+  ppmtogif \
+  ppmtoicr \
+  ppmtoilbm \
+  ppmtojpeg \
+  ppmtoleaf \
+  ppmtolj \
+  ppmtomitsu \
+  ppmtompeg \
+  ppmtoneo \
+  ppmtopcx \
+  ppmtopgm \
+  ppmtopi1 \
+  ppmtopict \
+  ppmtopj \
+  ppmtopjxl \
+  ppmtoppm \
+  ppmtopuzz \
+  ppmtorgb3 \
+  ppmtosixel \
+  ppmtospu \
+  ppmtoterm \
+  ppmtouil \
+  ppmtowinicon \
+  ppmtoxpm \
+  ppmtoyuv \
+  ppmtoyuvsplit \
+  ppmtv \
+  ppmwheel \
+  psidtopgm \
+  pstopnm \
+  qrttoppm \
+  rasttopnm \
+  rawtopgm \
+  rawtoppm \
+  rgb3toppm \
+  rlatopam \
+  rletopnm \
+  sbigtopgm \
+  sgitopnm \
+  sirtopnm \
+  sldtoppm \
+  spctoppm \
+  spottopgm \
+  sputoppm \
+  srftopam \
+  sunicontopnm \
+  svgtopam \
+  tgatoppm \
+  thinkjettopbm \
+  tifftopnm \
+  wbmptopbm \
+  winicontopam \
+  winicontoppm \
+  xbmtopbm \
+  ximtoppm \
+  xpmtoppm \
+  xvminitoppm \
+  xwdtopnm \
+  ybmtopbm \
+  yuvsplittoppm \
+  yuvtoppm \
+  zeisstopnm \
+"
+
+for i in $ordinary_testprogs
   do
     ${PBM_TESTPREFIX}$i --version  2>&1 | \
     egrep -v \
@@ -110,7 +394,7 @@ ${PBM_TESTPREFIX}fiascotopnm -v 2> /dev/null
 
 
 
-# Test manweb and pnmmargin, which support --help.
+# Test manweb and pnmmargin, which have --help.
 
 ${PBM_TESTPREFIX}manweb --help > /dev/null
     testExitStatus manweb 0 $?
@@ -159,6 +443,18 @@ ${PBM_TESTPREFIX}ppmfade -f /dev/zero -base /dev/null > /dev/null 2> /dev/null
 
 
 
+# Test pamstretch-gen and pcdovtoppm with no input.
+# These two programs write a usage message on standout in this case.
+# Exit status should be 1.
+
+for i in pamstretch-gen pcdovtoppm
+  do
+  ${PBM_TESTPREFIX}$i > /dev/zero
+     testExitStatus $i 1 $?
+  done
+
+
+
 # We do not test hpcdtoppm.
 # This is a stand-in which announces the absence of the real hpcdtoppm.
 # TODO: Provide for the case in which the real hpcdtoppm is encountered.
diff --git a/test/g3-roundtrip.test b/test/g3-roundtrip.test
index c5c21fa0..e00997f6 100755
--- a/test/g3-roundtrip.test
+++ b/test/g3-roundtrip.test
@@ -3,11 +3,13 @@
 # Also requires: pnmcrop
 
 ${PBM_TESTPREFIX}pbmtog3 -nofixedwidth testgrid.pbm | \
-${PBM_TESTPREFIX}g3topbm -width=14 | diff - testgrid.pbm ; echo $?
+${PBM_TESTPREFIX}g3topbm -width=14 | cmp -s - testgrid.pbm
+echo $?
 
 ${PBM_TESTPREFIX}pbmtog3 -nofixedwidth -reversebits testgrid.pbm | \
-${PBM_TESTPREFIX}g3topbm -width=14 -reversebits | diff - testgrid.pbm ; echo $?
+${PBM_TESTPREFIX}g3topbm -width=14 -reversebits | cmp -s - testgrid.pbm
+echo $?
 
 ${PBM_TESTPREFIX}pbmtog3 testgrid.pbm | \
 ${PBM_TESTPREFIX}g3topbm  | ${PBM_BINPREFIX}pnmcrop -white -right -bottom | \
- diff - testgrid.pbm ; echo $?
+ cmp -s - testgrid.pbm ; echo $?
diff --git a/test/gem-roundtrip.test b/test/gem-roundtrip.test
index 9548637a..05f1d28c 100755
--- a/test/gem-roundtrip.test
+++ b/test/gem-roundtrip.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: pbmtogem gemtopbm
-# Also requires: 
+# Also requires: gemtopnm
 
 # Should print 2425386270 41, cksum of testgrid.pbm
 ${PBM_TESTPREFIX}pbmtogem testgrid.pbm | ${PBM_TESTPREFIX}gemtopbm | cksum
diff --git a/test/gif-quant-roundtrip.ok b/test/gif-quant-roundtrip.ok
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/gif-quant-roundtrip.ok
@@ -0,0 +1 @@
+0
diff --git a/test/gif-quant-roundtrip.test b/test/gif-quant-roundtrip.test
new file mode 100644
index 00000000..5e093b29
--- /dev/null
+++ b/test/gif-quant-roundtrip.test
@@ -0,0 +1,15 @@
+#! /bin/bash
+# This script tests: giftopnm pamtogif pnmquant
+# Also requires: pnmcolormap pnmremap
+
+# Should print 0
+
+colors=15      # any value between 2 - 256 works
+
+${PBM_TESTPREFIX}pnmquant $colors testimg.ppm > ${tmpdir}/quant.ppm &&
+${PBM_TESTPREFIX}pamtogif ${tmpdir}/quant.ppm | ${PBM_TESTPREFIX}giftopnm | \
+   cmp -s - ${tmpdir}/quant.ppm > /dev/null
+echo $?
+
+rm ${tmpdir}/quant.ppm
+
diff --git a/test/gif-roundtrip.ok b/test/gif-roundtrip.ok
index 011ebd3a..cf95bb37 100644
--- a/test/gif-roundtrip.ok
+++ b/test/gif-roundtrip.ok
@@ -1,3 +1,4 @@
 2871603838 33838
 1926073387 101484
 2425386270 41
+P1 4 1 0101 
\ No newline at end of file
diff --git a/test/gif-roundtrip.test b/test/gif-roundtrip.test
index 73246705..a32d574a 100755
--- a/test/gif-roundtrip.test
+++ b/test/gif-roundtrip.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: giftopnm pamtogif
-# Also requires: ppmtopgm ppmtorgb3 rgb3toppm
+# Also requires: ppmtopgm ppmtorgb3 rgb3toppm pbmmake
 
 # Test 1. Should produce 2871603838 33838
 # which is the result of ppmtopgm testimg.ppm | cksum
@@ -28,3 +28,12 @@ rm ${tmpdir}/testimg.{ppm,red,grn,blu} ${tmpdir}/out.{red,grn}
 
 # Test 3. Should produce 2425386270 41
 ${PBM_TESTPREFIX}pamtogif testgrid.pbm | ${PBM_TESTPREFIX}giftopnm | cksum
+
+# Test 4.
+# In this gif file the code length changes after the last image data.
+# Image data: 3 bits, end code 4 bits.
+# Should produce P1 4 1 0 1 0 1
+
+${PBM_BINPREFIX}pbmmake -g 4 1 | \
+  ${PBM_TESTPREFIX}pamtogif | ${PBM_TESTPREFIX}giftopnm -plain | \
+  tr '\n' ' '
diff --git a/test/pad-crop-roundtrip.test b/test/pad-crop-roundtrip.test
index 532b6cbd..2b3c777b 100755
--- a/test/pad-crop-roundtrip.test
+++ b/test/pad-crop-roundtrip.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: pnmcrop pnmmargin
-# Also requires: 
+# Also requires: pnmpad
 
 ${PBM_TESTPREFIX}pnmmargin -white 10 testimg.ppm | \
   ${PBM_TESTPREFIX}pnmcrop | cksum
diff --git a/test/pamchannel.ok b/test/pamchannel.ok
new file mode 100644
index 00000000..79317f03
--- /dev/null
+++ b/test/pamchannel.ok
@@ -0,0 +1,3 @@
+1571496937 33838
+394856971 33838
+3164158573 33838
diff --git a/test/pamchannel.test b/test/pamchannel.test
new file mode 100644
index 00000000..f83dd3b6
--- /dev/null
+++ b/test/pamchannel.test
@@ -0,0 +1,32 @@
+#! /bin/bash
+# This script tests: pamchannel
+# Also requires: pamtopnm
+
+
+# Extract planes one by one.
+# Convert output to pgm to make it identical to ppmtorgb3 output.
+
+# $ ppmtorgb3 testimg.ppm ; cksum testimg.{red,grn,blu}
+#
+# 1571496937 33838 testimg.red
+# 394856971 33838 testimg.grn
+# 3164158573 33838 testimg.blu
+
+
+# Test 1. red channel
+# Should produce 1571496937 33838
+
+${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 0 | \
+  ${PBM_BINPREFIX}pamtopnm --assume | cksum
+
+# Test 2. green channel
+# Should produce  394856971 33838
+
+${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 1 | \
+  ${PBM_BINPREFIX}pamtopnm --assume | cksum
+
+# Test 3. blue channel
+# Should produce 3164158573 33838
+
+${PBM_TESTPREFIX}pamchannel -infile testimg.ppm 2 | \
+  ${PBM_BINPREFIX}pamtopnm --assume | cksum
diff --git a/test/pamslice-roundtrip.test b/test/pamslice-roundtrip.test
index fd125500..d7ca657d 100755
--- a/test/pamslice-roundtrip.test
+++ b/test/pamslice-roundtrip.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: pamslice
-# Also requires: pnmtopnm
+# Also requires: pnmtopnm pamtopnm
 
 # Slice rows, one by one, out of testgrid.pbm.
 # Add header and reconstruct pbm image.
diff --git a/test/pbmclean.test b/test/pbmclean.test
index 05fe9338..69081ff9 100755
--- a/test/pbmclean.test
+++ b/test/pbmclean.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: pbmclean
-# Also requires: pbmmake pbmpage pnmmargin
+# Also requires: pbmmake pbmpage pnmmargin pnmpad
 
 ${PBM_BINPREFIX}pbmmake -g 3 3 | ${PBM_BINPREFIX}pnmmargin -black 2 \
  >${tmpdir}/test.pbm
diff --git a/test/pbmminkowski.test b/test/pbmminkowski.test
index d0376e9e..ccb882b1 100755
--- a/test/pbmminkowski.test
+++ b/test/pbmminkowski.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: pbmminkowski
-# Also requires: pbmmake pnmmargin
+# Also requires: pbmmake pnmmargin pnmpad
 
 ${PBM_BINPREFIX}pbmmake -w 1 1 | ${PBM_BINPREFIX}pnmmargin -b 1 | \
   ${PBM_TESTPREFIX}pbmminkowski
diff --git a/test/pgmcrater.ok b/test/pgmcrater.ok
new file mode 100644
index 00000000..aa2592c9
--- /dev/null
+++ b/test/pgmcrater.ok
@@ -0,0 +1 @@
+3828822912 65551
diff --git a/test/pgmcrater.test b/test/pgmcrater.test
new file mode 100644
index 00000000..e8df9a23
--- /dev/null
+++ b/test/pgmcrater.test
@@ -0,0 +1,29 @@
+#! /bin/bash
+# This script tests: pgmcrater
+# Also requires: pgmnoise
+
+# This test is sensitive to differences in floating point math.
+# With GCC slight results start to appear with -number 75 in
+# the following test.  Compiler type (GCC, Clang, etc.),
+# SSE math (by default off with x86 32 bit on with x86 64 bit)
+# and --ffast-math are factors.
+
+# We hope that by keeping the number of craters small the
+# difference will not show up.
+#
+# The slight differences in the image file are not discernable by
+# the naked eye.
+
+${PBM_BINPREFIX}pgmnoise --testrandom --quiet
+case $? in
+   81)
+      # Should print: 3828822912 65551
+      ${PBM_TESTPREFIX}pgmcrater -quiet -number 25 -randomseed 1 | cksum
+      ;;
+
+   8[02-9] | 90)
+       echo "Skipping: random number generator is not glibc." 1>&2
+       exit 80;;
+
+   *)  exit 1;;  # pgmnoise --testrandom failed
+esac
diff --git a/test/pgmnoise.ok b/test/pgmnoise.ok
new file mode 100644
index 00000000..138218c2
--- /dev/null
+++ b/test/pgmnoise.ok
@@ -0,0 +1 @@
+2005134911 10015
diff --git a/test/pgmnoise.test b/test/pgmnoise.test
new file mode 100644
index 00000000..8ee2fccc
--- /dev/null
+++ b/test/pgmnoise.test
@@ -0,0 +1,22 @@
+#! /bin/bash
+# This script tests: pgmnoise
+# Also requires: 
+
+# We first check whether random number generator is glibc rand().
+# If not, this test is skipped.
+
+${PBM_TESTPREFIX}pgmnoise --testrandom
+
+case $? in
+   81)
+        # Should print: 1663614689 10015
+        ${PBM_TESTPREFIX}pgmnoise --randomseed=0 100 100 | cksum ;;
+
+        # Any additional tests go here.
+
+   8[02-9] | 90)
+        echo "Skipping: random number generator is not glibc." 1>&2
+        exit 80;;
+
+   *)   exit 1;;  # pgmnoise --testrandom failed
+esac
diff --git a/test/pnm-plain-roundtrip.test b/test/pnm-plain-roundtrip.test
index eab0b0d7..86dbb2fb 100755
--- a/test/pnm-plain-roundtrip.test
+++ b/test/pnm-plain-roundtrip.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: pnmtopnm
-# Also requires: 
+# Also requires: pamtopnm
 
 ${PBM_TESTPREFIX}pnmtopnm -plain testimg.ppm | \
   ${PBM_TESTPREFIX}pnmtopnm | cksum
diff --git a/test/pnmremap1.ok b/test/pnmremap1.ok
index a6cfc2bd..07954684 100644
--- a/test/pnmremap1.ok
+++ b/test/pnmremap1.ok
@@ -1 +1 @@
-2667816854 101482
+3602410851 101482
diff --git a/test/pnmtile.test b/test/pnmtile.test
index b0c14ca6..0f9d91df 100755
--- a/test/pnmtile.test
+++ b/test/pnmtile.test
@@ -7,6 +7,7 @@ ${PBM_TESTPREFIX}pnmtile 40 50 testgrid.pbm | cksum
 ${PBM_TESTPREFIX}pnmtile 454 298 testimg.ppm > ${tmpdir}/testimg4.ppm &&
 ${PBM_BINPREFIX}pnmcat -lr testimg.ppm testimg.ppm > ${tmpdir}/testimg2.ppm &&
 ${PBM_BINPREFIX}pnmcat -tb ${tmpdir}/testimg2.ppm ${tmpdir}/testimg2.ppm | \
-diff - ${tmpdir}/testimg4.ppm && echo $?
+cmp -s - ${tmpdir}/testimg4.ppm
+echo $?
 
 rm ${tmpdir}/testimg{2,4}.ppm
diff --git a/test/pnmtopnm-plain.test b/test/pnmtopnm-plain.test
index 3cbd5752..ff211e40 100755
--- a/test/pnmtopnm-plain.test
+++ b/test/pnmtopnm-plain.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: pnmtopnm
-# Also requires: pgmtopgm ppmtoppm
+# Also requires: pgmtopgm ppmtoppm pamtopnm
 
 ${PBM_TESTPREFIX}pnmtopnm -plain testgrid.pbm
 
diff --git a/test/ppmcie.out-64 b/test/ppmcie.out-64
deleted file mode 100644
index 3d8ca13a..00000000
--- a/test/ppmcie.out-64
+++ /dev/null
@@ -1 +0,0 @@
-2583941766 786447
diff --git a/test/ppmdfont.test b/test/ppmdfont.test
index e973297b..027b8f2c 100755
--- a/test/ppmdfont.test
+++ b/test/ppmdfont.test
@@ -7,3 +7,13 @@ ${PBM_TESTPREFIX}ppmdmkfont | ${PBM_TESTPREFIX}ppmddumpfont 2>&1 | cksum
 
 # Test 2. Should produce: 2845495212 75033
 ${PBM_TESTPREFIX}ppmdmkfont | ${PBM_TESTPREFIX}ppmdcfont | cksum
+
+# There is a strange glitch in output when ppmdcfont is compiled by clang:
+# 3171,3173c3171,3173
+# <     0x01,
+# <     95,
+# <     32
+# ---
+# >     0x00,
+# >     0,
+# >     0
diff --git a/test/ppmdim.test b/test/ppmdim.test
index b8158d63..e2a1b0df 100755
--- a/test/ppmdim.test
+++ b/test/ppmdim.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: ppmdim
-# Also requires: pamfunc pnmarith pamsumm
+# Also requires: pamfunc pnmarith pamarith pamsumm
 
 # Compare ppmdim and pamfunc with various dim factors
 # Due to the difference in rounding methods, pamfunc produces slightly
diff --git a/test/ppmforge.ok b/test/ppmforge.ok
new file mode 100644
index 00000000..e4a4c9e2
--- /dev/null
+++ b/test/ppmforge.ok
@@ -0,0 +1 @@
+3634219838 196623
diff --git a/test/ppmforge.test b/test/ppmforge.test
new file mode 100644
index 00000000..014dc543
--- /dev/null
+++ b/test/ppmforge.test
@@ -0,0 +1,20 @@
+#! /bin/bash
+# This script tests: ppmforge
+# Also requires: pgmnoise
+
+# Use small x y values to avoid floating point issues.
+
+
+${PBM_BINPREFIX}pgmnoise --testrandom --quiet
+case $? in
+   81)
+      # Test 1: Should print: 3634219838 196623
+      ${PBM_TESTPREFIX}ppmforge -night -seed 1 | cksum
+      ;;
+
+   8[02-9] | 90)
+       echo "Skipping: random number generator is not glibc." 1>&2
+       exit 80;;
+
+   *)  exit 1;;  # pgmnoise --testrandom failed
+esac
diff --git a/test/ppmhist.test b/test/ppmhist.test
index b849e72d..55cbeac9 100755
--- a/test/ppmhist.test
+++ b/test/ppmhist.test
@@ -1,6 +1,6 @@
 #! /bin/bash
 # This script tests: ppmhist
-# Also requires: pgmhist pgmramp
+# Also requires: pgmramp
 
 ${PBM_BINPREFIX}pgmramp -maxval=8 -lr 8 2 | ${PBM_TESTPREFIX}ppmhist
 ${PBM_TESTPREFIX}ppmhist -map -sort=rgb testimg.ppm | cksum
diff --git a/test/ppmmake.test b/test/ppmmake.test
index 02e747ab..da23095c 100755
--- a/test/ppmmake.test
+++ b/test/ppmmake.test
@@ -2,8 +2,6 @@
 # This script tests: ppmmake
 # Also requires: 
 
-#export RGBDEF=/usr/share/emacs/23.2/etc/rgb.txt
-
 ${PBM_TESTPREFIX}ppmmake rgb:ff/80/80 50 100 -maxval=5 | cksum
 ${PBM_TESTPREFIX}ppmmake red 50 50  | cksum
 
diff --git a/test/ppmmix.test b/test/ppmmix.test
index 0f9deedc..451aa8be 100755
--- a/test/ppmmix.test
+++ b/test/ppmmix.test
@@ -25,5 +25,4 @@ ${PBM_BINPREFIX}pnminvert testimg.ppm | ${PBM_TESTPREFIX}ppmmix .5 \
     testimg.ppm - | tee ${tmpdir}/a3.ppm | \
   ${PBM_BINPREFIX}pamsumm -brief -max &&
   ${PBM_BINPREFIX}pamsumm -brief -min ${tmpdir}/a3.ppm &&
-
 rm ${tmpdir}/a3.ppm
diff --git a/test/ppmpat.test b/test/ppmpat.test
index 0fe9f25a..669cf17c 100755
--- a/test/ppmpat.test
+++ b/test/ppmpat.test
@@ -1,28 +1,35 @@
 #! /bin/bash
 # This script tests: ppmpat
-# Also requires:
+# Also requires: pgmnoise
 
-# TODO 1: Write tests for squig and poles.  It appears that they are
+# TODO: Write tests for squig and poles.  It appears that they are
 # sensitive to differences in floating point math.
 
-# TODO 2: Skip this test if the pseudo-random number generator is
-# not glibc's rand().
+${PBM_BINPREFIX}pgmnoise --testrandom --quiet
+case $? in
+   81)
+       # Test 1. Should print: 4008533639 781
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 16 16 | cksum
 
+       # Test 2. Should print: 2448908863 9613
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 64 50 | cksum
 
-# Test 1. Should print: 4008533639 781
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 16 16 | cksum
+       # Test 3. Should print: 2698433077 1549
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -madras 32 16 | cksum
 
-# Test 2. Should print: 2448908863 9613
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -g2 64 50 | cksum
+       # Test 4. Should print: 3705929501 781
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -tartan 16 16 | cksum
 
-# Test 3. Should print: 2698433077 1549
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -madras 32 16 | cksum
+       # Test 5. Should print: 2219119109 36015
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -camo 100 120 | cksum
 
-# Test 4. Should print: 3705929501 781
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -tartan 16 16 | cksum
+       # Test 6. Should print: 3436846137 16813
+       ${PBM_TESTPREFIX}ppmpat --randomseed=0 -anticamo 80 70 | cksum
+       ;;
 
-# Test 5. Should print: 2219119109 36015
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -camo 100 120 | cksum
+   8[02-9] | 90)
+       echo "Skipping: random number generator is not glibc." 1>&2
+       exit 80;;
 
-# Test 6. Should print: 3436846137 16813
-${PBM_TESTPREFIX}ppmpat --randomseed=0 -anticamo 80 70 | cksum
+   *)  exit 1;;  # pgmnoise --testrandom failed
+esac
diff --git a/test/ppmrough.ok b/test/ppmrough.ok
new file mode 100644
index 00000000..83643849
--- /dev/null
+++ b/test/ppmrough.ok
@@ -0,0 +1 @@
+378403602 30015
diff --git a/test/ppmrough.test b/test/ppmrough.test
new file mode 100644
index 00000000..1de8dd1b
--- /dev/null
+++ b/test/ppmrough.test
@@ -0,0 +1,18 @@
+#! /bin/bash
+# This script tests: ppmrough
+# Also requires: pgmnoise
+
+
+${PBM_BINPREFIX}pgmnoise --testrandom --quiet
+case $? in
+   81)
+      # Should print: 378403602 30015
+      ${PBM_TESTPREFIX}ppmrough  -randomseed 1 | cksum
+      ;;
+
+   8[02-9] | 90)
+       echo "Skipping: random number generator is not glibc." 1>&2
+       exit 80;;
+
+   *)  exit 1;;  # pgmnoise --testrandom failed
+esac
diff --git a/test/ps-roundtrip.ok b/test/ps-roundtrip.ok
index 67f7a1fe..a267f7eb 100644
--- a/test/ps-roundtrip.ok
+++ b/test/ps-roundtrip.ok
@@ -1,2 +1,3 @@
 1926073387 101484
 2425386270 41
+1386192571 507420
diff --git a/test/ps-roundtrip.test b/test/ps-roundtrip.test
index 6d6935af..60ecf60a 100755
--- a/test/ps-roundtrip.test
+++ b/test/ps-roundtrip.test
@@ -1,21 +1,38 @@
 #! /bin/bash
 # This script tests: pnmtops pstopnm
-# Also requires: pnmtopnm
+# Also requires: pnmtopnm pamtopnm gs
 
+# Test 1.  Should print: 1926073387 101484
 ${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn testimg.ppm \
   > ${tmpdir}/testimg.ps
-xysize=`awk  '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \
+xysize1=`awk  '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \
   ${tmpdir}/testimg.ps` 
-${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 $xysize -stdout \
+${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 $xysize1 -stdout \
   -quiet ${tmpdir}/testimg.ps | \
   ${PBM_BINPREFIX}pnmtopnm | cksum
 
-${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn testgrid.pbm \
-  > ${tmpdir}/testgrid.ps
-xysize=`awk  '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \
+
+# Test 2.  Should print: 2425386270 41
+${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn \
+  testgrid.pbm  > ${tmpdir}/testgrid.ps &&
+xysize2=`awk  '/BoundingBox/ {print "-xsize="$4,"-ysize="$5}' \
   ${tmpdir}/testgrid.ps`
-${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 $xysize -stdout \
+${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 $xysize2 -stdout \
   -quiet ${tmpdir}/testgrid.ps -pbm | \
   ${PBM_BINPREFIX}pnmtopnm | cksum
 
-rm  ${tmpdir}/testgrid.ps  ${tmpdir}/testimg.ps
+
+#Test 3. Should print: 1386192571 507420
+cat testimg.ppm testimg.ppm testimg.ppm testgrid.pbm testgrid.pbm | \
+${PBM_TESTPREFIX}pnmtops -nocenter -equalpixels -dpi 72 -noturn -setpage \
+  > ${tmpdir}/testimg5.ps
+xysize3=`awk  '/BoundingBox/ {print "-xsize="$4,"-ysize="$5 ; exit}' \
+  ${tmpdir}/testimg5.ps`
+${PBM_TESTPREFIX}pstopnm -xborder=0 -yborder=0 $xysize3 \
+    -stdout  ${tmpdir}/testimg5.ps | \
+  ${PBM_BINPREFIX}pnmtopnm | cksum
+
+
+#rm  ${tmpdir}/testgrid.ps  ${tmpdir}/testimg.ps  ${tmpdir}/testimg5.ps
+rm   ${tmpdir}/testimg.ps  ${tmpdir}/testimg5.ps
+mv ${tmpdir}/testgrid.ps /tmp
diff --git a/test/rgb3-roundtrip.ok b/test/rgb3-roundtrip.ok
index 745a7c5f..64da849d 100644
--- a/test/rgb3-roundtrip.ok
+++ b/test/rgb3-roundtrip.ok
@@ -1,4 +1,5 @@
 1926073387 101484
+3744829044 101514
 2425386270 41
 0
 0
diff --git a/test/rgb3-roundtrip.test b/test/rgb3-roundtrip.test
index 9cc45499..d3575b95 100755
--- a/test/rgb3-roundtrip.test
+++ b/test/rgb3-roundtrip.test
@@ -11,6 +11,9 @@ ${PBM_TESTPREFIX}ppmtorgb3 ${tmpdir}/testimg.ppm &&
 ${PBM_TESTPREFIX}rgb3toppm ${tmpdir}/testimg.red ${tmpdir}/testimg.grn \
   ${tmpdir}/testimg.blu | cksum
 
+cat ${tmpdir}/testimg.red ${tmpdir}/testimg.grn ${tmpdir}/testimg.blu | \
+  cksum
+
 rm ${tmpdir}/testimg.{ppm,red,grn,blu}
 
 cp testgrid.pbm ${tmpdir} &&
@@ -23,9 +26,9 @@ ${PBM_TESTPREFIX}rgb3toppm ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn \
 # With PGM or PBM input, the three monochrome planes should be
 # identical.  Test for this.
 
-diff ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn ; echo $?
-diff ${tmpdir}/testgrid.grn ${tmpdir}/testgrid.blu ; echo $?
-${PBM_BINPREFIX}pgmtopgm < testgrid.pbm | diff - ${tmpdir}/testgrid.red;
+cmp -s ${tmpdir}/testgrid.red ${tmpdir}/testgrid.grn ; echo $?
+cmp -s ${tmpdir}/testgrid.grn ${tmpdir}/testgrid.blu ; echo $?
+${PBM_BINPREFIX}pgmtopgm < testgrid.pbm | cmp -s - ${tmpdir}/testgrid.red
   echo $?
 
 rm ${tmpdir}/testgrid.{pbm,red,grn,blu}
diff --git a/test/winicon-roundtrip.ok b/test/winicon-roundtrip.ok
new file mode 100644
index 00000000..8334ff4e
--- /dev/null
+++ b/test/winicon-roundtrip.ok
@@ -0,0 +1,2 @@
+71846281 6925
+326197919 137
diff --git a/test/winicon-roundtrip.test b/test/winicon-roundtrip.test
new file mode 100644
index 00000000..f5f2926e
--- /dev/null
+++ b/test/winicon-roundtrip.test
@@ -0,0 +1,13 @@
+#! /bin/bash
+# This script tests: pamtowinicon winicontopam
+# Also requires: pnmcut pnmtile pamtopnm ppmtopgm pgmtopbm
+
+${PBM_BINPREFIX}pnmcut --left=30 --width=48 --height=48 testimg.ppm | \
+${PBM_TESTPREFIX}pamtowinicon | ${PBM_TESTPREFIX}winicontopam | \
+  ${PBM_BINPREFIX}pamtopnm | cksum
+
+${PBM_BINPREFIX}pnmtile 32 32 testgrid.pbm | \
+${PBM_TESTPREFIX}pamtowinicon | ${PBM_TESTPREFIX}winicontopam | \
+  ${PBM_BINPREFIX}pamtopnm | ${PBM_BINPREFIX}ppmtopgm | \
+  ${PBM_BINPREFIX}pgmtopbm  -th -val=0.5 | cksum
+
diff --git a/test/yuv-roundtrip.test b/test/yuv-roundtrip.test
index c160c480..697d86aa 100755
--- a/test/yuv-roundtrip.test
+++ b/test/yuv-roundtrip.test
@@ -4,5 +4,6 @@
 
 # Should produce 1904478375 253455
 
-${PBM_BINPREFIX}pamgradient cyan yellow red green 352 240 | \
+${PBM_BINPREFIX}pamgradient rgb:00/ff/ff rgb:ff/ff/00 \
+                            rgb:ff/00/00 rgb:00/ff/00 352 240 | \
     ${PBM_TESTPREFIX}ppmtoyuv | ${PBM_TESTPREFIX}yuvtoppm 352 240 | cksum