diff options
Diffstat (limited to 'test')
215 files changed, 2311 insertions, 628 deletions
diff --git a/test/411toppm.test b/test/411toppm.test index 98170c67..7a9e533c 100755 --- a/test/411toppm.test +++ b/test/411toppm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: 411toppm # Also requires: diff --git a/test/Execute-Tests b/test/Execute-Tests index da4504a4..9b51cfd5 100755 --- a/test/Execute-Tests +++ b/test/Execute-Tests @@ -185,8 +185,8 @@ elif [ $VALGRIND_TESTS = "on" ] # You may want to add --track-origins=yes to the above. for i in awk basename cat cksum cmp comm cp cut date dirname \ - egrep fgrep file grep gs head iconv ls mkdir mktemp perl rm \ - sed seq sh sort tee tr uniq wc \ + egrep fgrep file grep gs head iconv ls mkdir mktemp perl \ + printf rm sed seq sh sort tee tr uniq wc \ testrandom Available-Testprog # Tell valgrind not to probe execution of the above programs. diff --git a/test/Test-Order b/test/Test-Order index c21f892d..dd89a91c 100644 --- a/test/Test-Order +++ b/test/Test-Order @@ -80,6 +80,7 @@ pnminvert.test pamchannel.test ppmchange.test pambackground.test +pnmpad-reportonly.test pnmpaste-pbm.test ppmshift.test @@ -129,16 +130,32 @@ pammixmulti-identity.test symmetry.test +# Standard input tests + +stdin-pbm1.test +stdin-pbm2.test +stdin-pgm1.test +stdin-pgm2.test +stdin-ppm1.test +stdin-ppm2.test +stdin-ppm3.test +stdin-pnm1.test +stdin-pnm2.test +stdin-pam1.test +stdin-pam2.test +stdin-pam3.test + +pbm-misc-converters.test + # Format converter tests pamtopdbimg.test pbmtog3.test +ppmtoapplevol.test 411toppm.test eyuvtoppm.test rawtoppm.test -pbm-misc-converters.test - gif-transparent1.test # Miscellaneous utility tests @@ -155,6 +172,7 @@ pnm-plain-roundtrip.test pnm-pam-roundtrip.test pnminvert-roundtrip.test pamflip-roundtrip.test +pamflip-pbm-roundtrip.test pamdepth-roundtrip.test pad-crop-roundtrip.test pbm-ppm-roundtrip.test diff --git a/test/atari-roundtrip.test b/test/atari-roundtrip.test index 413438a1..809cbdb2 100755 --- a/test/atari-roundtrip.test +++ b/test/atari-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtopi1 pi1toppm ppmtoneo neotoppm # Also requires: pgmramp pamscale pbmmake pamenlarge rgb3toppm pamdepth diff --git a/test/atk-roundtrip.test b/test/atk-roundtrip.test index f87c2e78..97ac1be7 100755 --- a/test/atk-roundtrip.test +++ b/test/atk-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtoatk atktopbm # Also requires: pbmmake diff --git a/test/avs-roundtrip.test b/test/avs-roundtrip.test index 042ce91e..255226db 100755 --- a/test/avs-roundtrip.test +++ b/test/avs-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtoavs avstopam # Also requires: pamtopnm diff --git a/test/bmp-roundtrip.test b/test/bmp-roundtrip.test index df858a09..340eee66 100755 --- a/test/bmp-roundtrip.test +++ b/test/bmp-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: bmptopnm ppmtobmp # Also requires: pamchannel pamtopnm pamseq diff --git a/test/channel-stack-roundtrip.test b/test/channel-stack-roundtrip.test index dae64605..a640b98d 100755 --- a/test/channel-stack-roundtrip.test +++ b/test/channel-stack-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamchanel pamstack # Also requires: pamtopam pamstack pamtopnm diff --git a/test/cis-roundtrip.test b/test/cis-roundtrip.test index 4ad1a5e4..ad34173e 100755 --- a/test/cis-roundtrip.test +++ b/test/cis-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtocis cistopbm # Also requires: pbmmake pamcut pamfile diff --git a/test/cmuw-roundtrip.test b/test/cmuw-roundtrip.test index 725f9131..8664a1e6 100755 --- a/test/cmuw-roundtrip.test +++ b/test/cmuw-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtocmuwm cmuwmtopbm # Also requires: diff --git a/test/cut-cat-roundtrip.test b/test/cut-cat-roundtrip.test index 970c3e17..c2799a7b 100755 --- a/test/cut-cat-roundtrip.test +++ b/test/cut-cat-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamcut # Also requires: pamfile pnmcat pnmpad pnmcrop @@ -12,34 +12,34 @@ padded_ppm=${tmpdir}/padded.ppm echo "Test 1. Should print 1926073387 101484 six times" -testimg_ppm_sum=`cat testimg.ppm | cksum` +testimg_ppm_sum=`cksum < testimg.ppm` echo ${testimg_ppm_sum} - imgsize=$(pamfile -size testimg.ppm) - iw=$(echo ${imgsize} | cut -d" " -f1) - ih=$(echo ${imgsize} | cut -d" " -f2) +imgsize=$(pamfile -size testimg.ppm) +width=$(echo ${imgsize} | cut -d " " -f 1) +height=$(echo ${imgsize} | cut -d " " -f 2) for i in 0 1 128 224 225 do pamcut -left=$((i+1)) testimg.ppm > ${right_ppm} pamcut -right=$i testimg.ppm > ${left_ppm} pnmcat -lr ${left_ppm} ${right_ppm} | \ - pamcut -left=0 -width=${iw} | cksum + pamcut -left=0 -width=${width} | cksum rm ${left_ppm} ${right_ppm} done echo "Test 2. Should print 3891261972 202953 1926073387 101484 six times" # Padding added to right. -pnmpad -right=${iw} -black testimg.ppm | cksum | tr '\n' ' ' +pnmpad -right=${width} -black testimg.ppm | cksum | tr '\n' ' ' echo ${testimg_ppm_sum} for border in 0 1 128 224 225 do - pamcut -left=$((${border}+1)) -width=${iw} -pad testimg.ppm > ${right_ppm} - pamcut -right=${border} -width=${iw} -pad testimg.ppm > ${left_ppm} + pamcut -left=$((${border}+1)) -width=${width} -pad testimg.ppm > ${right_ppm} + pamcut -right=${border} -width=${width} -pad testimg.ppm > ${left_ppm} pnmcat -lr ${left_ppm} ${right_ppm} ${left_ppm} | \ - pamcut -left=$((${iw}-${border}-1)) -width=$((${iw}*2)) | \ + pamcut -left=$((${width}-${border}-1)) -width=$((${width}*2)) | \ tee ${padded_ppm} | cksum | tr '\n' ' ' pnmcrop -black -right ${padded_ppm} | cksum rm ${left_ppm} ${right_ppm} ${padded_ppm} @@ -54,21 +54,22 @@ for border in 0 1 70 147 pamcut -top=$((${border}+1)) testimg.ppm > ${bottom_ppm} pamcut -bottom=${border} testimg.ppm > ${top_ppm} pnmcat -tb ${top_ppm} ${bottom_ppm} | \ - pamcut -top=0 -height=${ih} | cksum + pamcut -top=0 -height=${height} | cksum rm ${top_ppm} ${bottom_ppm} done echo "Test 4. Should print 26789469 202953 1926073387 101484 five times" # Padding added to bottom. -pnmpad -bottom=${ih} -black testimg.ppm | cksum | tr '\n' ' ' +pnmpad -bottom=${height} -black testimg.ppm | cksum | tr '\n' ' ' echo ${testimg_ppm_sum} for border in 0 1 70 147 do - pamcut -top=$((${border}+1)) -height=${ih} -pad testimg.ppm > ${bottom_ppm} - pamcut -bottom=${border} -height=${ih} -pad testimg.ppm > ${top_ppm} + pamcut -top=$((${border}+1)) -height=${height} -pad testimg.ppm \ + > ${bottom_ppm} + pamcut -bottom=${border} -height=${height} -pad testimg.ppm > ${top_ppm} pnmcat -tb ${top_ppm} ${bottom_ppm} ${top_ppm} | \ - pamcut -top=$((${ih}-${border}-1)) -height=$((${ih}*2)) | \ + pamcut -top=$((${height}-${border}-1)) -height=$((${height}*2)) | \ tee ${padded_ppm} | cksum | tr '\n' ' 'cksum pnmcrop -black -bottom ${padded_ppm} | cksum rm ${top_ppm} ${bottom_ppm} ${padded_ppm} @@ -82,19 +83,19 @@ padded_pbm=${tmpdir}/padded.pbm echo "Test 5. Should print 281226646 481 six times" -maze_pbm_sum=`cat maze.pbm | cksum` +maze_pbm_sum=`cksum < maze.pbm` echo ${maze_pbm_sum} imgsize=$(pamfile -size maze.pbm) -iw=$(echo ${imgsize} | cut -d" " -f1) -ih=$(echo ${imgsize} | cut -d" " -f2) +width=$(echo ${imgsize} | cut -d " " -f 1) +height=$(echo ${imgsize} | cut -d " " -f 2) for i in 0 1 10 30 50 do pamcut -left=$((i+1)) maze.pbm > ${right_ppm} pamcut -right=$i maze.pbm > ${left_ppm} pnmcat -lr ${left_ppm} ${right_ppm} | \ - pamcut -left=0 -width=${iw} | cksum + pamcut -left=0 -width=${width} | cksum rm ${left_ppm} ${right_ppm} done @@ -102,15 +103,15 @@ for i in 0 1 10 30 50 echo "Test 6. Should print 1748767123 895 281226646 481 six times" # Padding added to right. -pnmpad -right=${iw} -black maze.pbm | cksum | tr '\n' ' ' +pnmpad -right=${width} -black maze.pbm | cksum | tr '\n' ' ' echo ${maze_pbm_sum} for border in 0 1 10 30 50 do - pamcut -left=$((${border}+1)) -width=${iw} -pad maze.pbm > ${right_ppm} - pamcut -right=${border} -width=${iw} -pad maze.pbm > ${left_ppm} + pamcut -left=$((${border}+1)) -width=${width} -pad maze.pbm > ${right_ppm} + pamcut -right=${border} -width=${width} -pad maze.pbm > ${left_ppm} pnmcat -lr ${left_ppm} ${right_ppm} ${left_ppm} | \ - pamcut -left=$((${iw}-${border}-1)) -width=$((${iw}*2)) | \ + pamcut -left=$((${width}-${border}-1)) -width=$((${width}*2)) | \ tee ${padded_ppm} | cksum | tr '\n' ' ' pnmcrop -black -right ${padded_ppm} | cksum rm ${left_ppm} ${right_ppm} ${padded_ppm} @@ -125,21 +126,21 @@ for border in 0 1 12 21 31 44 pamcut -top=$((${border}+1)) maze.pbm > ${bottom_ppm} pamcut -bottom=${border} maze.pbm > ${top_ppm} pnmcat -tb ${top_ppm} ${bottom_ppm} | \ - pamcut -top=0 -height=${ih} | cksum + pamcut -top=0 -height=${height} | cksum rm ${top_ppm} ${bottom_ppm} done echo "Test 8. Should print 1346655680 954 281226646 481 five times" # Padding added to bottom. -pnmpad -bottom=${ih} -black maze.pbm | cksum | tr '\n' ' ' +pnmpad -bottom=${height} -black maze.pbm | cksum | tr '\n' ' ' echo ${maze_pbm_sum} for border in 0 1 10 50 do - pamcut -top=$((${border}+1)) -height=${ih} -pad maze.pbm > ${bottom_ppm} - pamcut -bottom=${border} -height=${ih} -pad maze.pbm > ${top_ppm} + pamcut -top=$((${border}+1)) -height=${height} -pad maze.pbm > ${bottom_ppm} + pamcut -bottom=${border} -height=${height} -pad maze.pbm > ${top_ppm} pnmcat -tb ${top_ppm} ${bottom_ppm} ${top_ppm} | \ - pamcut -top=$((${ih}-${border}-1)) -height=$((${ih}*2)) | \ + pamcut -top=$((${height}-${border}-1)) -height=$((${height}*2)) | \ tee ${padded_ppm} | cksum | tr '\n' ' 'cksum pnmcrop -black -bottom ${padded_ppm} | cksum rm ${top_ppm} ${bottom_ppm} ${padded_ppm} diff --git a/test/cut-paste-roundtrip.test b/test/cut-paste-roundtrip.test index ac2c0fe7..bec8baf5 100755 --- a/test/cut-paste-roundtrip.test +++ b/test/cut-paste-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamcut pnmpaste # Also requires: pbmmake pnmpad diff --git a/test/enlarge-reduce-roundtrip.test b/test/enlarge-reduce-roundtrip.test index 54b52c60..5d223cf1 100755 --- a/test/enlarge-reduce-roundtrip.test +++ b/test/enlarge-reduce-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamenlarge pbmpscale pbmreduce # Also requires: pbmtext diff --git a/test/eyuvtoppm.test b/test/eyuvtoppm.test index b28b4539..6bbc2e7e 100755 --- a/test/eyuvtoppm.test +++ b/test/eyuvtoppm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: eyuvtoppm # Also requires: diff --git a/test/facesaver-roundtrip.test b/test/facesaver-roundtrip.test index f4b8f069..75fcf662 100755 --- a/test/facesaver-roundtrip.test +++ b/test/facesaver-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmtofs fstopgm # Also requires: pamchannel pamtopnm diff --git a/test/fiasco-roundtrip.test b/test/fiasco-roundtrip.test index 8325a37d..8d5fdaa6 100755 --- a/test/fiasco-roundtrip.test +++ b/test/fiasco-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtofiasco fiascotopnm # Also requires: pnmpad pnmpsnr diff --git a/test/fits-roundtrip.test b/test/fits-roundtrip.test index e793df9a..030a519e 100755 --- a/test/fits-roundtrip.test +++ b/test/fits-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtofits fitstopnm # Also requires: diff --git a/test/g3-roundtrip.test b/test/g3-roundtrip.test index f35c4935..2736c09a 100755 --- a/test/g3-roundtrip.test +++ b/test/g3-roundtrip.test @@ -11,7 +11,7 @@ pagemax_pbm=${tmpdir}/pagemax.pbm echo "Test 1. Should print 0 0 0 : 0 or 0 0 0 0 : 0 total three times" -width=$(pamfile -size maze.pbm | cut -d" " -f1) +width=$(pamfile -size maze.pbm | cut -d " " -f 1) pbmtog3 -nofixedwidth maze.pbm | \ g3topbm -width=${width} | cmp -s - maze.pbm diff --git a/test/gem-roundtrip.test b/test/gem-roundtrip.test index 106fe2cf..d97a5cb9 100755 --- a/test/gem-roundtrip.test +++ b/test/gem-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtogem gemtopnm # Also requires: diff --git a/test/gif-transparent1.test b/test/gif-transparent1.test index 4684d1fc..c2da5468 100755 --- a/test/gif-transparent1.test +++ b/test/gif-transparent1.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: giftopnm pamtogif ppmtogif # Also requires: pamarith pamcomp pamdepth pamenlarge pamstack pbmmake # Also requires: pnminvert ppmchange ppmpat ppmtopgm ppmtoppm diff --git a/test/hdiff-roundtrip.test b/test/hdiff-roundtrip.test index a4a4a906..ec7afc2c 100755 --- a/test/hdiff-roundtrip.test +++ b/test/hdiff-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: hdifftopam pamtohdiff # Also requires: diff --git a/test/ilbm-roundtrip.ok b/test/ilbm-roundtrip.ok index fcbdf4f6..07c44515 100644 --- a/test/ilbm-roundtrip.ok +++ b/test/ilbm-roundtrip.ok @@ -9,6 +9,10 @@ Test 2. Should produce 1926073387 101484 three times 1926073387 101484 Test 3. Should print 984199586 101484 984199586 101484 -Test 4. Should print 2059976475 661 twice +Test 4. Should print 2059976475 661 three times 2059976475 661 2059976475 661 +2059976475 661 +Test 5. Should print 482756572 101484 twice +482756572 101484 +482756572 101484 diff --git a/test/ilbm-roundtrip.test b/test/ilbm-roundtrip.test index 85e04b26..c0b684ed 100755 --- a/test/ilbm-roundtrip.test +++ b/test/ilbm-roundtrip.test @@ -1,6 +1,6 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtoilbm ilbmtoppm -# Also requires: pamseq pamdepth pamtopnm pnmremap +# Also requires: pamseq pamdepth pamtopnm pnmremap pnmcolormap echo "Test 1. Should produce 669206373 10102 five times" #Output is PPM raw, 57 by 59 maxval 255 @@ -16,14 +16,25 @@ ppmtoilbm testimg.ppm | ilbmtoppm | cksum ppmtoilbm -24force testimg.ppm | ilbmtoppm | cksum ppmtoilbm -dcbits 8 8 8 -nocompress testimg.ppm | ilbmtoppm | cksum +tmpdir=${tmpdir:-/tmp} echo "Test 3. Should print 984199586 101484" -pamseq 3 5 -tupletype=RGB | pamdepth 255 | pamtopnm | \ +test_ppm=${tmpdir}/test.ppm +pamseq 3 5 -tupletype=RGB | pamdepth 255 | pamtopnm | tee ${test_ppm} | \ pnmremap -mapfile=- testimg.ppm | ppmtoilbm | ilbmtoppm | cksum -echo "Test 4. Should print 2059976475 661 twice" -pamseq 3 5 -tupletype=RGB | pamtopnm | \ - ppmtoilbm -compress | ilbmtoppm | cksum -pamseq 3 5 -tupletype=RGB | pamtopnm | \ - ppmtoilbm -nocompress | ilbmtoppm | cksum +echo "Test 4. Should print 2059976475 661 three times" +cat ${test_ppm} | cksum +ppmtoilbm -compress ${test_ppm} | ilbmtoppm | cksum +ppmtoilbm -nocompress ${test_ppm} | ilbmtoppm | cksum + +rm ${test_ppm} + +echo "Test 5. Should print 482756572 101484 twice" +mapfile=${tmpdir}/mapfile +pnmcolormap 32 testimg.ppm > ${mapfile} +ppmtoilbm -map ${mapfile} testimg.ppm | ilbmtoppm | tee ${test_ppm} | cksum +ppmtoilbm -map ${mapfile} ${test_ppm} | ilbmtoppm | cksum + +rm ${mapfile} ${test_ppm} diff --git a/test/jbig-roundtrip.test b/test/jbig-roundtrip.test index eac742ff..11cd1778 100755 --- a/test/jbig-roundtrip.test +++ b/test/jbig-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtojbig jbigtopnm # Also requires: pamchannel pamtopnm diff --git a/test/jpeg-roundtrip.test b/test/jpeg-roundtrip.test index 7cc0fc20..834c02e5 100755 --- a/test/jpeg-roundtrip.test +++ b/test/jpeg-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtojpeg jpegtopnm # Also requires: pnmpsnr diff --git a/test/jpeg2k-roundtrip.test b/test/jpeg2k-roundtrip.test index 0995849d..4a09201d 100755 --- a/test/jpeg2k-roundtrip.test +++ b/test/jpeg2k-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtojpeg2k jpeg2ktopam # Also requires: diff --git a/test/leaf-roundtrip.test b/test/leaf-roundtrip.test index 5628ed01..94b31092 100755 --- a/test/leaf-roundtrip.test +++ b/test/leaf-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtoleaf leaftoppm # Also requires: diff --git a/test/lookup-roundtrip.test b/test/lookup-roundtrip.test index 491294a2..19ebd40a 100755 --- a/test/lookup-roundtrip.test +++ b/test/lookup-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamlookup pamunlookup # Also requires: ppmhist diff --git a/test/lps-roundtrip.ok b/test/lps-roundtrip.ok index 277907af..c2c8ab3b 100644 --- a/test/lps-roundtrip.ok +++ b/test/lps-roundtrip.ok @@ -1,2 +1,4 @@ -Test. Should print match +Test 1. Should print match match +Test 2. Should print 0 +0 diff --git a/test/lps-roundtrip.test b/test/lps-roundtrip.test index 71cd354d..78350d71 100755 --- a/test/lps-roundtrip.test +++ b/test/lps-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtolps pstopnm # Also requires: gs pamdepth pamscale pnmcrop pnmpsnr pamfile @@ -9,17 +9,25 @@ tmpdir=${tmpdir:-/tmp} test_pgm=${tmpdir}/test.pgm +test_ps=${tmpdir}/test.ps -echo "Test. Should print match" +echo "Test 1. Should print match" xysize=$(pamfile -size testgrid.pbm | awk '{print "-xsize="$1,"-ysize="$2}') pamdepth 255 testgrid.pbm > ${test_pgm} -pbmtolps -dpi 72 testgrid.pbm | \ +pbmtolps -dpi 72 testgrid.pbm | tee ${test_ps} | \ pstopnm -dpi $((72*12)) -stdout -pgm | \ pnmcrop -white | pamscale ${xysize} | \ pnmpsnr -target=30 - ${test_pgm} - + # ghostscript version 8.71: pnmpsnr lumina 33.14dB + + +echo "Test 2. Should print 0" + +pbmtolps -dpi 72 < testgrid.pbm | sed 's/noname/testgrid.pbm/' | \ + cmp -s ${test_ps} - + echo $? rm ${test_pgm} diff --git a/test/macp-roundtrip.test b/test/macp-roundtrip.test index b264e3d1..9def7c4c 100755 --- a/test/macp-roundtrip.test +++ b/test/macp-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtomacp macptopbm # Also requires: pnmcrop pbmpage pbmupc pnmpad pbmmake diff --git a/test/mda-roundtrip.test b/test/mda-roundtrip.test index 6b4d89b9..c47d433e 100755 --- a/test/mda-roundtrip.test +++ b/test/mda-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtomda mdatopbm # Also requires: pbmmake pnmpad pamcut pamfile diff --git a/test/mgr-roundtrip.test b/test/mgr-roundtrip.test index d96d836d..9fb6211c 100755 --- a/test/mgr-roundtrip.test +++ b/test/mgr-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtomgr mgrtopbm # Also requires: pbmmake diff --git a/test/mrf-roundtrip.test b/test/mrf-roundtrip.test index 8513a908..5ce604e6 100755 --- a/test/mrf-roundtrip.test +++ b/test/mrf-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtomrf mrftopbm # Also requires: diff --git a/test/pad-crop-roundtrip.test b/test/pad-crop-roundtrip.test index 8cca8a5f..31e02c99 100755 --- a/test/pad-crop-roundtrip.test +++ b/test/pad-crop-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmcrop pnmmargin pnmpad # Also requires: diff --git a/test/palm-roundtrip2.test b/test/palm-roundtrip2.test index 4c94df8c..f0c9b7c8 100755 --- a/test/palm-roundtrip2.test +++ b/test/palm-roundtrip2.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtopalm palmtopnm # Also requires: pnmremap diff --git a/test/pamarith-compare-equal.test b/test/pamarith-compare-equal.test index 0af9ee27..7d1062b7 100755 --- a/test/pamarith-compare-equal.test +++ b/test/pamarith-compare-equal.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamarith # Also requires: ppmpat pnminvert pamfile pbmmake pgmmake pamcut diff --git a/test/pamarith-multiple-input.test b/test/pamarith-multiple-input.test index 7df08817..b9c09662 100755 --- a/test/pamarith-multiple-input.test +++ b/test/pamarith-multiple-input.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamarith # Also requires: pgmmake ppmpat pamfunc @@ -14,7 +14,7 @@ pgmmake -maxval=99 0.01 16 11 > ${input1_pgm} add_command="pamarith -add "${input1_pgm} -for ((i=1 ; i<10 ; i++ )) +for i in 1 2 3 4 5 6 7 8 9 # for i in `seq 9` do echo ${i}":" add_command=${add_command}" "${input1_pgm} @@ -58,4 +58,4 @@ for function in "-add" "-and" "-or" "-xor" "-nand" "-nor" pamarith ${function} ${g2_ppm} ${g3_ppm} ${g2_ppm} | cksum done -rm ${g2_ppm} ${g3_ppm} \ No newline at end of file +rm ${g2_ppm} ${g3_ppm} diff --git a/test/pamarith.test b/test/pamarith.test index b6b4538c..9c95db80 100755 --- a/test/pamarith.test +++ b/test/pamarith.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamarith # Also requires: pamtopnm rgb3toppm pamenlarge pnmcat pamseq pbmmake pgmmake # Also requires: ppmpat pamchannel diff --git a/test/pambackground.test b/test/pambackground.test index 522f4823..eca9cc93 100755 --- a/test/pambackground.test +++ b/test/pambackground.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pambackground # Also requires: pamgradient pamseq pbmmake pnmmargin pnmremap pnmtile pnmpad diff --git a/test/pambrighten.test b/test/pambrighten.test index 3e1a3eb1..00e405dd 100755 --- a/test/pambrighten.test +++ b/test/pambrighten.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pambrighten # Also requires: pgmramp diff --git a/test/pamchannel.test b/test/pamchannel.test index bce1d4eb..f72725ee 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 diff --git a/test/pamcrater.test b/test/pamcrater.test index 25b12135..61414480 100755 --- a/test/pamcrater.test +++ b/test/pamcrater.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamcrater pamshadedrelief # Also requires: pamstack pamvalidate pamcut pamflip diff --git a/test/pamcut.test b/test/pamcut.test index e18c3cf2..2299b4bc 100755 --- a/test/pamcut.test +++ b/test/pamcut.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamcut pbmmake # Also requires: pamfile @@ -27,8 +27,9 @@ pamcut -top 10 -left 10 -width 207 -height 129 testimg.ppm | cksum echo "Test 5. Should print 281226646 481 five times" -width=$(pamfile -size maze.pbm | awk '{print $1}') -height=$(pamfile -size maze.pbm | awk '{print $2}') +mazesize=$(pamfile -size maze.pbm) +width=$(echo ${mazesize} | cut -d " " -f 1) +height=$(echo ${mazesize} | cut -d " " -f 2) pamcut -croptop 0 -cropleft 0 -cropbottom 0 -cropright 0 maze.pbm | \ cksum diff --git a/test/pamdepth-roundtrip.test b/test/pamdepth-roundtrip.test index d3f0d6d3..6da9a612 100755 --- a/test/pamdepth-roundtrip.test +++ b/test/pamdepth-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamdepth pgmtopbm # Also requires: diff --git a/test/pamdice-roundtrip.test b/test/pamdice-roundtrip.test index 741615f5..4d3fba19 100755 --- a/test/pamdice-roundtrip.test +++ b/test/pamdice-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamdice pamundice # Also requires: pamfile @@ -6,8 +6,8 @@ tmpdir=${tmpdir:-/tmp} fname_stem=${tmpdir}/pamdice_part mazesize=$(pamfile -size maze.pbm) -mw=$(echo ${mazesize} | cut -d" " -f1) -mh=$(echo ${mazesize} | cut -d" " -f2) +mw=$(echo ${mazesize} | cut -d " " -f 1) +mh=$(echo ${mazesize} | cut -d " " -f 2) echo "Test 1. Should print 281226646 481" diff --git a/test/pamdice.test b/test/pamdice.test index 25695d5a..04dd4d78 100755 --- a/test/pamdice.test +++ b/test/pamdice.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamdice # Also requires: pbmmake diff --git a/test/pamditherbw-random.test b/test/pamditherbw-random.test index 5bff4bac..7a5de7bd 100755 --- a/test/pamditherbw-random.test +++ b/test/pamditherbw-random.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamditherbw # Also requires: pamchannel pamtopnm diff --git a/test/pamditherbw.test b/test/pamditherbw.test index 43d2b00f..3f37f117 100755 --- a/test/pamditherbw.test +++ b/test/pamditherbw.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamditherbw # Also requires: pamchannel pamtopnm diff --git a/test/pamedge.test b/test/pamedge.test index c63b30cc..8121f858 100755 --- a/test/pamedge.test +++ b/test/pamedge.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamedge # Also requires: pbmpscale pbmtext pgmtopbm pgmtopgm ppmtopgm diff --git a/test/pamendian-roundtrip.ok b/test/pamendian-roundtrip.ok index 50450617..6245abb9 100644 --- a/test/pamendian-roundtrip.ok +++ b/test/pamendian-roundtrip.ok @@ -1,4 +1,5 @@ -Test 1: Should print '0 0 0 : 0' +Test 1. Should print '0 0 0 : 0' 0 0 0 : 0 -Test 2 should print echo '0 0 0 0 0 : 0' +Test 2. Should print '0 0 0 0 0 : 0' twice +0 0 0 0 0 : 0 0 0 0 0 0 : 0 diff --git a/test/pamendian-roundtrip.test b/test/pamendian-roundtrip.test index aed03c76..b060b704 100755 --- a/test/pamendian-roundtrip.test +++ b/test/pamendian-roundtrip.test @@ -2,7 +2,7 @@ # This script tests: pamendian # Also requires: pamdepth pgmtopbm pamseq -echo "Test 1: Should print '0 0 0 : 0'" +echo "Test 1. Should print '0 0 0 : 0'" tmpdir=${tmpdir:-/tmp} test0_pam=${tmpdir}/test0.pam @@ -15,8 +15,12 @@ pamendian < ${test0_pam} | pamendian |\ rm ${test0_pam} -echo "Test 2 should print echo '0 0 0 0 0 : 0'" +echo "Test 2. Should print '0 0 0 0 0 : 0' twice" pamdepth 65535 testgrid.pbm | pamendian | pamendian | \ pgmtopbm -th -val=0.5 | cmp -s - testgrid.pbm + echo ${PIPESTATUS[@]} ":" $? + +pamdepth 4095 maze.pbm | pamendian | pamendian | \ + pgmtopbm -th -val=0.5 | cmp -s - maze.pbm echo ${PIPESTATUS[@]} ":" $? \ No newline at end of file diff --git a/test/pamenlarge-pbm.test b/test/pamenlarge-pbm.test index 87493516..fbb2eced 100755 --- a/test/pamenlarge-pbm.test +++ b/test/pamenlarge-pbm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamenlarge # Also requires: pbmmake pnmpad @@ -18,22 +18,24 @@ LC_ALL=C awk 'BEGIN { print "P4"; # header # Test 1. echo "test 1" -for xs in `seq 23` +for xs in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 # for xs in `seq 23` do - pamenlarge -xscale=$xs ${complete256_pbm} | cksum + pamenlarge -xscale=${xs} ${complete256_pbm} | cksum done # Test 2. echo "test 2" -for xs1 in `seq 15` +for xs1 in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # for xs in `seq 15` do - xs2=$((30-$xs1)) - pamenlarge -xscale=$xs1 ${complete256_pbm} | pamenlarge -xscale=$xs2 | cksum - if [ $xs1 != $xs2 ]; then - pamenlarge -xscale=$xs2 ${complete256_pbm} | pamenlarge -xscale=$xs1 | cksum + xs2=$((30-${xs1})) + pamenlarge -xscale=${xs1} ${complete256_pbm} | \ + pamenlarge -xscale=${xs2} | cksum + if [ ${xs1} != ${xs2} ]; then + pamenlarge -xscale=${xs2} ${complete256_pbm} | \ + pamenlarge -xscale=${xs1} | cksum fi - pamenlarge -xscale=$(($xs1 * $xs2)) ${complete256_pbm} | cksum + pamenlarge -xscale=$((${xs1} * ${xs2})) ${complete256_pbm} | cksum done rm ${complete256_pbm} @@ -43,19 +45,19 @@ echo "test 3" test3_pbm=${tmpdir}/test3.pbm -for width in `seq 16` +for width in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 # for width in `seq 16` do pbmmake -g ${width} 1 | pnmpad -top=1 -white | \ pnmpad -bottom=1 -black > ${test3_pbm}.${width} done - for xscale in `seq 16` + for xscale in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 # for xscale in `seq 16` do echo -n ${xscale} " " - for width in `seq 16` + for width in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 # for width in `seq 16` do pamenlarge -xscale=${xscale} ${test3_pbm}.${width} ; done | cksum # # unlike most other tests we take the cksum of a composite PBM file # done -rm ${test3_pbm}.[1-9] ${test3_pbm}.1[0-6] \ No newline at end of file +rm ${test3_pbm}.[1-9] ${test3_pbm}.1[0-6] diff --git a/test/pamenlarge.test b/test/pamenlarge.test index 851362e8..7c46881d 100755 --- a/test/pamenlarge.test +++ b/test/pamenlarge.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamenlarge # Also requires: pamchannel pamseq pamtopnm diff --git a/test/pamexec.test b/test/pamexec.test index ec57f4ae..7c2bf054 100755 --- a/test/pamexec.test +++ b/test/pamexec.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamexec # Also requires: pbmtext pamfile pbmminkowski pbmtog3 g3topbm @@ -6,7 +6,9 @@ tmpdir=${tmpdir:-/tmp} test_pbm=${tmpdir}/test.pbm combined_pbm=${tmpdir}/combined.pbm -for i in `seq 0 9`; do echo $i | pbmtext -builtin=fixed > ${test_pbm}$i; done +for i in 0 1 2 3 4 5 6 7 8 9 # for i in `seq 0 9` + do echo ${i} | pbmtext -builtin=fixed > ${test_pbm}${i} + done cat ${test_pbm}[0123456789] > ${combined_pbm} echo "Test 1 : Should print 10 stdin: PBM RAW 21 24 1 1 BLACKANDWHITE twice" @@ -16,7 +18,8 @@ pamexec "pamfile -mach" ${combined_pbm} | uniq -c | sed 's/^ *//' echo "Test 2: Should print 1791121103 989 twice" -for i in `seq 0 9`; do pbmminkowski ${test_pbm}$i ; done | cksum +for i in 0 1 2 3 4 5 6 7 8 9 # for i in `seq 0 9` + do pbmminkowski ${test_pbm}${i}; done | cksum pamexec "pbmminkowski" ${combined_pbm} | cksum rm ${test_pbm}[0123456789] diff --git a/test/pamfile.test b/test/pamfile.test index 41aa3c85..a0a5c65b 100755 --- a/test/pamfile.test +++ b/test/pamfile.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamfile # Also requires: pamchannel pamtopnm diff --git a/test/pamfind.test b/test/pamfind.test index e689754f..87ef5f9f 100755 --- a/test/pamfind.test +++ b/test/pamfind.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamfind # Also requires: diff --git a/test/pamfix.test b/test/pamfix.test index 1293dfe2..89d3beb6 100755 --- a/test/pamfix.test +++ b/test/pamfix.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamfix # Also requires: pbmmake @@ -9,37 +9,37 @@ echo "Test 1" pbmmake -g 5 5 | pamfix -truncate -plain -echo -e "P1\n5 5\n01010\n10101\n01010\n00001\n1" |\ +printf "P1\n5 5\n01010\n10101\n01010\n00001\n1\n" |\ pamfix -truncate -plain -echo -e "P1\n5 5\n01010\n10101\n01010\n0000\n1" |\ +printf "P1\n5 5\n01010\n10101\n01010\n0000\n1\n" |\ pamfix -truncate -plain -echo -e "P1\n5 5\n01010\n10102\n01010\n00001\n1" |\ +printf "P1\n5 5\n01010\n10102\n01010\n00001\n1\n" |\ pamfix -truncate -plain # Test 2 echo "Test 2" -echo -e "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7 0" |\ +printf "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7 0\n" |\ pamfix -truncate -plain -echo -e "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7" |\ +printf "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7\n" |\ pamfix -truncate -plain -echo -e "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7 8" |\ +printf "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7 8\n" |\ pamfix -truncate -plain -echo -e "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7 8" |\ +printf "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7 8\n" |\ pamfix -change -plain -echo -e "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7 8" |\ +printf "P2\n3 3\n7\n0 1 2\n3 4 5\n6 7 8\n" |\ pamfix -clip -plain -echo -e "P2\n3 3\n7\n0 1 2\n3 4 8\n0 0 0" |\ +printf "P2\n3 3\n7\n0 1 2\n3 4 8\n0 0 0\n" |\ pamfix -change -truncate -plain -echo -e "P2\n3 3\n7\n0 1 2\n3 4 8\n0 0 0" |\ +printf "P2\n3 3\n7\n0 1 2\n3 4 8\n0 0 0\n" |\ pamfix -clip -truncate -plain # Test Invalid @@ -53,17 +53,17 @@ echo "Invalid command-line combination, invalid input" 1>&2 echo "Error messages should appear below the line." 1>&2 echo "-----------------------------------------------------------" 1>&2 -echo -e "P2\n3 2\n7\n0 1 2\n6 7 8" | pamfix -change -clip > ${test_out} || \ +printf "P2\n3 2\n7\n0 1 2\n6 7 8\n" | pamfix -change -clip > ${test_out} || \ echo -n "Expected failure 1"; test -s ${test_out}; echo " "$? rm -f ${test_out} -echo -e "P1\n5 5" | pamfix -truncate -plain > ${test_out} || \ +printf "P1\n5 5\n" | pamfix -truncate -plain > ${test_out} || \ echo -n "Expected failure 2"; test -s ${test_out}; echo " "$? rm -f ${test_out} -echo -e "P2\n3 3\255" | pamfix -truncate -plain > ${test_out} || \ +printf "P2\n3 3\255\n" | pamfix -truncate -plain > ${test_out} || \ echo -n "Expected failure 3"; test -s ${test_out}; echo " "$? rm -f ${test_out} diff --git a/test/pamflip-pbm-roundtrip.ok b/test/pamflip-pbm-roundtrip.ok new file mode 100644 index 00000000..c72e40d6 --- /dev/null +++ b/test/pamflip-pbm-roundtrip.ok @@ -0,0 +1,122 @@ +Test 1. Should print 281226646 481 seven times +281226646 481 +281226646 481 +281226646 481 +281226646 481 +281226646 481 +281226646 481 +281226646 481 +Test 2. Should print 1576602925 8 fourteen times +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +1576602925 8 +Test 3. Should print N : 0 thirty-two times +1 : 0 +2 : 0 +3 : 0 +4 : 0 +5 : 0 +6 : 0 +7 : 0 +8 : 0 +9 : 0 +10 : 0 +11 : 0 +12 : 0 +13 : 0 +14 : 0 +15 : 0 +16 : 0 +17 : 0 +18 : 0 +19 : 0 +20 : 0 +21 : 0 +22 : 0 +23 : 0 +24 : 0 +25 : 0 +26 : 0 +27 : 0 +28 : 0 +29 : 0 +30 : 0 +31 : 0 +32 : 0 +Test 4. Should print N : 0 thirty-two times +1 : 0 +2 : 0 +3 : 0 +4 : 0 +5 : 0 +6 : 0 +7 : 0 +8 : 0 +9 : 0 +10 : 0 +11 : 0 +12 : 0 +13 : 0 +14 : 0 +15 : 0 +16 : 0 +17 : 0 +18 : 0 +19 : 0 +20 : 0 +21 : 0 +22 : 0 +23 : 0 +24 : 0 +25 : 0 +26 : 0 +27 : 0 +28 : 0 +29 : 0 +30 : 0 +31 : 0 +32 : 0 +Test 5. Should print N : 0 thirty-two times +1 : 0 +2 : 0 +3 : 0 +4 : 0 +5 : 0 +6 : 0 +7 : 0 +8 : 0 +9 : 0 +10 : 0 +11 : 0 +12 : 0 +13 : 0 +14 : 0 +15 : 0 +16 : 0 +17 : 0 +18 : 0 +19 : 0 +20 : 0 +21 : 0 +22 : 0 +23 : 0 +24 : 0 +25 : 0 +26 : 0 +27 : 0 +28 : 0 +29 : 0 +30 : 0 +31 : 0 +32 : 0 diff --git a/test/pamflip-pbm-roundtrip.test b/test/pamflip-pbm-roundtrip.test new file mode 100755 index 00000000..71f2e926 --- /dev/null +++ b/test/pamflip-pbm-roundtrip.test @@ -0,0 +1,74 @@ +#! /bin/sh +# This script tests: pamflip +# Also requires: ppmpat pamseq pamtopnm + +tmpdir=${tmpdir:-/tmp} +dot_pbm=${tmpdir}/dot.pbm +noise_pbm=${tmpdir}/noise.pbm + +echo "Test 1. Should print 281226646 481 seven times" + +pamflip -null maze.pbm | cksum +pamflip -lr maze.pbm | pamflip -lr | cksum +pamflip -tb maze.pbm | pamflip -tb | cksum +pamflip -r180 maze.pbm | pamflip -r180 | cksum +pamflip -xy maze.pbm | pamflip -xy | cksum +pamflip -r90 maze.pbm | pamflip -r90 | pamflip -r90 | pamflip -r90 | cksum +pamflip -r270 maze.pbm | pamflip -r270 | pamflip -r270 | pamflip -r270 | cksum + +echo "Test 2. Should print 1576602925 8 fourteen times" + +pbmmake -b 1 1 | tee ${dot_pbm} | cksum +pamflip -null ${dot_pbm} | cksum + +# the next six aren't round-trip +pamflip -lr ${dot_pbm} | cksum +pamflip -tb ${dot_pbm} | cksum +pamflip -r180 ${dot_pbm} | cksum +pamflip -xy ${dot_pbm} | cksum +pamflip -r90 ${dot_pbm} | cksum +pamflip -r270 ${dot_pbm} | cksum + +pamflip -lr ${dot_pbm} | pamflip -lr | cksum +pamflip -tb ${dot_pbm} | pamflip -tb | cksum +pamflip -r180 ${dot_pbm} | pamflip -r180 | cksum +pamflip -xy ${dot_pbm} | pamflip -xy | cksum +pamflip -r90 ${dot_pbm} | pamflip -r90 | pamflip -r90 | pamflip -r90 | cksum +pamflip -r270 ${dot_pbm} | pamflip -r270 | \ + pamflip -r270 | pamflip -r270 | cksum + +rm ${dot_pbm} + +echo "Test 3. Should print N : 0 thirty-two times" + +for i in 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 31 32 + do + pbmnoise -randomseed=${i} -pack ${i} 3 > ${noise_pbm} && \ + pamflip -lr ${noise_pbm} | pamflip -lr | cmp -s - ${noise_pbm} + echo $i : $? + rm ${noise_pbm} + done + +echo "Test 4. Should print N : 0 thirty-two times" + +for i in 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 31 32 + do + pbmnoise -randomseed=${i} -pack 7 ${i} > ${noise_pbm} && \ + pamflip -tb ${noise_pbm} | pamflip -tb | cmp -s - ${noise_pbm} + echo $i : $? + rm ${noise_pbm} + done + + +echo "Test 5. Should print N : 0 thirty-two times" + +for i in 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 31 32 + do + pbmnoise -randomseed=${i} -pack ${i} ${i} > ${noise_pbm} && \ + pamflip -xy ${noise_pbm} | pamflip -xy | cmp -s - ${noise_pbm} + echo $i : $? + rm ${noise_pbm} + done diff --git a/test/pamflip-roundtrip.ok b/test/pamflip-roundtrip.ok index 48d5ab62..70ed6424 100644 --- a/test/pamflip-roundtrip.ok +++ b/test/pamflip-roundtrip.ok @@ -1,4 +1,4 @@ -Test 1. Should produce 1988581932 2989 fifteen times +Test 1. Should print 1988581932 2989 fifteen times 1988581932 2989 1988581932 2989 1988581932 2989 @@ -14,7 +14,7 @@ Test 1. Should produce 1988581932 2989 fifteen times 1988581932 2989 1988581932 2989 1988581932 2989 -Test 2. Should produce 2729474106 27 nine times +Test 2. Should print 2729474106 27 nine times 2729474106 27 2729474106 27 2729474106 27 @@ -24,7 +24,7 @@ Test 2. Should produce 2729474106 27 nine times 2729474106 27 2729474106 27 2729474106 27 -Test 3. Should produce 1849343241 27 nine times +Test 3. Should print 1849343241 27 nine times 1849343241 27 1849343241 27 1849343241 27 @@ -35,7 +35,7 @@ Test 3. Should produce 1849343241 27 nine times 1849343241 27 1849343241 27 Test 4. Should print a single pixel PPM image maxval 65535 in -plain (ascii) format; then produce 2434897823 19 nine times +plain (ascii) format; then print 2434897823 19 fifteen times P3 1 1 65535 @@ -49,7 +49,13 @@ P3 2434897823 19 2434897823 19 2434897823 19 -Test 4. Should produce 281226646 481 seven times +2434897823 19 +2434897823 19 +2434897823 19 +2434897823 19 +2434897823 19 +2434897823 19 +Test 5. Should print 281226646 481 seven times 281226646 481 281226646 481 281226646 481 diff --git a/test/pamflip-roundtrip.test b/test/pamflip-roundtrip.test index 27a3c1f6..6103f6fb 100755 --- a/test/pamflip-roundtrip.test +++ b/test/pamflip-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamflip # Also requires: ppmpat pamseq pamtopnm @@ -8,7 +8,7 @@ test1_pgm=${tmpdir}/test1.pgm test2_pgm=${tmpdir}/test2.pgm dot_ppm=${tmpdir}/dot.ppm -echo "Test 1. Should produce 1988581932 2989 fifteen times" +echo "Test 1. Should print 1988581932 2989 fifteen times" ppmpat -tartan -mesh \ -color=rgb:0/0/0,rgb:ff/00/ff,rgb:80/90/20 31 32 > ${tartan_ppm} @@ -38,7 +38,7 @@ rm ${tartan_ppm} pamseq 1 15 | pamtopnm -assume > ${test1_pgm} -echo "Test 2. Should produce 2729474106 27 nine times" +echo "Test 2. Should print 2729474106 27 nine times" pamflip -null ${test1_pgm} | cksum pamflip -lr ${test1_pgm} | pamflip -lr | cksum @@ -55,7 +55,7 @@ pamflip -r270 ${test1_pgm} | pamflip -r270 | \ pamflip -r180 ${test1_pgm} > ${test2_pgm} rm ${test1_pgm} -echo "Test 3. Should produce 1849343241 27 nine times" +echo "Test 3. Should print 1849343241 27 nine times" pamflip -null ${test2_pgm} | cksum pamflip -lr ${test2_pgm} | pamflip -lr | cksum @@ -79,10 +79,19 @@ P3 EOF echo "Test 4. Should print a single pixel PPM image maxval 65535 in " -echo "plain (ascii) format; then produce 2434897823 19 nine times" +echo "plain (ascii) format; then print 2434897823 19 fifteen times" pamflip -null -plain ${dot_ppm} + +# These are not round-trip pamflip -null ${dot_ppm} | cksum +pamflip -lr ${dot_ppm} | cksum +pamflip -tb ${dot_ppm} | cksum +pamflip -xy ${dot_ppm} | cksum +pamflip -r90 ${dot_ppm} | cksum +pamflip -r180 ${dot_ppm} | cksum +pamflip -r270 ${dot_ppm} | cksum + pamflip -lr ${dot_ppm} | pamflip -lr | cksum pamflip -tb ${dot_ppm} | pamflip -tb | cksum pamflip -r180 ${dot_ppm} | pamflip -r180 | cksum @@ -95,7 +104,7 @@ pamflip -r270 ${dot_ppm} | pamflip -r270 | \ rm ${dot_ppm} -echo "Test 4. Should produce 281226646 481 seven times" +echo "Test 5. Should print 281226646 481 seven times" pamflip -null maze.pbm | cksum pamflip -lr maze.pbm | pamflip -lr | cksum @@ -104,5 +113,3 @@ pamflip -r180 maze.pbm | pamflip -r180 | cksum pamflip -xy maze.pbm | pamflip -xy | cksum pamflip -r90 maze.pbm | pamflip -r90 | pamflip -r90 | pamflip -r90 | cksum pamflip -r270 maze.pbm | pamflip -r270 | pamflip -r270 | pamflip -r270 | cksum - -# TODO: PBM various lengths: samples with -lr diff --git a/test/pamflip1.test b/test/pamflip1.test index b30bf6b0..f8da3a74 100755 --- a/test/pamflip1.test +++ b/test/pamflip1.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamflip # Also requires: pamseq diff --git a/test/pamflip2.test b/test/pamflip2.test index 8df293b5..0393d73e 100755 --- a/test/pamflip2.test +++ b/test/pamflip2.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamflip # Also requires: diff --git a/test/pamfunc.test b/test/pamfunc.test index fbb39164..0d1a4f3c 100755 --- a/test/pamfunc.test +++ b/test/pamfunc.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamfunc # Also requires: pamseq pamtopnm pbmmake diff --git a/test/pamgauss.test b/test/pamgauss.test index 87e172a8..6c3eff78 100755 --- a/test/pamgauss.test +++ b/test/pamgauss.test @@ -1,16 +1,16 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamgauss # Also requires: pamfile echo "Test 1" -for i in `seq 3 11` -do -for s in `seq 1 9` -do -pamgauss $i $i -oversample=1 -sigma=.$s | cksum -done -done +for i in 3 4 5 6 7 8 9 10 11 # for i in `seq 3 11` + do + for s in 1 2 3 4 5 6 7 8 9 # for s in `seq 9` + do + pamgauss ${i} ${i} -oversample=1 -sigma=.${s} | cksum + done + done echo "Test 2" diff --git a/test/pamhue-roundtrip.test b/test/pamhue-roundtrip.test index 643ac99a..d68ee344 100755 --- a/test/pamhue-roundtrip.test +++ b/test/pamhue-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamhue # Also requires: diff --git a/test/pammixmulti-identity.test b/test/pammixmulti-identity.test index d205c359..21136fbe 100755 --- a/test/pammixmulti-identity.test +++ b/test/pammixmulti-identity.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pammixmulti # Also requires: pgmnoise pnminvert pamsumm diff --git a/test/pamrecolor.test b/test/pamrecolor.test index 67c6f19d..6f323169 100755 --- a/test/pamrecolor.test +++ b/test/pamrecolor.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamrecolor # Also requires: ppmtopgm pgmmake diff --git a/test/pamscale-filters1.test b/test/pamscale-filters1.test index 63e0d012..575355c6 100755 --- a/test/pamscale-filters1.test +++ b/test/pamscale-filters1.test @@ -5,8 +5,8 @@ tmpdir=${tmpdir:-/tmp} enlarge_ppm=${tmpdir}/enlarge.ppm -width_height=`pamfile -size testimg.ppm | \ - awk '{print "-width="$1, "-height="$2}'` +width_height=$(pamfile -size testimg.ppm | \ + awk '{print "-width="$1, "-height="$2}') # The target values here were determined by running the test on a # 32-bit GNU/Linux system and subtracting 2.5 (dB) from observed diff --git a/test/pamscale-filters2.test b/test/pamscale-filters2.test index f7370020..764488c5 100755 --- a/test/pamscale-filters2.test +++ b/test/pamscale-filters2.test @@ -5,8 +5,8 @@ tmpdir=${tmpdir:-/tmp} stretch_ppm=${tmpdir}/stretch.ppm -width_height=`pamfile -size testimg.ppm | \ - awk '{print "-width="$1, "-height="$2}'` +width_height=$(pamfile -size testimg.ppm | \ + awk '{print "-width="$1, "-height="$2}') pamstretch -xscale=4 -yscale=3 testimg.ppm | pamvalidate > ${stretch_ppm} echo -xscale=4 -yscale=3 mitchell: diff --git a/test/pamscale-filters3.test b/test/pamscale-filters3.test index 5a865508..23e79373 100755 --- a/test/pamscale-filters3.test +++ b/test/pamscale-filters3.test @@ -5,8 +5,8 @@ tmpdir=${tmpdir:-/tmp} stretch_ppm=${tmpdir}/stretch.ppm -width_height=`pamfile -size testimg.ppm | \ - awk '{print "-width="$1, "-height="$2}'` +width_height=$(pamfile -size testimg.ppm | \ + awk '{print "-width="$1, "-height="$2}') pamstretch-gen 3.96 testimg.ppm | pamvalidate > ${stretch_ppm} echo 3.96 hermite: diff --git a/test/pamscale-reportonly.test b/test/pamscale-reportonly.test index a5d2cdcc..f65bcb93 100755 --- a/test/pamscale-reportonly.test +++ b/test/pamscale-reportonly.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamscale # Also requires: diff --git a/test/pamseq.test b/test/pamseq.test index a98a6545..3fe0fc31 100755 --- a/test/pamseq.test +++ b/test/pamseq.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamseq # Also requires: diff --git a/test/pamslice-roundtrip.test b/test/pamslice-roundtrip.test index d1a8a72c..2b7929cf 100755 --- a/test/pamslice-roundtrip.test +++ b/test/pamslice-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamslice pamdeinterlace # Also requires: pamfile pamcut pamtopnm pamflip @@ -7,14 +7,14 @@ echo "Test 1. Should print 139976034 137 twice" # Add header and reconstruct pbm image. # Note that in pamslice output 0 is white and 1 is black: opposite of PBM -mwidth=$(pamfile -size maze.pbm | cut -d" " -f1) +mwidth=$(pamfile -size maze.pbm | cut -d " " -f 1) height=16 pamcut -top=0 -left=0 -height=${height} maze.pbm | cksum (echo "P1" echo "${mwidth} ${height}" - for ((i = 0; i < ${height}; ++i)) + for i in `seq 0 $((${height}-1))` do pamslice -row=$i maze.pbm done | cut -d" " -f2- | sed 'y/01/10/' ) \ @@ -27,7 +27,6 @@ echo "Test 2. Should print 1624460505 574 three times" # whole image takes much time. # Add header and reconstruct ppm image. - tmpdir=${tmpdir:-/tmp} test1711_ppm=${tmpdir}/test1711.ppm @@ -37,21 +36,20 @@ pamcut -left=50 -top=50 -width=17 -height=11 testimg.ppm | \ (echo "P3" echo "17 11" echo "255" - for ((i = 0; i < 11; ++i)) + for i in 0 1 2 3 4 5 6 7 8 9 10 # for i in `seq 0 10` do - pamslice -row=$i ${test1711_ppm} + pamslice -row=${i} ${test1711_ppm} done | cut -d" " -f2- ) \ | pamtopnm | cksum # Same as above test 2, but take cols instead of rows. -# Should print 914327477 4864 (echo "P3" echo "11 17" echo "255" - for ((i = 0; i < 17; ++i)) + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 # for i in `seq 0 16` do - pamslice -col=$i ${test1711_ppm} + pamslice -col=${i} ${test1711_ppm} done | cut -d " " -f2- ) | pamflip -xy | cksum echo "Test 3. Should print 1624460505 574" @@ -66,10 +64,10 @@ pamdeinterlace -takeeven ${test1711_ppm} > ${testeven_ppm} ( echo "P3" echo "17 11" echo "255" - ( for ((i = 0; i < 5; ++i)) + ( for i in 0 1 2 3 4 do - pamslice -row=$i ${testeven_ppm} - pamslice -row=$i ${testodd_ppm} + pamslice -row=${i} ${testeven_ppm} + pamslice -row=${i} ${testodd_ppm} done pamslice -row=5 ${testeven_ppm}; ) | cut -d" " -f2- ) | pamtopnm | cksum diff --git a/test/pamstretch.test b/test/pamstretch.test index 8cbc555a..38e3a649 100755 --- a/test/pamstretch.test +++ b/test/pamstretch.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamstretch # Also requires: pamcut pamfile diff --git a/test/pamsumm.test b/test/pamsumm.test index 32a9b8c1..fb15c0c4 100755 --- a/test/pamsumm.test +++ b/test/pamsumm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamsumm # Also requires: diff --git a/test/pamtable.test b/test/pamtable.test index 335d45c4..037d3b07 100755 --- a/test/pamtable.test +++ b/test/pamtable.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtable # Also requires: pamseq pamdepth pbmmake ppmrainbow @@ -9,12 +9,13 @@ echo pamseq 4 1 -tupletype=RGBA | pamtable echo for maxval in 9 10 9999 10000 65535 - do pbmmake -g 2 2 | pamdepth $maxval | pamtable - echo - ppmrainbow -width=3 -height=2 -norepeat black white | \ - pamdepth $maxval | pamtable - echo - ppmrainbow -width=4 -height=2 -norepeat red blue green | \ - pamdepth $maxval | pamtable - echo + do + pbmmake -g 2 2 | pamdepth ${maxval} | pamtable + echo + ppmrainbow -width=3 -height=2 -norepeat black white | \ + pamdepth ${maxval} | pamtable + echo + ppmrainbow -width=4 -height=2 -norepeat red blue green | \ + pamdepth ${maxval} | pamtable + echo done diff --git a/test/pamtopam.test b/test/pamtopam.test index e9b4f93d..c12470ec 100755 --- a/test/pamtopam.test +++ b/test/pamtopam.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtopam # Also requires: pgmmake pamseq diff --git a/test/pamundice.test b/test/pamundice.test index 1e3dd31b..14b43dfb 100755 --- a/test/pamundice.test +++ b/test/pamundice.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamundice # Also requires: pamfile pgmmake pnmtile pnmcat @@ -7,8 +7,8 @@ fname_stem=${tmpdir}/part echo "Test 1. Should print 2096818803 2818 twice" -for ((x=0; x<3; ++x)) - do for ((y=0; y<5; ++y)) +for x in 0 1 2 + do for y in 0 1 2 3 4 do pgmmake "."$(( x* 25 + y )) 11 17 > ${fname_stem}_${y}_${x}.pgm done @@ -23,7 +23,7 @@ echo "Test 2. Should print 2096818803 2818 twice" tempfile=${tmpdir}/temp -for ((y=0; y<5; ++y)) +for y in 0 1 2 3 4 do pamundice -across=3 ${fname_stem}"_"$y"_%1a".pgm > ${tempfile}_"$y" done @@ -33,7 +33,7 @@ rm ${tempfile}_[01234] # Note: the following 2 are valid. There should not be warning messages. -for ((x=0; x<3; ++x)) +for x in 0 1 2 do pamundice -down=5 ${fname_stem}"_%1d_"$x.pgm > ${tempfile}"_"$x done @@ -45,15 +45,15 @@ rm ${fname_stem}_?_?.pgm echo "Test 3. Should print 2096818803 2818 twice" -for ((x=0; x<2; ++x)) - do for ((y=0; y<5; ++y)) +for x in 0 1 + do for y in 0 1 2 3 4 do pgmmake "."$(( x* 25 + y )) 12 17 > ${fname_stem}_${y}_${x}.pgm done done -for ((x=2; x<3; ++x)) - do for ((y=0; y<5; ++y)) +for x in 2 + do for y in 0 1 2 3 4 do pgmmake "."$(( x* 25 + y )) 11 17 > ${fname_stem}_${y}_${x}.pgm done @@ -64,15 +64,15 @@ pamundice -across=3 -down=5 \ rm ${fname_stem}_?_?.pgm -for ((x=0; x<3; ++x)) - do for ((y=0; y<4; ++y)) +for x in 0 1 2 + do for y in 0 1 2 3 do pgmmake "."$(( x* 25 + y )) 11 18 > ${fname_stem}_${y}_${x}.pgm done done -for ((x=0; x<3; ++x)) - do for ((y=4; y<5; ++y)) +for x in 0 1 2 + do for y in 4 do pgmmake "."$(( x* 25 + y )) 11 17 > ${fname_stem}_${y}_${x}.pgm done @@ -88,17 +88,17 @@ rm ${fname_stem}_?_?.pgm echo "Test 4. Should print 2434390296 4436 four times" msize=$(pamfile -size maze.pbm) -mw=$(echo ${msize} | cut -d" " -f1) -mh=$(echo ${msize} | cut -d" " -f2) +mw=$(echo ${msize} | cut -d " " -f 1) +mh=$(echo ${msize} | cut -d " " -f 2) pnmtile $((${mw} * 2)) $((${mh} * 5)) maze.pbm | cksum -for x in `seq 0 1` - do for y in `seq 0 4` +for x in 0 1 + do for y in 0 1 2 3 4 do cp maze.pbm ${fname_stem}_${y}_${x}.pbm; done done -for (( i=0 ; i<=9; ++i)) +for i in 0 1 2 3 4 5 6 7 8 9 do echo maze.pbm done | pamundice -down=5 -across=2 -listfile=- | cksum @@ -184,8 +184,10 @@ pamundice -down=5 -across=2 -voverlap=$((${mh}+1)) \ rm -f ${test_out} # corrupt listfile : file names do not exist -seq 10 | sed -e 's/^/::::::/' -e 's/$/::::::/' | \ - pamundice -down=5 -across=2 -listfile=- > ${test_out} || \ +for i in 0 1 2 3 4 5 6 7 8 9 + do + mktemp -u XXXXXXXXXX.${i} || echo ":::::::::::"${i}":::::::::::" + done | pamundice -down=5 -across=2 -listfile=- > ${test_out} || \ echo -n "Expected failure 11" test -s ${test_out}; echo " "$? rm -f ${test_out} diff --git a/test/pamvalidate.test b/test/pamvalidate.test index 4cabc7df..708197da 100755 --- a/test/pamvalidate.test +++ b/test/pamvalidate.test @@ -1,20 +1,20 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamvalidate # Also requires: echo "valid" -echo -e "P1\n5 5\n01010\n10101\n01010\n00000\n11111\n" | pamvalidate -plain +printf "P1\n5 5\n01010\n10101\n01010\n00000\n11111\n" | pamvalidate -plain echo "not valid: Should print 0 four times" -echo -e "P1\n5 5\n01010\n10101\n01010\n00000\n1111\n" | pamvalidate | \ +printf "P1\n5 5\n01010\n10101\n01010\n00000\n1111\n" | pamvalidate | \ wc -c | tr -d ' ' -echo -e "P1\n5 5\n01010\n10102\n01010\n00001\n11111\n" | pamvalidate | \ +printf "P1\n5 5\n01010\n10102\n01010\n00001\n11111\n" | pamvalidate | \ wc -c | tr -d ' ' -echo -e "P1\n5\n01010\n10101\n01010\n00000\n11111\n" | pamvalidate | \ +printf "P1\n5\n01010\n10101\n01010\n00000\n11111\n" | pamvalidate | \ wc -c | tr -d ' ' -echo -e "P1\n5 5" | pamvalidate | wc -c | tr -d ' ' +printf "P1\n5 5" | pamvalidate | wc -c | tr -d ' ' diff --git a/test/pbm-misc-converters.ok b/test/pbm-misc-converters.ok index a137102f..1ae5d817 100644 --- a/test/pbm-misc-converters.ok +++ b/test/pbm-misc-converters.ok @@ -1,27 +1,58 @@ -1638343024 43 -2141128209 77 -2542756600 120 -3102495729 32 -2414506375 47 -3241517214 145 -1454090165 46 -1436169407 46 -1454090165 46 -2912484298 46 -3576177652 52 -1478164284 52 -3213223606 141 -3213223606 141 -3213223606 141 -1463148415 108 -203901789 30 -3732005859 92 -2459345477 86 -424535246 92 -609530223 252 -4195053594 248 -2602382240 43 -129620534 361 -2256096096 80 -1349121911 149 +pbmto10x +3017587389 501 +3017587389 501 +pbmto4425 +2529120683 622 +2529120683 622 +pbmtoascii +2361485126 1740 +2361485126 1740 +4017331268 450 +pbmtodjvurle +2707446245 1744 +2707446245 1744 +pbmtoepson +2100180787 510 +2100180787 510 +2963515498 510 +2100180787 510 +1513122412 510 +pbmtogo +34750317 804 +34750317 804 +pbmtoibm23xx +1731023722 546 +1731023722 546 +pbmtolj +1540204160 762 +1540204160 762 +908699854 763 +908699854 763 +pbmtoln03 +1554612498 636 +1554612498 636 +pbmtomatrixorbital +1574732995 458 +1574732995 458 +pbmtonokia +3813814418 972 +3813814418 972 +1385394245 966 +3924854157 972 +3970098281 3388 +167529797 3384 +2260274013 483 +pbmtoplot +2120102625 5318 +2120102625 5318 +pbmtoptx +541430122 708 +541430122 708 +pbmtozinc +2297581967 1725 +2297581967 1725 +pbmtobbnbg +3481527833 672 +pbmtoppa +3955750161 284701 3955750161 284701 diff --git a/test/pbm-misc-converters.test b/test/pbm-misc-converters.test index ad96f13c..ba350bc7 100755 --- a/test/pbm-misc-converters.test +++ b/test/pbm-misc-converters.test @@ -1,40 +1,98 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmto10x pbmto4425 pbmtoascii pbmtobbnbg # This script tests: pbmtodjvurle pbmtoepson pbmtogo pbmtoibm23xx # This script tests: pbmtolj pbmtoln03 pbmtomatrixorbital pbmtonokia -# This script tests: pbmtoplot pbmtoptx pbmtozinc -# Also requires: pbmpage pbmtoppa +# This script tests: pbmtoplot pbmtoppa pbmtoptx pbmtozinc +# Also requires: pbmpage # Note: one-way test. # These converters do not have counterparts that work in the opposite # direction. We check whether the output is unchanged from older # versions. -pbmto10x testgrid.pbm | cksum -pbmto4425 testgrid.pbm | cksum -pbmtoascii testgrid.pbm | cksum -pbmtoascii -2x4 testgrid.pbm | cksum -pbmtobbnbg < testgrid.pbm | cksum -pbmtodjvurle testgrid.pbm | cksum -pbmtoepson testgrid.pbm | cksum -pbmtoepson -protocol=escp testgrid.pbm | cksum -pbmtoepson -protocol=escp9 testgrid.pbm | cksum -pbmtoepson -nonadjacent testgrid.pbm | cksum -pbmtogo testgrid.pbm | cksum -pbmtoibm23xx -xres=60 -yres=60 testgrid.pbm | cksum -pbmtolj testgrid.pbm | cksum -pbmtolj -packbits testgrid.pbm | cksum -pbmtolj -compress testgrid.pbm | cksum -pbmtoln03 testgrid.pbm | cksum -pbmtomatrixorbital < testgrid.pbm | cksum -pbmtonokia -fmt HEX_NOL testgrid.pbm | cksum -pbmtonokia -fmt HEX_NGG testgrid.pbm | cksum -pbmtonokia -fmt HEX_NPM testgrid.pbm | cksum -pbmtonokia -fmt NOL testgrid.pbm | cksum -pbmtonokia -fmt NGG testgrid.pbm | cksum -pbmtonokia -fmt NPM testgrid.pbm | cksum -pbmtoplot testgrid.pbm | cksum -pbmtoptx testgrid.pbm | cksum -pbmtozinc testgrid.pbm | cksum - -(pbmpage 1; pbmpage 2; pbmpage 3) | pbmtoppa | cksum +echo "pbmto10x" +pbmto10x maze.pbm | cksum +pbmto10x < maze.pbm | cksum + +echo "pbmto4425" +pbmto4425 maze.pbm | cksum +pbmto4425 < maze.pbm | cksum + +# Asciitopgm works in the opposite direction, but the round-trip is not accurate + +echo "pbmtoascii" +pbmtoascii maze.pbm | cksum +pbmtoascii < maze.pbm | cksum +pbmtoascii -2x4 maze.pbm | cksum + +echo "pbmtodjvurle" +pbmtodjvurle maze.pbm | cksum +pbmtodjvurle < maze.pbm | cksum + +echo "pbmtoepson" +pbmtoepson maze.pbm | cksum +pbmtoepson < maze.pbm | cksum +pbmtoepson -protocol=escp maze.pbm | cksum +pbmtoepson -protocol=escp9 maze.pbm | cksum +pbmtoepson -nonadjacent maze.pbm | cksum + +echo "pbmtogo" +pbmtogo maze.pbm | cksum +pbmtogo < maze.pbm | cksum + +echo "pbmtoibm23xx" +pbmtoibm23xx -xres=60 -yres=60 maze.pbm | cksum +pbmtoibm23xx -xres=60 -yres=60 < maze.pbm | cksum + +echo "pbmtolj" +pbmtolj maze.pbm | cksum +pbmtolj < maze.pbm | cksum +pbmtolj -packbits maze.pbm | cksum +pbmtolj -compress maze.pbm | cksum + +echo "pbmtoln03" +pbmtoln03 maze.pbm | cksum +pbmtoln03 < maze.pbm | cksum + +echo "pbmtomatrixorbital" +pbmtomatrixorbital maze.pbm | cksum +pbmtomatrixorbital < maze.pbm | cksum + +echo "pbmtonokia" +pbmtonokia -fmt HEX_NOL maze.pbm | cksum +pbmtonokia -fmt HEX_NOL < maze.pbm | cksum +pbmtonokia -fmt HEX_NGG maze.pbm | cksum +pbmtonokia -fmt HEX_NPM maze.pbm | cksum +pbmtonokia -fmt NOL maze.pbm | cksum +pbmtonokia -fmt NGG maze.pbm | cksum +pbmtonokia -fmt NPM maze.pbm | cksum + +echo "pbmtoplot" +pbmtoplot maze.pbm | cksum +pbmtoplot < maze.pbm | cksum + +echo "pbmtoptx" +pbmtoptx maze.pbm | cksum +pbmtoptx < maze.pbm | cksum + +# pbmtozinc embeds input filename in the output + +echo "pbmtozinc" +pbmtozinc maze.pbm | cksum +pbmtozinc < maze.pbm | sed 's/noname/maze/' | cksum + +# pbmtobbnbg input must be from stdin + +echo "pbmtobbnbg" +pbmtobbnbg < maze.pbm | cksum + +# pbmtoppa has constraints on what can be accepted as input; maze.pbm is not accepted +# pbmpage produces suitable input + +tmpdir=${tmpdir:-/tmp} +testpage_pbm=${tmpdir}/testpage.pbm + +echo "pbmtoppa" +(pbmpage 1; pbmpage 2; pbmpage 3) | tee ${testpage_pbm} | pbmtoppa | cksum +pbmtoppa ${testpage_pbm} | cksum +rm ${testpage_pbm} diff --git a/test/pbm-ppm-roundtrip.test b/test/pbm-ppm-roundtrip.test index 23b6c1c4..9a3ff79f 100755 --- a/test/pbm-ppm-roundtrip.test +++ b/test/pbm-ppm-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmtoppm ppmtopgm ppmtoppm pgmtopbm # Also requires: pbmmake ppmcolormask pnminvert diff --git a/test/pbmclean.test b/test/pbmclean.test index 0e17ba8a..7c0c4d6d 100755 --- a/test/pbmclean.test +++ b/test/pbmclean.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmclean # Also requires: pbmmake pbmpage pbmtext pnmmargin pnmpad diff --git a/test/pbmlife.test b/test/pbmlife.test index b4d65ec4..c292ee65 100755 --- a/test/pbmlife.test +++ b/test/pbmlife.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmlife pbmminkowski # Also requires: pbmtext diff --git a/test/pbmmake.test b/test/pbmmake.test index eef4e0da..c3691b80 100755 --- a/test/pbmmake.test +++ b/test/pbmmake.test @@ -1,25 +1,26 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmmake # Also requires: echo "Test 1" -for i in `seq 1 8` -do -for color in -white -black -gray -do -pbmmake -plain $color $i $i | tr -d '\n'; echo -done -done +for size in 1 2 3 4 5 6 7 8 # for size in `seq 8` + do + for color in -white -black -gray + do + pbmmake -plain ${color} ${size} ${size} | tr -d '\n'; echo + done + done echo "Test 2" -for i in `seq 8 5 98` -do - ( pbmmake -w $i $i ; - pbmmake -b $i $i ; - pbmmake -g $i $i ) | cksum -done +for size in 8 13 18 23 28 33 38 43 48 53 58 63 68 73 78 83 88 93 98 + # for size in `seq 8 5 98` + do + ( pbmmake -w ${size} ${size} ; + pbmmake -b ${size} ${size} ; + pbmmake -g ${size} ${size} ) | cksum + done echo "Test Invalid" diff --git a/test/pbmminkowski.test b/test/pbmminkowski.test index 3ad96dfa..790e45bd 100755 --- a/test/pbmminkowski.test +++ b/test/pbmminkowski.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmminkowski # Also requires: pbmmake pnmpad diff --git a/test/pbmnoise-parameters.test b/test/pbmnoise-parameters.test index f3348ae8..e467bfd5 100755 --- a/test/pbmnoise-parameters.test +++ b/test/pbmnoise-parameters.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmnoise # Also requires: diff --git a/test/pbmnoise1.test b/test/pbmnoise1.test index 1b8fc241..855a5629 100755 --- a/test/pbmnoise1.test +++ b/test/pbmnoise1.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmnoise # @@ -13,7 +13,9 @@ done echo "Test 2." -for ((i=0 ; i<=32; i++)) +for i in 0 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 31 32 + # for i in `seq 0 32` do pbmnoise -endian=little -randomseed=11 -ratio=$i/32 -plain 32 1 | \ tr '\n' ' '; echo diff --git a/test/pbmnoise2.test b/test/pbmnoise2.test index 7476d03c..8845e3b8 100755 --- a/test/pbmnoise2.test +++ b/test/pbmnoise2.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmnoise # Also requires: pgmhist diff --git a/test/pbmpage.test b/test/pbmpage.test index 2ee27122..2805ec97 100755 --- a/test/pbmpage.test +++ b/test/pbmpage.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmpage # Also requires: diff --git a/test/pbmpscale.test b/test/pbmpscale.test index a92511b0..9c38bb2e 100755 --- a/test/pbmpscale.test +++ b/test/pbmpscale.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmpscale # Also requires: pbmtext diff --git a/test/pbmtext-bdf.test b/test/pbmtext-bdf.test index d3d4b37f..f1d2019e 100755 --- a/test/pbmtext-bdf.test +++ b/test/pbmtext-bdf.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtext # Also requires: diff --git a/test/pbmtext-iso88591.test b/test/pbmtext-iso88591.test index 69e6ec90..6df296dd 100755 --- a/test/pbmtext-iso88591.test +++ b/test/pbmtext-iso88591.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtext # Also requires: diff --git a/test/pbmtext.test b/test/pbmtext.test index a7c75c23..b82b0771 100755 --- a/test/pbmtext.test +++ b/test/pbmtext.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtext # Also requires: pamfile @@ -41,7 +41,7 @@ for flags in "" "-builtin fixed" do pbmtext ${flags} ${text} | tee ${temp_pbm} | cksum width1=`pamfile ${temp_pbm} | awk '$2=="PBM" && NR==1 {w=$4}; END {print w}' ` -width2=`pbmtext ${flags} ${text} --dry-run | awk '{print $1}' ` +width2=`pbmtext ${flags} ${text} --dry-run | cut -d " " -f 1` if [ ${width1} -eq ${width2} ]; then pbmtext ${flags} -width=${width1} ${text} | cksum diff --git a/test/pbmtog3.test b/test/pbmtog3.test index c23e8af0..8b9c29e1 100755 --- a/test/pbmtog3.test +++ b/test/pbmtog3.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtog3 # Also requires: pbmmake diff --git a/test/pbmtopgm.test b/test/pbmtopgm.test index 53b25aab..46c04705 100755 --- a/test/pbmtopgm.test +++ b/test/pbmtopgm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtopgm # Also requires: diff --git a/test/pbmupc.test b/test/pbmupc.test index f4a4d1e8..8d726de5 100755 --- a/test/pbmupc.test +++ b/test/pbmupc.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmupc # Also requires: diff --git a/test/pcx-roundtrip.ok b/test/pcx-roundtrip.ok index 968f46b9..0f5ac87d 100644 --- a/test/pcx-roundtrip.ok +++ b/test/pcx-roundtrip.ok @@ -1,5 +1,9 @@ +Test 1. Should print 1926073387 101484 1926073387 101484 +Test 2. Should print 369063776 101484 three times 369063776 101484 369063776 101484 369063776 101484 -829921912 685 +Test 3. Should print 669206373 10102 twice +669206373 10102 +669206373 10102 diff --git a/test/pcx-roundtrip.test b/test/pcx-roundtrip.test index 3dba42b9..3a78faba 100755 --- a/test/pcx-roundtrip.test +++ b/test/pcx-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtopcx pcxtoppm # Also requires: pnmremap @@ -29,17 +29,16 @@ P3 255 255 255 EOF -# Test 1. Should print 1926073387 101484 +echo "Test 1. Should print 1926073387 101484" ppmtopcx testimg.ppm | pcxtoppm | cksum -# Test 2. Should print 369063776 101484 three times +echo "Test 2. Should print 369063776 101484 three times" pnmremap testimg.ppm -mapfile=${pcxstd_ppm} | tee ${testpcx_ppm} | cksum ppmtopcx -stdpalette -packed ${testpcx_ppm} | pcxtoppm | cksum ppmtopcx -stdpalette -packed -8bit ${testpcx_ppm} | pcxtoppm | cksum rm ${testpcx_ppm} ${pcxstd_ppm} -# Test 3. Should print 829921912 685 which is the -# result of: -# pgmtoppm < testgrid.pbm | cksum -ppmtopcx -stdpalette -packed testgrid.pbm | pcxtoppm | cksum +echo "Test 3. Should print 669206373 10102 twice" +pgmtoppm < maze.pbm | cksum +ppmtopcx -stdpalette -packed maze.pbm | pcxtoppm | cksum diff --git a/test/pdb-roundtrip.ok b/test/pdb-roundtrip.ok index b903da8d..fbc897fe 100644 --- a/test/pdb-roundtrip.ok +++ b/test/pdb-roundtrip.ok @@ -1,18 +1,18 @@ -pbm grid +Test 1: pbm grid : Should print 2224198737 25671 three times 2224198737 25671 2224198737 25671 2224198737 25671 -pbm tiled +Test 2: pbmnoise : Should print 0 0 0 0 : 0 four times 0 0 0 0 : 0 0 0 0 0 : 0 0 0 0 0 : 0 0 0 0 0 : 0 -pgm ellipse +Test 3: pgm ellipse : Should print 0 0 0 0 0 : 0 four times 0 0 0 0 0 : 0 0 0 0 0 0 : 0 0 0 0 0 0 : 0 0 0 0 0 0 : 0 -pgm ellipse -4depth +Test 4: pgm ellipse -4depth : Should print 0 0 0 0 0 : 0 three times 0 0 0 0 0 : 0 0 0 0 0 0 : 0 0 0 0 0 0 : 0 diff --git a/test/pdb-roundtrip.test b/test/pdb-roundtrip.test index 32d7aa87..c31a63e1 100755 --- a/test/pdb-roundtrip.test +++ b/test/pdb-roundtrip.test @@ -3,35 +3,29 @@ # Also requires: pnmtile pgmramp pamtopnm pamdepth tmpdir=${tmpdir:-/tmp} -tiled_pbm=${tmpdir}/tiled.pbm +noise_pbm=${tmpdir}/noise.pbm ellipse_pgm=${tmpdir}/ellipse.pgm -# Test 1. Should produce 2224198737 25671 -# 3 times -echo pbm grid +echo "Test 1: pbm grid : Should print 2224198737 25671 three times" for flag in "-compressed" "-maybecompressed" "-uncompressed" do pamtopdbimg ${flag} testgrid.pbm | pdbimgtopam | cksum done -# Test 2. Should produce 0 0 0 -# 4 times -echo pbm tiled -pnmtile 160 160 testgrid.pbm > ${tiled_pbm} +echo "Test 2: pbmnoise : Should print 0 0 0 0 : 0 four times" +pbmnoise -randomseed=1 160 160 > ${noise_pbm} for flag in "" "-compressed" "-maybecompressed" "-uncompressed" do - pamtopdbimg ${flag} ${tiled_pbm} | pdbimgtopam | pamtopnm | \ - cmp -s - ${tiled_pbm} + pamtopdbimg ${flag} ${noise_pbm} | pdbimgtopam | pamtopnm | \ + cmp -s - ${noise_pbm} echo ${PIPESTATUS[@]} ":" $? done -rm ${tiled_pbm} +rm ${noise_pbm} -# Test 3. Should produce 0 0 0 -# 4 times -echo pgm ellipse +echo "Test 3: pgm ellipse : Should print 0 0 0 0 0 : 0 four times" pgmramp -ellipse 160 160 -maxval=3 > ${ellipse_pgm} for flag in "" "-compressed" "-maybecompressed" "-uncompressed" do @@ -42,9 +36,7 @@ for flag in "" "-compressed" "-maybecompressed" "-uncompressed" rm ${ellipse_pgm} -# Test 3. Should produce 0 0 0 -# 3 times -echo pgm ellipse -4depth +echo "Test 4: pgm ellipse -4depth : Should print 0 0 0 0 0 : 0 three times" pgmramp -ellipse 160 160 -maxval=15 > ${ellipse_pgm} for flag in "-compressed" "-maybecompressed" "-uncompressed" do @@ -52,4 +44,4 @@ for flag in "-compressed" "-maybecompressed" "-uncompressed" pamtopnm | pamdepth 15 | cmp -s - ${ellipse_pgm} echo ${PIPESTATUS[@]} ":" $? done -rm ${ellipse_pgm} \ No newline at end of file +rm ${ellipse_pgm} diff --git a/test/pfm-roundtrip.test b/test/pfm-roundtrip.test index f1b5d418..95bfc62f 100755 --- a/test/pfm-roundtrip.test +++ b/test/pfm-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtopfm pfmtopam # Also requires: pamtopnm diff --git a/test/pgmbentley.test b/test/pgmbentley.test index 0429d54b..800aa1f7 100755 --- a/test/pgmbentley.test +++ b/test/pgmbentley.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmbentley # Also requires: pgmramp diff --git a/test/pgmhist.test b/test/pgmhist.test index b028b07a..83f3c52e 100755 --- a/test/pgmhist.test +++ b/test/pgmhist.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmhist # Also requires: pgmramp diff --git a/test/pgmmake.test b/test/pgmmake.test index 0ec5efd6..84c03778 100755 --- a/test/pgmmake.test +++ b/test/pgmmake.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmmake # Also requires: diff --git a/test/pgmminkowski.test b/test/pgmminkowski.test index 9d8c257d..e81de3e1 100755 --- a/test/pgmminkowski.test +++ b/test/pgmminkowski.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmminkowski # Also requires: pbmmake pgmmake pnmpad diff --git a/test/pgmnoise-parameters.test b/test/pgmnoise-parameters.test index bf3deb3f..2615c8e8 100755 --- a/test/pgmnoise-parameters.test +++ b/test/pgmnoise-parameters.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmnoise # Also requires: diff --git a/test/pgmnoise.ok b/test/pgmnoise.ok index 80376c78..d98ee053 100644 --- a/test/pgmnoise.ok +++ b/test/pgmnoise.ok @@ -77,7 +77,7 @@ Should print four identical lines 969759084 1682 969759084 1682 Test 6. -First column should be 2^n - 1 +First column should be 2^n - 1. Last column should be 'pool'. 1 pgmnoise: method: pool 3 pgmnoise: method: pool 7 pgmnoise: method: pool @@ -86,6 +86,9 @@ First column should be 2^n - 1 63 pgmnoise: method: pool 127 pgmnoise: method: pool 255 pgmnoise: method: pool +511 pgmnoise: method: pool +1023 pgmnoise: method: pool +65535 pgmnoise: method: pool Test Invalid Expected failure 1 1 Expected failure 2 1 diff --git a/test/pgmnoise.test b/test/pgmnoise.test index 4a6e21dd..45374793 100755 --- a/test/pgmnoise.test +++ b/test/pgmnoise.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmnoise # Also requires: pgmhist pamvalidate pamfile @@ -17,7 +17,7 @@ pgmnoise --randomseed=5489 -maxval=9999 -plain 5 20 echo "Test 3." -for maxval in `seq 16` 255 65535 +for maxval in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 255 65535 do echo ${maxval} pgmnoise -maxval=${maxval} -randomseed=1 -plain 16 1 | tr '\n' ' ' @@ -26,7 +26,8 @@ echo echo "Test 4." # Check for maxval violation -for maxval in `seq 16` 30 31 32 254 255 256 65534 65535 +for maxval in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \ + 30 31 32 254 255 256 65534 65535 do echo -n ${maxval} " " pgmnoise -maxval=${maxval} -randomseed=1 -plain ${maxval} 10 | \ @@ -42,20 +43,29 @@ for xysize in "1 10000" "100 100" "250 40" "1000 10" tmpdir=${tmpdir:-/tmp} -messages=${tmpdir}/messages +outfile=${tmpdir}/out echo "Test 6." -echo "First column should be 2^n - 1" +echo "First column should be 2^n - 1. Last column should be 'pool'." # The "pool" method of generating pixvals is used iff maxval is # a power of 2 minus 1: 1, 3, 7, 15, 31 ... -for maxval in `seq 35; seq 60 69; seq 120 129; seq 250 259` - do - pgmnoise -maxval=${maxval} -randomseed=1 -verbose 1 1 > /dev/null \ - 2> ${messages} - awk -v mval=${maxval} '/method/ && /pool/ { print mval, $0 }' ${messages} - done - rm ${messages} + +for maxval in \ + 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 31 32 33 60 61 62 63 64 65 \ + 127 255 511 1023 65535 \ + 129 142 186 219 677 1068 1788 1820 2067 2154 2301 2317 \ + 5180 5321 5596 6304 7565 9525 \ + 10501 14178 25797 27451 28653 + do + pgmnoise -maxval=${maxval} -plain -randomseed=1 -verbose 1 1 \ + > /dev/null 2> ${outfile} + awk -v mval=${maxval} '/method/ && /pool/ { print mval, $0 }' ${outfile} + rm ${outfile} + done echo "Test Invalid" diff --git a/test/pgmramp.test b/test/pgmramp.test index 50a3cf6d..c3b0ad1c 100755 --- a/test/pgmramp.test +++ b/test/pgmramp.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmramp # Also requires: diff --git a/test/pgmtopgm.ok b/test/pgmtopgm.ok index 53c25a44..38cfd268 100644 --- a/test/pgmtopgm.ok +++ b/test/pgmtopgm.ok @@ -1 +1,11 @@ -729348909 237 +Test 1. Should print two identical PGM images +P2 +10 1 +255 +0 0 0 0 0 0 0 0 0 0 +P2 +10 1 +255 +0 0 0 0 0 0 0 0 0 0 +Test 2. Should print 2582999797 3376 +2582999797 3376 diff --git a/test/pgmtopgm.test b/test/pgmtopgm.test index e919fdac..d81260d8 100755 --- a/test/pgmtopgm.test +++ b/test/pgmtopgm.test @@ -1,6 +1,12 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmtopgm -# Also requires: +# Also requires: pgmmake +echo "Test 1. Should print two identical PGM images" -pgmtopgm < testgrid.pbm | cksum +pgmmake -plain 0 10 1 +pgmmake 0 10 1 | pgmtopgm -plain + +echo "Test 2. Should print 2582999797 3376" + +pgmtopgm < maze.pbm | cksum diff --git a/test/pgmtoppm.test b/test/pgmtoppm.test index 622a0688..d98418b8 100755 --- a/test/pgmtoppm.test +++ b/test/pgmtoppm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmtoppm # Also requires: pamtopnm pnminvert pamseq pgmramp diff --git a/test/pi3-roundtrip.test b/test/pi3-roundtrip.test index 6c75acc7..d795157d 100755 --- a/test/pi3-roundtrip.test +++ b/test/pi3-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtopi3 pi3topbm # Also requires: pbmmake pamcut pamfile diff --git a/test/pict-roundtrip.test b/test/pict-roundtrip.test index cd207d48..b4910064 100755 --- a/test/pict-roundtrip.test +++ b/test/pict-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: picttoppm ppmtopict # Also requires: pamseq pamdepth pamtopnm pnmremap diff --git a/test/png-roundtrip.test b/test/png-roundtrip.test index fcb5927a..97cf9b2c 100755 --- a/test/png-roundtrip.test +++ b/test/png-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pngtopam pnmtopng # Also requires: diff --git a/test/png-roundtrip2.test b/test/png-roundtrip2.test index 5705a1ae..85149a91 100755 --- a/test/png-roundtrip2.test +++ b/test/png-roundtrip2.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pngtopam pamtopng # Also requires: diff --git a/test/pnm-pam-roundtrip.test b/test/pnm-pam-roundtrip.test index 13925f74..da3021f9 100755 --- a/test/pnm-pam-roundtrip.test +++ b/test/pnm-pam-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtopam pamtopnm # Also requires: diff --git a/test/pnm-plain-roundtrip.test b/test/pnm-plain-roundtrip.test index bf685e85..14b8ca57 100755 --- a/test/pnm-plain-roundtrip.test +++ b/test/pnm-plain-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtopnm # diff --git a/test/pnmcat.test b/test/pnmcat.test index c098d967..173aa608 100755 --- a/test/pnmcat.test +++ b/test/pnmcat.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmcat # Also requires: pbmmake pgmramp ppmtoppm diff --git a/test/pnmcolormap.test b/test/pnmcolormap.test index 90d11f6d..089e0d1e 100755 --- a/test/pnmcolormap.test +++ b/test/pnmcolormap.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmcolormap # Also requires: diff --git a/test/pnmcrop-blank.test b/test/pnmcrop-blank.test index 087ad65e..bb26bdc0 100755 --- a/test/pnmcrop-blank.test +++ b/test/pnmcrop-blank.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmcrop # Also requires: pbmmake ppmmake diff --git a/test/pnmcrop1.ok b/test/pnmcrop1.ok index d02d14b3..d979d2db 100644 --- a/test/pnmcrop1.ok +++ b/test/pnmcrop1.ok @@ -1,103 +1,82 @@ Test 1 -test.pbm - -0 0 -7 0 28 25 rgb-1:1/1/1 0.000000 --white -0 0 -7 0 28 25 rgb-1:1/1/1 0.000000 --black -0 0 0 -2 28 30 rgb-1:0/0/0 0.000000 --sides -0 0 -7 0 28 25 rgb-1:1/1/1 0.000000 --top -0 0 -7 0 28 25 rgb-1:1/1/1 0.000000 --bottom -0 0 0 0 28 32 rgb-1:1/1/1 0.000000 --left -0 0 0 0 28 32 rgb-1:1/1/1 0.000000 --right -0 0 0 0 28 32 rgb-1:1/1/1 0.000000 --top -bottom -0 0 -7 0 28 25 rgb-1:1/1/1 0.000000 --bottom -bg-corner=bottomright -0 0 0 -2 28 30 rgb-1:0/0/0 0.000000 --right -bg-corner=bottomright -0 0 0 0 28 32 rgb-1:0/0/0 0.000000 --bg-color=white -0 0 0 0 28 32 rgb-1:1/1/1 0.000000 --bg-color=black -0 0 0 -2 28 30 rgb-1:0/0/0 0.000000 --bg-color=red -0 0 0 0 28 32 rgb-1:0/0/0 0.000000 -test.ppm - +file: maze.pbm option: +0 0 -7 0 71 68 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -white +0 0 -7 0 71 68 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -black +0 0 0 -2 71 73 rgb-1:0/0/0 0.000000 +file: maze.pbm option: -sides +0 0 -7 0 71 68 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -top +0 0 -7 0 71 68 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -bottom +0 0 0 0 71 75 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -left +0 0 0 0 71 75 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -right +0 0 0 0 71 75 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -top -bottom +0 0 -7 0 71 68 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -bottom -bg-corner=bottomright +0 0 0 -2 71 73 rgb-1:0/0/0 0.000000 +file: maze.pbm option: -right -bg-corner=bottomright +0 0 0 0 71 75 rgb-1:0/0/0 0.000000 +file: maze.pbm option: -bg-color=white +0 0 0 0 71 75 rgb-1:1/1/1 0.000000 +file: maze.pbm option: -bg-color=black +0 0 0 -2 71 73 rgb-1:0/0/0 0.000000 +file: maze.pbm option: -bg-color=red +0 0 0 0 71 75 rgb-1:0/0/0 0.000000 +file: rose.ppm option: 0 0 0 0 250 161 rgb-255:127/127/127 0.000000 --white +file: rose.ppm option: -white -6 0 0 0 244 161 rgb-255:255/255/255 0.000000 --black +file: rose.ppm option: -black 0 -11 0 0 239 161 rgb-255:0/0/0 0.000000 --sides +file: rose.ppm option: -sides -6 0 0 0 244 161 rgb-255:255/255/255 0.000000 --top +file: rose.ppm option: -top 0 0 0 0 250 161 rgb-255:127/127/127 0.000000 --bottom +file: rose.ppm option: -bottom 0 0 0 0 250 161 rgb-255:127/127/127 0.000000 --left +file: rose.ppm option: -left 0 0 0 0 250 161 rgb-255:127/127/127 0.000000 --right +file: rose.ppm option: -right 0 0 0 0 250 161 rgb-255:127/127/127 0.000000 --top -bottom +file: rose.ppm option: -top -bottom 0 0 0 0 250 161 rgb-255:127/127/127 0.000000 --bottom -bg-corner=bottomright +file: rose.ppm option: -bottom -bg-corner=bottomright 0 0 0 0 250 161 rgb-255:0/0/0 0.000000 --right -bg-corner=bottomright +file: rose.ppm option: -right -bg-corner=bottomright 0 -11 0 0 239 161 rgb-255:0/0/0 0.000000 --bg-color=white +file: rose.ppm option: -bg-color=white -6 0 0 0 244 161 rgb-255:255/255/255 0.000000 --bg-color=black +file: rose.ppm option: -bg-color=black 0 -11 0 0 239 161 rgb-255:0/0/0 0.000000 --bg-color=red +file: rose.ppm option: -bg-color=red 0 0 0 0 250 161 rgb-255:255/0/0 0.000000 -Test 2 -test.pbm - -3130931737 109 -3130931737 109 --white -3130931737 109 -3130931737 109 --top -3130931737 109 -3130931737 109 -test.ppm - -1435955776 120765 -1435955776 120765 --white -638507845 117867 -638507845 117867 --top -1435955776 120765 -1435955776 120765 +Test 2. Should print 0 six times +file: maze.pbm option: +0 +file: maze.pbm option: -white +0 +file: maze.pbm option: -top +0 +file: rose.ppm option: +0 +file: rose.ppm option: -white +0 +file: rose.ppm option: -top +0 Test Invalid --reportfull -reportsize Expected failure: -reportfull -reportsize 1 --reportfull -borderfile=testgrid.pbm Expected failure: -reportfull -borderfile=testgrid.pbm 1 --reportsize -borderfile=testgrid.pbm Expected failure: -reportsize -borderfile=testgrid.pbm 1 --black -white Expected failure: -black -white 1 --black -sides Expected failure: -black -sides 1 --white -bg-color=red Expected failure: -white -bg-color=red 1 --white -bg-corner=topleft Expected failure: -white -bg-corner=topleft 1 --white -bg-corner=top Expected failure: -white -bg-corner=top 1 --blank-image=pasturize Expected failure: -blank-image=pasturize 1 --bg-color=black -closeness=-1 Expected failure: -bg-color=black -closeness=-1 1 --bg-color=black -closeness=101 Expected failure: -bg-color=black -closeness=101 1 diff --git a/test/pnmcrop1.test b/test/pnmcrop1.test index 936cbd95..00d5ee80 100755 --- a/test/pnmcrop1.test +++ b/test/pnmcrop1.test @@ -1,13 +1,13 @@ -#! /bin/bash + #! /bin/sh # This script tests: pnmcrop # Also requires: pnmpad pnmmargin pamcut tmpdir=${tmpdir:-/tmp} -test_pbm=${tmpdir}/test.pbm -test_ppm=${tmpdir}/test.ppm +test_pbm=${tmpdir}/maze.pbm +test_ppm=${tmpdir}/rose.ppm -pnmmargin -white 7 testgrid.pbm | pnmpad -black -bottom=2 > ${test_pbm} +pnmmargin -white 7 maze.pbm | pnmpad -black -bottom=2 > ${test_pbm} pnmmargin -white 6 testimg.ppm | pnmpad -black -right=11 > ${test_ppm} #Test 1 @@ -15,36 +15,41 @@ echo Test 1 for input_file in ${test_pbm} ${test_ppm} do - echo `basename ${input_file}` + bfile=`basename ${input_file}` for option in "" "-white" "-black" "-sides" \ "-top" "-bottom" "-left" "-right" "-top -bottom" \ "-bottom -bg-corner=bottomright" \ "-right -bg-corner=bottomright" \ "-bg-color=white" "-bg-color=black" "-bg-color=red" do - echo ${option} + echo "file: ${bfile} option: ${option}" pnmcrop -reportfull ${option} ${input_file} || echo fail done done #Test 2 -echo Test 2 +echo "Test 2. Should print 0 six times" + +out_pnm=${tmpdir}/out.pnm for input_file in ${test_pbm} ${test_ppm} do - echo `basename ${input_file}` + bfile=`basename ${input_file}` for option in "" "-white" "-top" do - echo ${option} + echo file: ${bfile} option: ${option} # Normal crop operation - pnmcrop ${option} ${input_file} | cksum + pnmcrop ${option} ${input_file} > ${out_pnm} # Compute edge extents with pnmcrop; let pamcut do the actual cropping pamcut ${input_file} `pnmcrop -reportsize ${option} ${input_file} | \ awk 'NF==6 && NR==1 && \ $1<=0 && $2<=0 && $3<=0 && $4<=0 && $5>=0 && $6>=0 \ - { printf("-cropleft=%d -cropright=%d ", -$1, -$2); - printf("-croptop=%d -cropbottom=%d", -$3, -$4) }' ` | cksum + { printf("-cropleft=%d -cropright=%d ", -$1, -$2); + printf("-croptop=%d -cropbottom=%d ", -$3, -$4) }' ` | \ + cmp -s - ${out_pnm} + echo $? + rm ${out_pnm} done done @@ -72,7 +77,6 @@ for option in "-reportfull -reportsize" \ "-bg-color=black -closeness=-1" \ "-bg-color=black -closeness=101" do - echo ${option} pnmcrop -reportfull ${option} testgrid.pbm > ${test_out} || \ echo -n "Expected failure: " ${option} test -s ${test_out}; echo " "$? diff --git a/test/pnmcrop2.test b/test/pnmcrop2.test index d6c83c73..3d402a57 100755 --- a/test/pnmcrop2.test +++ b/test/pnmcrop2.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmcrop # Also requires: @@ -44,7 +44,7 @@ for corner in topleft topright bottomleft bottomright echo Test 3 -for closeness in `seq 0 6` +for closeness in 0 1 2 3 4 5 6 # for closeness in `seq 0 6` do echo ${closeness} pnmcrop -reportfull -bg-corner=topleft -closeness=${closeness} ${test_pgm} \ diff --git a/test/pnmcrop3.ok b/test/pnmcrop3.ok index 6824143a..5a86139c 100644 --- a/test/pnmcrop3.ok +++ b/test/pnmcrop3.ok @@ -86,5 +86,5 @@ P1 1111111111111 -3 -1 -1 -1 9 13 544280424 101484 -4294967295 0 -4294967295 0 +Expected failure 1 1 +Expected failure 2 1 diff --git a/test/pnmcrop3.test b/test/pnmcrop3.test index c46fd7ea..04cf6f52 100755 --- a/test/pnmcrop3.test +++ b/test/pnmcrop3.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmcrop # Also requires: pnmpad pamfile pgmmake @@ -16,7 +16,7 @@ pnmpad -top=11 -bottom=1 -left=21 -right=9 testimg.ppm > ${test_ppm} pnmpad -top=4 -bottom=4 -left=8 -right=5 testgrid.pbm > ${border_pbm} pnmpad -top=7 -bottom=5 -left=30 -right=0 testimg.ppm > ${border_ppm} -pgmmake 0.5 `pamfile -size ${test_pbm}` > ${gray_pgm} +pgmmake 0.5 $(pamfile -size ${test_pbm}) > ${gray_pgm} # Test 1 echo Test 1 @@ -38,7 +38,7 @@ echo Test 2 for input_file in ${test_pbm} ${test_ppm} do echo `basename ${input_file}` - for margin in `seq 0 5` + for margin in 0 1 2 3 4 5 # for margin in `seq 0 5` do pnmcrop -reportsize -margin=${margin} ${input_file} || echo fail2 done @@ -59,13 +59,22 @@ pnmcrop -borderfile=${border_pbm} ${test_pbm} | pnmcrop -black -reportsize pnmcrop -borderfile=${border_ppm} ${test_ppm} | cksum -# The following two cases are expected to fai +test_out=${tmpdir}/test_out +# The following two cases are expected to fail + +echo "Border file size mismatch" 1>&2 echo "Error messages should appear below the line." 1>&2 echo "--------------------------------------------" 1>&2 -pnmcrop -borderfile=${border_ppm} ${test_pbm} | cksum -pnmcrop -borderfile=${border_pbm} ${test_ppm} | cksum +pnmcrop -borderfile=${border_ppm} ${test_pbm} > ${test_out} || \ + echo -n "Expected failure 1"; + test -s ${test_out}; echo " "$? + rm ${test_out} +pnmcrop -borderfile=${border_pbm} ${test_ppm} > ${test_out} || \ + echo -n "Expected failure 2"; + test -s ${test_out}; echo " "$? + rm ${test_out} -rm ${test_pbm} ${test_ppm} ${border_pbm} ${border_ppm} ${gray_pgm} \ No newline at end of file +rm ${test_pbm} ${test_ppm} ${border_pbm} ${border_ppm} ${gray_pgm} diff --git a/test/pnminvert-roundtrip.test b/test/pnminvert-roundtrip.test index ddc5dc5d..c0f702c2 100755 --- a/test/pnminvert-roundtrip.test +++ b/test/pnminvert-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnminvert # Also requires: diff --git a/test/pnminvert.test b/test/pnminvert.test index 68a4e066..d2789bdf 100755 --- a/test/pnminvert.test +++ b/test/pnminvert.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnminvert # Also requires: pbmmake pamchannel pamtopnm diff --git a/test/pnmpad-reportonly.ok b/test/pnmpad-reportonly.ok new file mode 100644 index 00000000..e7d0a0d1 --- /dev/null +++ b/test/pnmpad-reportonly.ok @@ -0,0 +1,67 @@ +Test 1. Should print 0 0 0 0 227 149 six times +0 0 0 0 227 149 +0 0 0 0 227 149 +0 0 0 0 227 149 +0 0 0 0 227 149 +0 0 0 0 227 149 +0 0 0 0 227 149 +Test 2. Should print 10 0 0 0 110 17 seven times +10 0 0 0 110 17 +10 0 0 0 110 17 +10 0 0 0 110 17 +10 0 0 0 110 17 +10 0 0 0 110 17 +10 0 0 0 110 17 +10 0 0 0 110 17 +Test 3. Should print 0 10 0 0 110 19 eight times +0 10 0 0 110 19 +0 10 0 0 110 19 +0 10 0 0 110 19 +0 10 0 0 110 19 +0 10 0 0 110 19 +0 10 0 0 110 19 +0 10 0 0 110 19 +0 10 0 0 110 19 +Test 4. Should print 10 10 0 0 120 19 four times +10 10 0 0 120 19 +10 10 0 0 120 19 +10 10 0 0 120 19 +10 10 0 0 120 19 +Test 5. Should print 0 0 10 0 27 110 seven times +0 0 10 0 27 110 +0 0 10 0 27 110 +0 0 10 0 27 110 +0 0 10 0 27 110 +0 0 10 0 27 110 +0 0 10 0 27 110 +0 0 10 0 27 110 +Test 6. Should print 0 0 0 10 19 110 eight times +0 0 0 10 19 110 +0 0 0 10 19 110 +0 0 0 10 19 110 +0 0 0 10 19 110 +0 0 0 10 19 110 +0 0 0 10 19 110 +0 0 0 10 19 110 +0 0 0 10 19 110 +Test 7. Should print 0 0 12 12 27 124 four times +0 0 12 12 27 124 +0 0 12 12 27 124 +0 0 12 12 27 124 +0 0 12 12 27 124 +Test 8. Should print 5 10 0 0 115 17 seven times +5 10 0 0 115 17 +5 10 0 0 115 17 +5 10 0 0 115 17 +5 10 0 0 115 17 +5 10 0 0 115 17 +5 10 0 0 115 17 +5 10 0 0 115 17 +Test 9. Should print 0 0 4 8 19 112 seven times +0 0 4 8 19 112 +0 0 4 8 19 112 +0 0 4 8 19 112 +0 0 4 8 19 112 +0 0 4 8 19 112 +0 0 4 8 19 112 +0 0 4 8 19 112 diff --git a/test/pnmpad-reportonly.test b/test/pnmpad-reportonly.test new file mode 100755 index 00000000..ccd79e69 --- /dev/null +++ b/test/pnmpad-reportonly.test @@ -0,0 +1,129 @@ +#! /bin/sh +# This script tests: pnmpad +# Also requires: pbmmake pgmmake ppmmake pamfile + +tmpdir=${tmpdir:-/tmp} + +test1_pbm=${tmpdir}/test1.pbm +test2_pbm=${tmpdir}/test2.pbm +test_pgm=${tmpdir}/test.pgm +test_ppm=${tmpdir}/test.ppm + +testimg_size=$(pamfile -size testimg.ppm) + +echo "Test 1. Should print 0 0 0 0 ${testimg_size} six times" + +for pad in "" "-left=0" "-right=0" "-top=0" "-bottom=0" \ + "-left=0 -right=0 -top=0 -bottom=0" + do + pnmpad -reportonly ${pad} testimg.ppm || echo "failure" + done + + +echo "Test 2. Should print 10 0 0 0 110 17 seven times" + +pbmmake -w 100 17 > ${test1_pbm} +for pad in "-left=10" \ + "-left=10 -right=0" \ + "-left=10 -width=90" \ + "-left=10 -width=105" \ + "-left=10 -width=110" \ + "-right=0 -width=110" \ + "-halign=1.0 -width=110" + do + pnmpad -reportonly ${pad} ${test1_pbm} || echo "failure" + done + + +echo "Test 3. Should print 0 10 0 0 110 19 eight times" +pgmmake 0.5 100 19 > ${test_pgm} +for pad in "-right=10" \ + "-right=10 -left=0" \ + "-right=10 -width=90" \ + "-right=10 -width=105" \ + "-right=10 -width=110" \ + "-left=0 -width=110" \ + "-halign=0.0 -width=110" \ + "-right=1 -mwidth=11" + do + pnmpad -reportonly ${pad} ${test_pgm} || echo "failure" + done + + +echo "Test 4. Should print 10 10 0 0 120 19 four times" +for pad in "-left=10 -right=10" \ + "-right=10 -width=120" \ + "-halign=0.5 -width=120" \ + "-left=1 -right=1 -mwidth=30" + do + pnmpad -reportonly ${pad} ${test_pgm} || echo "failure" + done + + +echo "Test 5. Should print 0 0 10 0 27 110 seven times" + +pbmmake -w 27 100 > ${test2_pbm} +for pad in "-top=10" \ + "-top=10 -bottom=0" \ + "-top=10 -height=50" \ + "-top=10 -height=101" \ + "-top=10 -height=110" \ + "-bottom=0 -height=110" \ + "-valign=1.0 -height=110" + do + pnmpad -reportonly ${pad} ${test2_pbm} || echo "failure" + done + + +echo "Test 6. Should print 0 0 0 10 19 110 eight times" +ppmmake rgb:33/44/55 19 100 > ${test_ppm} +for pad in "-bottom=10" \ + "-bottom=10 -top=0" \ + "-bottom=10 -height=10" \ + "-bottom=10 -height=107" \ + "-bottom=10 -height=110" \ + "-top=0 -height=110" \ + "-valign=0.0 -height=110" \ + "-bottom=1 -mheight=10" + do + pnmpad -reportonly ${pad} ${test_ppm} || echo "failure" + done + + +echo "Test 7. Should print 0 0 12 12 27 124 four times" +for pad in "-top=12 -bottom=12" \ + "-top=12 -height=124" \ + "-valign=0.5 -height=124" \ + "-top=11 -bottom=11 -mheight=4" + do + pnmpad -reportonly ${pad} ${test2_pbm} || echo "failure" + done + + +echo "Test 8. Should print 5 10 0 0 115 17 seven times" +for pad in "-l 5 -r 10 -w 115" \ + "-l 5 -w 115" \ + " -r 10 -w 115" \ + "-l 5 -r 10 " \ + "-halign 0.333 -w 115 " \ + "-l 2 -r 4 -mw 23" \ + "-halign 0.333 -mw 23" + do + pnmpad -reportonly ${pad} ${test1_pbm} || echo "failure" + done + + +echo "Test 9. Should print 0 0 4 8 19 112 seven times" +for pad in "-t 4 -b 8 -h 112" \ + "-t 4 -h 112" \ + " -b 8 -h 112" \ + "-t 4 -b 8 " \ + "-t 4 -b 8 -mh 14" \ + "-valign 0.333 -mh 14" \ + "-valign 0.333 -h 112" + do + pnmpad -reportonly ${pad} ${test_ppm} || echo "failure" + done + + +rm ${test1_pbm} ${test2_pbm} ${test_pgm} ${test_ppm} diff --git a/test/pnmpaste-pbm.test b/test/pnmpaste-pbm.test index b75797af..70f2b266 100755 --- a/test/pnmpaste-pbm.test +++ b/test/pnmpaste-pbm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmpaste # Also requires: pbmmake diff --git a/test/pnmpsnr.test b/test/pnmpsnr.test index 2de7fc95..3223f86d 100755 --- a/test/pnmpsnr.test +++ b/test/pnmpsnr.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmpsnr # Also requires: pbmmake diff --git a/test/pnmquant.test b/test/pnmquant.test index 24cee077..100fb52e 100755 --- a/test/pnmquant.test +++ b/test/pnmquant.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmquant # Also requires: ppmhist diff --git a/test/pnmquantall.test b/test/pnmquantall.test index 4c1bb77f..fb3beebb 100755 --- a/test/pnmquantall.test +++ b/test/pnmquantall.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmquantall # Also requires: ppmtorgb3 pgmhist pnmcat diff --git a/test/pnmremap1.test b/test/pnmremap1.test index b1cdd6d9..fcd382a7 100755 --- a/test/pnmremap1.test +++ b/test/pnmremap1.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmremap # Also requires: pamseq pamtopnm diff --git a/test/pnmremap2.test b/test/pnmremap2.test index 76c2d566..7eea2c4a 100755 --- a/test/pnmremap2.test +++ b/test/pnmremap2.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmremap # Also requires: pamdepth pamseq pamtopnm diff --git a/test/pnmshear.test b/test/pnmshear.test index a19a9852..42e5c816 100755 --- a/test/pnmshear.test +++ b/test/pnmshear.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmshear # Also requires: pbmmake pnmpad diff --git a/test/pnmtopnm-plain.ok b/test/pnmtopnm-plain.ok index 02d99f1e..640f0964 100644 --- a/test/pnmtopnm-plain.ok +++ b/test/pnmtopnm-plain.ok @@ -1,48 +1,51 @@ +Test. Should print three identical images in plain format, twice each P1 -14 16 -10101010101010 -11111111111111 -10101010101010 -11111111111111 -10101010101010 -11111111111111 -10101010101010 -11111111111111 -10101010101010 -11111111111111 -10101010101010 -11111111111111 -10101010101010 -11111111111111 -10101010101010 -11111111111111 +5 5 +01010 +10101 +01010 +10101 +01010 +P1 +5 5 +01010 +10101 +01010 +10101 +01010 +P2 +8 8 +7 +0 0 1 1 2 2 3 3 +0 1 1 2 2 3 3 4 +1 1 2 2 3 3 4 4 +1 2 2 3 3 4 4 5 +2 2 3 3 4 4 5 5 +2 3 3 4 4 5 5 6 +3 3 4 4 5 5 6 6 +3 4 4 5 5 6 6 7 P2 -14 16 +8 8 +7 +0 0 1 1 2 2 3 3 +0 1 1 2 2 3 3 4 +1 1 2 2 3 3 4 4 +1 2 2 3 3 4 4 5 +2 2 3 3 4 4 5 5 +2 3 3 4 4 5 5 6 +3 3 4 4 5 5 6 6 +3 4 4 5 5 6 6 7 +P3 +4 4 255 -0 255 0 255 0 255 0 255 0 255 0 255 0 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 255 0 255 0 255 0 255 0 255 0 255 0 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 255 0 255 0 255 0 255 0 255 0 255 0 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 255 0 255 0 255 0 255 0 255 0 255 0 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 255 0 255 0 255 0 255 0 255 0 255 0 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 255 0 255 0 255 0 255 0 255 0 255 0 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 255 0 255 0 255 0 255 0 255 0 255 0 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 255 0 255 0 255 0 255 0 255 0 255 0 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 31 255 0 31 255 63 0 0 0 31 255 +0 31 255 0 31 255 0 31 255 63 0 0 +0 31 255 63 0 0 63 0 0 63 0 0 +63 0 0 0 31 255 63 0 0 63 0 0 P3 -14 16 +4 4 255 -0 0 0 255 255 255 0 0 0 255 255 255 0 0 0 255 255 255 0 0 0 255 255 255 -0 0 0 255 255 255 0 0 0 255 255 255 0 0 0 255 255 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 255 255 255 0 0 0 255 255 255 0 0 0 255 255 255 0 0 0 255 255 255 -0 0 0 255 255 255 0 0 0 255 255 255 0 0 0 255 255 255 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 31 255 0 31 255 63 0 0 0 31 255 +0 31 255 0 31 255 0 31 255 63 0 0 +0 31 255 63 0 0 63 0 0 63 0 0 +63 0 0 0 31 255 63 0 0 63 0 0 diff --git a/test/pnmtopnm-plain.test b/test/pnmtopnm-plain.test index 5b7e4b48..87b74064 100755 --- a/test/pnmtopnm-plain.test +++ b/test/pnmtopnm-plain.test @@ -1,10 +1,14 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtopnm -# Also requires: pgmtopgm ppmtoppm +# Also requires: pbmmake pgmramp ppmpat -pamtopnm -plain testgrid.pbm +echo "Test. Should print three identical images in plain format, twice each" -pgmtopgm < testgrid.pbm | pamtopnm -plain +pbmmake -g 5 5 -plain +pbmmake -g 5 5 | pamtopnm -plain -ppmtoppm < testgrid.pbm | pamtopnm -plain | \ - head -n11 +pgmramp -maxval 7 -diag 8 8 -plain +pgmramp -maxval 7 -diag 8 8 | pamtopnm -plain + +ppmpat -g2 -color=rgb:00/1f/ff,rgb:3f/00/00 -mesh 4 4 -plain +ppmpat -g2 -color=rgb:00/1f/ff,rgb:3f/00/00 -mesh 4 4 | pamtopnm -plain diff --git a/test/ppmbrighten.test b/test/ppmbrighten.test index 29ec78fb..e346d1d0 100755 --- a/test/ppmbrighten.test +++ b/test/ppmbrighten.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmbrighten # Also requires: pnmnorm pambrighten pamsumm diff --git a/test/ppmchange-roundtrip.test b/test/ppmchange-roundtrip.test index c1a35078..5bd18150 100755 --- a/test/ppmchange-roundtrip.test +++ b/test/ppmchange-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmchange # Also requires: pgmtopbm pnminvert ppmtopgm diff --git a/test/ppmchange.test b/test/ppmchange.test index a749a5d2..a579631b 100755 --- a/test/ppmchange.test +++ b/test/ppmchange.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmchange # Also requires: ppmrainbow pgmramp ppmhist diff --git a/test/ppmcie.test b/test/ppmcie.test index 0ce69dea..dd7f121f 100755 --- a/test/ppmcie.test +++ b/test/ppmcie.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmcie # Also requires: pamsumm pamsharpness diff --git a/test/ppmdfont.test b/test/ppmdfont.test index 7d894789..e6b461f1 100755 --- a/test/ppmdfont.test +++ b/test/ppmdfont.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmdmkfont ppmddumpfont ppmdcfont # Also requires: diff --git a/test/ppmdim.test b/test/ppmdim.test index 848e2e9f..48d9e891 100755 --- a/test/ppmdim.test +++ b/test/ppmdim.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmdim # Also requires: pamfunc pamarith pamsumm diff --git a/test/ppmdither.test b/test/ppmdither.test index 7e32ef59..f82c34ff 100755 --- a/test/ppmdither.test +++ b/test/ppmdither.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmdither # Also requires: diff --git a/test/ppmforge-parameters.test b/test/ppmforge-parameters.test index efc846a8..83758213 100755 --- a/test/ppmforge-parameters.test +++ b/test/ppmforge-parameters.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmforge # Also requires: pamfile diff --git a/test/ppmforge.test b/test/ppmforge.test index 959eb360..e83ad553 100755 --- a/test/ppmforge.test +++ b/test/ppmforge.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmforge # Also requires: pnmpsnr diff --git a/test/ppmhist.test b/test/ppmhist.test index b5812503..34eb0ea0 100755 --- a/test/ppmhist.test +++ b/test/ppmhist.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmhist # Also requires: pgmramp pamtopnm pbmmake pamseq ppmpat diff --git a/test/ppmmake.test b/test/ppmmake.test index 26b592f7..714573b2 100755 --- a/test/ppmmake.test +++ b/test/ppmmake.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmmake # Also requires: diff --git a/test/ppmmix.test b/test/ppmmix.test index e1c6486b..c3900baf 100755 --- a/test/ppmmix.test +++ b/test/ppmmix.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmmix # Also requires: pamdepth pamenlarge pamsumm pbmmake # Also requires: pgmtopgm pnminvert ppmtopgm diff --git a/test/ppmpat-random.test b/test/ppmpat-random.test index 44dd2485..b1b78d94 100755 --- a/test/ppmpat-random.test +++ b/test/ppmpat-random.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmpat # Also requires: diff --git a/test/ppmpat.test b/test/ppmpat.test index 6e916944..8f00b9f5 100755 --- a/test/ppmpat.test +++ b/test/ppmpat.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmpat # Also requires: diff --git a/test/ppmrelief.test b/test/ppmrelief.test index 3467dcde..c7241663 100755 --- a/test/ppmrelief.test +++ b/test/ppmrelief.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmrelief # Also requires: pbmmake pgmramp pamflip diff --git a/test/ppmrough.test b/test/ppmrough.test index bd4211a3..b10ba941 100755 --- a/test/ppmrough.test +++ b/test/ppmrough.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmrough # Also requires: diff --git a/test/ppmshift.ok b/test/ppmshift.ok index e18de8f0..735ac445 100755 --- a/test/ppmshift.ok +++ b/test/ppmshift.ok @@ -2,13 +2,22 @@ Test 1. Should print: 3705777303 101484 3705777303 101484 Test 2. Should print: 202790723 685 202790723 685 -Test 3. Should print: 0 : 0 -0 : 0 -Test 4. (15) Should print: 0 : 0 -0 : 0 -Test 4. (16) Should print: 0 : 0 -0 : 0 -Test 4. (20) Should print: 0 : 0 -0 : 0 -Test 4. (1000) Should print: 0 : 0 -0 : 0 +Test 3. Should print: 0 0 : 0 +0 0 : 0 +Test 4. Should print: 0 0 : 0 +0 0 : 0 +Test 5. (1) Should print: 1 twice +1 +1 +Test 5. (15) Should print: 1 twice +1 +1 +Test 5. (16) Should print: 1 twice +1 +1 +Test 5. (20) Should print: 1 twice +1 +1 +Test 5. (1000) Should print: 1 twice +1 +1 diff --git a/test/ppmshift.test b/test/ppmshift.test index cd086d68..fff193b3 100755 --- a/test/ppmshift.test +++ b/test/ppmshift.test @@ -1,6 +1,6 @@ #! /bin/bash # This script tests: ppmshift -# Also requires: +# Also requires: pgmtoppm echo "Test 1. Should print: 3705777303 101484" ppmshift -seed=1 10 testimg.ppm | cksum @@ -8,20 +8,35 @@ ppmshift -seed=1 10 testimg.ppm | cksum echo "Test 2. Should print: 202790723 685" ppmshift -seed=1 1 testgrid.pbm | cksum -echo "Test 3. Should print: 0 : 0" -ppmshift -seed=1 0 testimg.ppm | cmp -s - testimg.ppm | \ +echo "Test 3. Should print: 0 0 : 0" +ppmshift -seed=1 0 testimg.ppm | cmp -s - testimg.ppm echo ${PIPESTATUS[@]} ":" $? tmpdir=${tmpdir:-/tmp} -test_pbm=${tmpdir}/test.pbm +test0_ppm=${tmpdir}/test0.ppm +test14_ppm=${tmpdir}/test14.ppm -ppmshift -seed=2 14 testgrid.pbm > ${test_pbm} +pgmtoppm < maze.pbm > ${test0_ppm} -for i in 15 16 20 1000 - do - echo "Test 4. ("$i") Should print: 0 : 0" - ppmshift -seed=2 $i testgrid.pbm > ${test_pbm} | cmp -s - testgrid.ppm | \ +echo "Test 4. Should print: 0 0 : 0" + ppmshift -seed=2 0 maze.pbm | cmp -s - ${test0_ppm} echo ${PIPESTATUS[@]} ":" $? + +ppmshift -seed=2 14 maze.pbm > ${test14_ppm} + +for i in 1 15 16 20 1000 + do + echo "Test 5. ("$i") Should print: 1 twice" + ppmshift -seed=2 $i maze.pbm | cmp -s - ${test0_ppm} + echo $? + ppmshift -seed=2 $i maze.pbm | cmp -s - ${test14_ppm} + echo $? done -rm ${test_pbm} \ No newline at end of file +# In Test 5 the image files are not supposed to match. +# When cmp finds a difference, it may terminate and stop reading input from +# the pipe at that point. This may cause a "broken pipe" exception; however +# this does not always happen. The broken pipe shows up as a non-zero value +# for ${PIPESTATUS[0]}. + +rm ${test0_ppm} ${test14_ppm} diff --git a/test/ppmspread.ok b/test/ppmspread.ok index 7d44ab8e..40f44465 100755 --- a/test/ppmspread.ok +++ b/test/ppmspread.ok @@ -1,6 +1,12 @@ -Test 1. Should print 639729144 101484 +Test 1. +stdin: PPM RAW 227 149 3 255 RGB +stdin: PPM RAW 227 149 3 255 RGB +Test 2. +57 59 +57 59 +Test 3. Should print 281226646 481 +281226646 481 +Test 4. Should print 639729144 101484 639729144 101484 -Test 2. Should print 3278353642 685 +Test 5. Should print 3278353642 685 3278353642 685 -Test 3. Should print 2425386270 41 -2425386270 41 diff --git a/test/ppmspread.test b/test/ppmspread.test index 871f7438..d7e0fb37 100755 --- a/test/ppmspread.test +++ b/test/ppmspread.test @@ -1,12 +1,28 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmspread -# Also requires: ppmtopgm pgmtopbm +# Also requires: pamfile ppmtopgm pgmtopbm -echo "Test 1. Should print 639729144 101484" +# Input/output size does not change + +echo "Test 1." +cat testimg.ppm | pamfile -machine +ppmspread -randomseed=100 20 testimg.ppm | pamfile -machine + +echo "Test 2." +pamfile -size maze.pbm +ppmspread -randomseed=100 20 maze.pbm | pamfile -size + +# No change when spread distance value is 0 + +echo "Test 3. Should print 281226646 481" +ppmspread -randomseed=1 0 maze.pbm | ppmtopgm | pgmtopbm | cksum + +# The following tests will fail when changes are made to the random +# number generator + +echo "Test 4. Should print 639729144 101484" ppmspread -randomseed=1 10 testimg.ppm | cksum -echo "Test 2. Should print 3278353642 685" +echo "Test 5. Should print 3278353642 685" ppmspread -randomseed=1 1 testgrid.pbm | cksum -echo "Test 3. Should print 2425386270 41" -ppmspread -randomseed=1 0 testgrid.pbm | ppmtopgm | pgmtopbm | cksum diff --git a/test/ppmtoapplevol.ok b/test/ppmtoapplevol.ok new file mode 100644 index 00000000..46acda60 --- /dev/null +++ b/test/ppmtoapplevol.ok @@ -0,0 +1,6 @@ +Test: should print 1518149010 3065 +1518149010 3065 +Test Invalid +Expected failure 1 1 +Expected failure 2 1 +Expected failure 3 1 diff --git a/test/ppmtoapplevol.test b/test/ppmtoapplevol.test new file mode 100755 index 00000000..6b109251 --- /dev/null +++ b/test/ppmtoapplevol.test @@ -0,0 +1,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} || \ + echo -n "Expected failure 1" + test -s ${test_out}; echo " "$? + rm -f ${test_out} + +pbmmake 10 13 | ppmtoapplevol > ${test_out} || \ + echo -n "Expected failure 2" + test -s ${test_out}; echo " "$? + rm -f ${test_out} + +pbmmake 256 12 | ppmtoapplevol > ${test_out} || \ + echo -n "Expected failure 3" + test -s ${test_out}; echo " "$? + rm -f ${test_out} diff --git a/test/ppmtoarbtxt-roundtrip.test b/test/ppmtoarbtxt-roundtrip.test index 7c64114e..f63aabe2 100755 --- a/test/ppmtoarbtxt-roundtrip.test +++ b/test/ppmtoarbtxt-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtoarbtxt # Also requires: pnminvert pamtopnm diff --git a/test/ppmtopgm.test b/test/ppmtopgm.test index 8503194b..696b660c 100755 --- a/test/ppmtopgm.test +++ b/test/ppmtopgm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtopgm # Also requires: diff --git a/test/ppmtoppm.test b/test/ppmtoppm.test index 411c17f6..90ff2ddf 100755 --- a/test/ppmtoppm.test +++ b/test/ppmtoppm.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtoppm # Also requires: pbmmake pgmramp diff --git a/test/ppmwheel.test b/test/ppmwheel.test index 150a75e5..fc390f26 100755 --- a/test/ppmwheel.test +++ b/test/ppmwheel.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmwheel # Also requires: diff --git a/test/ps-alt-roundtrip.test b/test/ps-alt-roundtrip.test index 07081d3a..bdecaffd 100755 --- a/test/ps-alt-roundtrip.test +++ b/test/ps-alt-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtoepsi pbmtopsg3 psidtopgm pstopnm # Also requires: gs pnmcrop diff --git a/test/ps-flate-roundtrip.test b/test/ps-flate-roundtrip.test index 888f2856..9fc24ddb 100755 --- a/test/ps-flate-roundtrip.test +++ b/test/ps-flate-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtops pstopnm # Also requires: pamtopnm gs zlib diff --git a/test/ps-roundtrip.test b/test/ps-roundtrip.test index efce4fd6..8b107315 100755 --- a/test/ps-roundtrip.test +++ b/test/ps-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtops pstopnm # Also requires: pamtopnm gs pbmmake pnmshear pnmpad pnmcat diff --git a/test/random-generator.test b/test/random-generator.test index 23dc1903..14b6f11a 100755 --- a/test/random-generator.test +++ b/test/random-generator.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmnoise # Also requires: diff --git a/test/sbig-roundtrip.test b/test/sbig-roundtrip.test index 1fdaccfd..2611fa89 100755 --- a/test/sbig-roundtrip.test +++ b/test/sbig-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmtosbig sbigtopgm # Also requires: pamchannel pamtopnm diff --git a/test/sgi-roundtrip.test b/test/sgi-roundtrip.test index 073755d8..50a9fbc2 100755 --- a/test/sgi-roundtrip.test +++ b/test/sgi-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtosgi sgitopnm # Also requires: rgb3toppm pamdepth pamtopnm pgmtopbm diff --git a/test/st4-roundtrip.test b/test/st4-roundtrip.test index ffe8f348..f2e15078 100755 --- a/test/st4-roundtrip.test +++ b/test/st4-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmtost4 st4topgm # Also requires: pamchannel pamtopnm pamcut diff --git a/test/stdin-pam1.ok b/test/stdin-pam1.ok new file mode 100644 index 00000000..31f24b3d --- /dev/null +++ b/test/stdin-pam1.ok @@ -0,0 +1,41 @@ +pamaddnoise -seed=1: 0 0 0 0 +pamaltsat -strength=1: 0 0 0 0 +pambackground: 0 0 0 0 +pambayer -type=2: 0 0 0 0 +pambrighten: 0 0 0 0 +pamcut: 0 0 0 0 +pamdeinterlace: 0 0 0 0 +pamdepth 15: 0 0 0 0 +pamditherbw -threshold: 0 0 0 0 +pamedge: 0 0 0 0 +pamexec cat: 0 0 0 0 +pamfile -size: 0 0 0 0 +pamfind -target=1: 0 0 0 0 +pamfix: 0 0 0 0 +pamflip -lr: 0 0 0 0 +pamfunc -not: 0 0 0 0 +pamhomography -from 0,0,0,1,1,0,1,1: 0 0 0 0 +pamhue -huechange=60: 0 0 0 0 +pamlevels -f1 rgb:0/0/0 -t1 rgb:0/0/0 -f2 rgb:ff/ff/ff -t2 rgb:ff/ff/ff: 0 0 0 0 +pammixinterlace: 0 0 0 0 +pammosaicknit: 0 0 0 0 +pamoil: 0 0 0 0 +pamperspective 0 0 0 1 1 0 1 1: 0 0 0 0 +pamrecolor: 0 0 0 0 +pamrubber -quad 1 1 2 2: 0 0 0 0 +pamscale 2: 0 0 0 0 +pamshadedrelief: 0 0 0 0 +pamsharpness: 0 0 0 0 +pamsistoaglyph: 0 0 0 0 +pamslice -row=1: 0 0 0 0 +pamstack: 0 0 0 0 +pamstereogram -randomseed=1: 0 0 0 0 +pamstretch 1: 0 0 0 0 +pamstretch-gen 1: 0 0 0 0 +pamsumm -max: 0 0 0 0 +pamsummcol -mean: 0 0 0 0 +pamtable: 0 0 0 0 +pamthreshold: 0 0 0 0 +pamtilt: 0 0 0 0 +pamtopnm: 0 0 0 0 +pamwipeout -tb: 0 0 0 0 diff --git a/test/stdin-pam1.test b/test/stdin-pam1.test new file mode 100755 index 00000000..68d0d34c --- /dev/null +++ b/test/stdin-pam1.test @@ -0,0 +1,72 @@ +#! /bin/bash +# This script tests: pamaddnoise pamaltsat pambackground pambayer +# This script tests: pambrighten pamcut pamdeinterlace pamdepth pamditherbw +# This script tests: pamedge pamexec pamfile pamfind pamfix pamflip +# This script tests: pamfunc pamhomography pamhue pamlevels +# This script tests: pammixinterlace pammosaicknit pamoil +# This script tests: pamperspective pamrecolor pamrubber pamscale +# This script tests: pamshadedrelief pamsharpness pamsistoaglyph +# This script tests: pamslice pamstack pamstereogram pamstretch +# This script tests: pamstretch-gen pamsumm pamsummcol pamtable pamthreshold +# This script tests: pamtilt pamtopnm pamwipeout +# Also requires: pbmmake + +tmpdir=${tmpdir:-/tmp} +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +small_pbm=${tmpdir}/small.pbm + +pbmmake -g 5 5 > ${small_pbm} + +for testprog in \ + "pamaddnoise -seed=1" \ + "pamaltsat -strength=1" \ + pambackground \ + "pambayer -type=2" \ + pambrighten \ + pamcut \ + pamdeinterlace \ + "pamdepth 15" \ + "pamditherbw -threshold" \ + pamedge \ + "pamexec cat" \ + "pamfile -size" \ + "pamfind -target=1" \ + pamfix \ + "pamflip -lr" \ + "pamfunc -not" \ + "pamhomography -from 0,0,0,1,1,0,1,1" \ + "pamhue -huechange=60" \ + "pamlevels -f1 rgb:0/0/0 -t1 rgb:0/0/0 -f2 rgb:ff/ff/ff -t2 rgb:ff/ff/ff" \ + pammixinterlace \ + pammosaicknit \ + pamoil \ + "pamperspective 0 0 0 1 1 0 1 1" \ + pamrecolor \ + "pamrubber -quad 1 1 2 2" \ + "pamscale 2" \ + pamshadedrelief \ + pamsharpness \ + pamsistoaglyph \ + "pamslice -row=1" \ + pamstack \ + "pamstereogram -randomseed=1" \ + "pamstretch 1" \ + "pamstretch-gen 1" \ + "pamsumm -max" \ + "pamsummcol -mean" \ + pamtable \ + pamthreshold \ + pamtilt \ + pamtopnm \ + "pamwipeout -tb" + do + ${testprog} ${small_pbm} > ${out1}; status1=$? + ${testprog} < ${small_pbm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} + done + +rm ${small_pbm} diff --git a/test/stdin-pam2.ok b/test/stdin-pam2.ok new file mode 100644 index 00000000..dd3148e8 --- /dev/null +++ b/test/stdin-pam2.ok @@ -0,0 +1,5 @@ +pammasksharpen: 0 0 0 0 +pammixmulti: 0 0 0 0 +pamdice: 0 0 0 0 +pamlookup: 0 0 0 0 +pamunlookup: 0 0 0 0 diff --git a/test/stdin-pam2.test b/test/stdin-pam2.test new file mode 100755 index 00000000..f47df604 --- /dev/null +++ b/test/stdin-pam2.test @@ -0,0 +1,70 @@ +#! /bin/bash +# This script tests: pammasksharpen pammixmulti pamdice +# This script tests: pamlookup pamunlookup +# Also requires: pbmmake + +tmpdir=${tmpdir:-/tmp} +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 +small_pbm=${tmpdir}/small.pbm + +pbmmake -g 3 3 > ${small_pbm} + +for testprog in \ + pammasksharpen \ + pammixmulti + do + ${testprog} ${small_pbm} ${small_pbm} > ${out1}; status1=$? + ${testprog} ${small_pbm} < ${small_pbm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} +done + + + dicestem=${tmpdir}/dice + + testprog="pamdice -outstem=${dicestem}" + ${testprog} ${small_pbm}; status1=$? + cat ${dicestem}_*_*.pbm > ${out1} + rm ${dicestem}_*_*.pbm + ${testprog} < ${small_pbm}; status2=$? + cat ${dicestem}_*_*.pbm > ${out2} + rm ${dicestem}_*_*.pbm + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo pamdice: ${status1} ${status2} ${status3} $? + # Do not use testprog, which contains a variable, in the above + # Same for pamlookup, pamunlookup + rm ${out1} ${out2} + +lookup_ppm=${tmpdir}/lookup.ppm + +cat > ${lookup_ppm} <<EOF +P3 +2 1 +2 +0 0 0 +0 1 2 +EOF + + testprog="pamlookup -lookupfile=${lookup_ppm}" + ${testprog} ${small_pbm} > ${out1}; status1=$? + ${testprog} < ${small_pbm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo pamlookup": "${status1} ${status2} ${status3} $? + rm ${out2} + + testprog="pamunlookup -lookupfile=${lookup_ppm}" + ${testprog} ${out1} > ${out3}; status1=$? + ${testprog} < ${out1} > ${out4}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out3} ${out4} + echo pamunlookup": "${status1} ${status2} ${status3} $? + rm ${out1} ${out3} ${out4} + +rm ${lookup_ppm} ${small_pbm} diff --git a/test/stdin-pam3.ok b/test/stdin-pam3.ok new file mode 100644 index 00000000..0ec9cf5d --- /dev/null +++ b/test/stdin-pam3.ok @@ -0,0 +1,32 @@ +Test. Should print (command): 0 0 0 0 +The following are exceptions: should print (command): 0 0 0 1 +pamtotga, pamtotiff + +pamtoavs: 0 0 0 0 +avstopam: 0 0 0 0 +pamtohdiff: 0 0 0 0 +hdifftopam: 0 0 0 0 +pamtojpeg2k: 0 0 0 0 +jpeg2ktopam: 0 0 0 0 +pamtopdbimg -fixedtime: 0 0 0 0 +pdbimgtopam: 0 0 0 0 +pamtopfm: 0 0 0 0 +pfmtopam: 0 0 0 0 +pamtopng: 0 0 0 0 +pngtopam: 0 0 0 0 +pamtosrf: 0 0 0 0 +srftopam: 0 0 0 0 +pamtosvg: 0 0 0 0 +svgtopam: 0 0 0 0 +pamtowinicon: 0 0 0 0 +winicontopam: 0 0 0 0 +pamtotga: 0 0 0 1 +tgatoppm: 0 0 0 0 +pamtoxvmini: 0 0 0 0 +xvminitoppm: 0 0 0 0 +pamtofits: 0 0 0 0 +fitstopnm: 0 0 0 0 +pamtogif: 0 0 0 0 +giftopnm: 0 0 0 0 +pamtotiff: 0 0 0 1 +tifftopnm: 0 0 0 0 diff --git a/test/stdin-pam3.test b/test/stdin-pam3.test new file mode 100755 index 00000000..169bb5cd --- /dev/null +++ b/test/stdin-pam3.test @@ -0,0 +1,73 @@ +#! /bin/sh +# This script tests: pamtoavs avstopam +# This script tests: pamtohdiff hdifftopam +# This script tests: pamtojpeg2k jpeg2ktopam +# This script tests: pamtopdbimg pdbimgtopam +# This script tests: pamtopfm pfmtopam +# This script tests: pamtopng pngtopam +# This script tests: pamtosrf srftopam +# This script tests: pamtosvg svgtopam +# This script tests: pamtowinicon winicontopam +# This script tests: pamtotga tgatoppm +# This script tests: pamtoxvmini xvminitoppm +# This script tests: pamtofits fitstopnm +# This script tests: pamtogif giftopnm +# This script tests: pamtotiff tifftopnm +# Also requires: pgmmake + +tmpdir=${tmpdir:-/tmp} +test_pgm=${tmpdir}/test.ppm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 + +pgmmake -maxval 3 0.25 32 32 > ${test_pgm} + +echo "Test. Should print (command): 0 0 0 0" +echo "The following are exceptions: should print (command): 0 0 0 1" +echo "pamtotga, pamtotiff" +echo + +for fmt in \ + avs \ + hdiff \ + jpeg2k \ + pdbimg \ + pfm \ + png \ + srf \ + svg \ + winicon \ + tga \ + xvmini \ + fits \ + gif \ + tiff + do + + if [ ${fmt} = pdbimg ] + then testprog1="pamtopdbimg -fixedtime"; + else testprog1="pamto"${fmt}; + fi + + case $fmt in + "tga" | "xvmini") testprog2=${fmt}"toppm";; + "fits" | "gif" | "tiff") testprog2=${fmt}"topnm";; + *) testprog2=${fmt}"topam"; + esac + + ${testprog1} ${test_pgm} > ${out1}; status1=$? + ${testprog1} < ${test_pgm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog1}": "${status1} ${status2} ${status3} $? + + ${testprog2} ${out1} > ${out3}; status4=$? + ${testprog2} < ${out1} > ${out4}; status5=$? + test -s ${out3}; status6=$? + cmp -s ${out3} ${out4} + echo ${testprog2}": "${status4} ${status5} ${status6} $? + done + +rm ${test_pgm} diff --git a/test/stdin-pbm1.ok b/test/stdin-pbm1.ok new file mode 100644 index 00000000..0dd83466 --- /dev/null +++ b/test/stdin-pbm1.ok @@ -0,0 +1,9 @@ +pbmclean: 0 0 0 0 +pbmlife: 0 0 0 0 +pbmmask: 0 0 0 0 +pbmminkowski: 0 0 0 0 +pbmtoepsi: 0 0 0 0 +pbmtopsg3: 0 0 0 0 +pbmpscale 1 : 0 0 0 0 +pbmreduce -threshold 2 : 0 0 0 0 +pbmtopgm 2 2 : 0 0 0 0 diff --git a/test/stdin-pbm1.test b/test/stdin-pbm1.test new file mode 100755 index 00000000..4e99ba0b --- /dev/null +++ b/test/stdin-pbm1.test @@ -0,0 +1,45 @@ +#! /bin/sh +# This script tests: pbmclean pbmlife pbmmask pbmminkowski pbmtoepsi +# This script tests: pbmtopsg3 pbmpscale pbmreduce pbmtopgm +# Also requires: pbmmake + +# Tests whether output is unchanged when +# (1) input is a named file: pbm-command input-file +# (2) input is from stdin: pbm-command < input-file + +tmpdir=${tmpdir:-/tmp} +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 +small_pbm=${tmpdir}/small.pbm + +pbmmake -b 3 3 > ${small_pbm} + +for testprog in \ + pbmclean \ + pbmlife \ + pbmmask \ + pbmminkowski \ + pbmtoepsi \ + pbmtopsg3 \ + "pbmpscale 1 " \ + "pbmreduce -threshold 2 " \ + "pbmtopgm 2 2 " + do + ${testprog} ${small_pbm} > ${out1}; status1=$? + ${testprog} < ${small_pbm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} + done + +rm ${small_pbm} + +# For Pbm converters not tested here see pbm-misc-converters.test + +# These programs do not have a converter in the opposite direction: +# Brushtopbm +# Ddbugtopbm +# Thinkjettopbm (?) diff --git a/test/stdin-pbm2.ok b/test/stdin-pbm2.ok new file mode 100644 index 00000000..c77f7b13 --- /dev/null +++ b/test/stdin-pbm2.ok @@ -0,0 +1,28 @@ +pbmtoatk: 0 0 0 0 +atktopbm: 0 0 0 0 +pbmtocis: 0 0 0 0 +cistopbm: 0 0 0 0 +pbmtocmuwm: 0 0 0 0 +cmuwmtopbm: 0 0 0 0 +pbmtoescp2: 0 0 0 0 +escp2topbm: 0 0 0 0 +pbmtog3: 0 0 0 0 +g3topbm: 0 0 0 0 +pbmtogem: 0 0 0 0 +gemtopnm: 0 0 0 0 +pbmtomacp: 0 0 0 0 +macptopbm: 0 0 0 0 +pbmtomda: 0 0 0 0 +mdatopbm: 0 0 0 0 +pbmtomgr: 0 0 0 0 +mgrtopbm: 0 0 0 0 +pbmtomrf: 0 0 0 0 +mrftopbm: 0 0 0 0 +pbmtopi3: 0 0 0 0 +pi3topbm: 0 0 0 0 +pbmtosunicon: 0 0 0 0 +sunicontopnm: 0 0 0 0 +pbmtowbmp: 0 0 0 0 +wbmptopbm: 0 0 0 0 +pbmtoybm: 0 0 0 0 +ybmtopbm: 0 0 0 0 diff --git a/test/stdin-pbm2.test b/test/stdin-pbm2.test new file mode 100755 index 00000000..724a9934 --- /dev/null +++ b/test/stdin-pbm2.test @@ -0,0 +1,78 @@ +#! /bin/sh +# This script tests: atktopbm pbmtoatk +# This script tests: cistopbm pbmtocis +# This script tests: cmuwmtopbm pbmtocmuwm +# This script tests: escp2topbm pbmtoescp2 +# This script tests: g3topbm pbmtog3 +# This script tests: gemtopbm pbmtogem +# This script tests: macptopbm pbmtomacp +# This script tests: mdatopbm pbmtomda +# This script tests: mgrtopbm pbmtomgr +# This script tests: mrftopbm pbmtomrf +# This script tests: pi3topbm pbmtopi3 +# This script tests: sunicontopbm pbmtosunicon +# This script tests: wbmptopbm pbmtowbmp +# This script tests: ybmtopbm pbmtoybm +# Also requires: + +tmpdir=${tmpdir:-/tmp} +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 + +for fmt in \ + atk \ + cis \ + cmuwm \ + escp2 \ + g3 \ + gem \ + macp \ + mda \ + mgr \ + mrf \ + pi3 \ + sunicon \ + wbmp \ + ybm + do + testprog1="pbmto"${fmt} + + if [ ${fmt} = "sunicon" -o ${fmt} = "gem" ]; + then testprog2=${fmt}"topnm"; + else testprog2=${fmt}"topbm"; + fi + + ${testprog1} testgrid.pbm > ${out1}; status1=$? + ${testprog1} < testgrid.pbm > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog1}": "${status1} ${status2} ${status3} $? + rm ${out2} + + ${testprog2} ${out1} > ${out3}; status3=$? + ${testprog2} < ${out1} > ${out4}; status4=$? + + if [ ${fmt} = "xbm" ]; + then sed -i '3s/noname/testgrid/' ${out3}; + fi + + test -s ${out3}; status5=$? + cmp -s ${out3} ${out4} + echo ${testprog2}": "${status3} ${status4} ${status5} $? + rm ${out1} ${out3} ${out4} + done + +# We don't test Pbmtopgm Pgmtopbm Asciitopbm Asciitopgm here + +# Pbmtopk Pktopbm require resolution output pk file, tk file +# some conditions apply to input image dimensions + +# These three programs embed the input file name in the output +# If the input is from stdin, "noname" +# Pbmtolps tested in lps-roundtrip.test +# Pbmtoxbm xbm-roundtrip.test +# Pbmtozinc pbm-misc-converters.test + +# Icontopbm Pbmtoicon Pbmtox10bm are legacy diff --git a/test/stdin-pgm1.ok b/test/stdin-pgm1.ok new file mode 100644 index 00000000..b3159517 --- /dev/null +++ b/test/stdin-pgm1.ok @@ -0,0 +1,11 @@ +pgmabel: 0 0 0 0 +pgmbentley: 0 0 0 0 +pgmdeshadow: 0 0 0 0 +pgmenhance: 0 0 0 0 +pgmhist: 0 0 0 0 +pgmmedian: 0 0 0 0 +pgmminkowski: 0 0 0 0 +pgmtexture: 0 0 0 0 +pgmtopbm -th : 0 0 0 0 +pgmtoppm rgb:00/00/00 : 0 0 0 0 +rawtopgm -headerskip 11 3 3 : 0 0 0 0 diff --git a/test/stdin-pgm1.test b/test/stdin-pgm1.test new file mode 100755 index 00000000..f5980cdc --- /dev/null +++ b/test/stdin-pgm1.test @@ -0,0 +1,47 @@ +#! /bin/sh +# This script tests: pgmabel pgmbentley pgmdeshadow pgmenhance pgmhist +# This script tests: pgmmedian pgmminkowski pgmtexture pgmtopbm pgmtoppm +# This script tests: rawtopgm +# Also requires: pgmmake + +tmpdir=${tmpdir:-/tmp} +small_pgm=${tmpdir}/small.pgm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 + +pgmmake 0.5 3 3 > ${small_pgm} + +for testprog in \ + pgmabel \ + pgmbentley \ + pgmdeshadow \ + pgmenhance \ + pgmhist \ + pgmmedian \ + pgmminkowski \ + pgmtexture \ + "pgmtopbm -th " \ + "pgmtoppm rgb:00/00/00 " \ + "rawtopgm -headerskip 11 3 3 " + do + ${testprog} ${small_pgm} > ${out1}; status1=$? + ${testprog} < ${small_pgm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} + done + +rm ${small_pgm} + + +# Pgmtopgm accepts input only from stdin + +# These three programs are legacy +# Pgmedge +# Pgmnorm +# Pgmoil + +# Pgmmorphconv needs template file diff --git a/test/stdin-pgm2.ok b/test/stdin-pgm2.ok new file mode 100644 index 00000000..ee6d8082 --- /dev/null +++ b/test/stdin-pgm2.ok @@ -0,0 +1,6 @@ +pgmtofs : 0 0 0 0 +fstopgm : 0 0 0 0 +pgmtolispm : 0 0 0 0 +lispmtopgm : 0 0 0 0 +pgmtost4 : 0 0 0 0 +st4topgm : 0 0 0 0 diff --git a/test/stdin-pgm2.test b/test/stdin-pgm2.test new file mode 100755 index 00000000..3a6220d8 --- /dev/null +++ b/test/stdin-pgm2.test @@ -0,0 +1,49 @@ +#! /bin/sh +# This script tests: pgmtofs fstopgm +# This script tests: pgmtolispm lispmtopgm +# This script tests: pgmtost4 st4topgm +# Also requires: pgmmake + +tmpdir=${tmpdir:-/tmp} +test_pgm=${tmpdir}/test.pgm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 + +pgmmake 0.75 192 165 > ${test_pgm} + +for fmt in \ + fs \ + lispm \ + st4 + do + testprog1="pgmto"${fmt} + testprog2=${fmt}"topgm" + + ${testprog1} ${test_pgm} > ${out1}; status1=$? + ${testprog1} < ${test_pgm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog1}" :" ${status1} ${status2} ${status3} $? + rm ${out2} + + ${testprog2} ${out1} > ${out3}; status4=$? + ${testprog2} < ${out1} > ${out4}; status5=$? + test -s ${out3}; status6=$? + cmp -s ${out3} ${out4} + echo ${testprog2}" :" ${status4} ${status5} ${status6} $? + + rm ${out1} ${out3} ${out4} + done + +rm ${test_pgm} + +# pgmtost4 size must be 192 x 165 + +# The following programs do not have converters in the opposite direction: +# Bioradtopgm +# Hipstopgm +# Psidtopgm +# Rawtopgm +# Spottopgm diff --git a/test/stdin-pnm1.ok b/test/stdin-pnm1.ok new file mode 100644 index 00000000..0a63558c --- /dev/null +++ b/test/stdin-pnm1.ok @@ -0,0 +1,23 @@ +pnmalias: 0 0 0 0 +pnmcat -lr : 0 0 0 0 +pnmcolormap all : 0 0 0 0 +pnmconvol -matrix=-1,3,-1 : 0 0 0 0 +pnmcrop: 0 0 0 0 +pnmgamma -ungamma 0.5 : 0 0 0 0 +pnmhisteq: 0 0 0 0 +pnmhistmap: 0 0 0 0 +pnminvert: 0 0 0 0 +pnmmargin 2 : 0 0 0 0 +pnmmercator: 0 0 0 0 +pnmmontage: 0 0 0 0 +pnmnlfilt 0.5 0.5 : 0 0 0 0 +pnmnorm: 0 0 0 0 +pnmpad: 0 0 0 0 +pnmquant 64 : 0 0 0 0 +pnmrotate 90 : 0 0 0 0 +pnmscalefixed 1 : 0 0 0 0 +pnmshear 45 : 0 0 0 0 +pnmsmooth: 0 0 0 0 +pnmtile 4 4 : 0 0 0 0 +pnmtoddif: 0 0 0 0 +pnmtopclxl -colorok : 0 0 0 0 diff --git a/test/stdin-pnm1.test b/test/stdin-pnm1.test new file mode 100755 index 00000000..e692ceba --- /dev/null +++ b/test/stdin-pnm1.test @@ -0,0 +1,60 @@ +#! /bin/sh +# This script tests: pnmalias pnmcat pnmcolormap pnmconvol pnmcrop pnmgamma +# This script tests: pnmhisteq pnmhistmap pnminvert pnmmargin pnmmercator +# This script tests: pnmmontage pnmnlfilt pnmnorm pnmpad pnmquant pnmrotate +# This script tests: pnmscalefixed pnmshear pnmsmooth pnmtile pnmtoddif +# This script tests: pnmtopclxl +# Also requires: ppmpat pamflip + +tmpdir=${tmpdir:-/tmp} +small_ppm=${tmpdir}/test.ppm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 + +ppmpat -g2 -color=rgb:00/00/ff,rgb:ff/00/00 -mesh 4 4 > ${small_ppm} + +for testprog in \ + pnmalias \ + "pnmcat -lr " \ + "pnmcolormap all " \ + "pnmconvol -matrix=-1,3,-1 " \ + pnmcrop \ + "pnmgamma -ungamma 0.5 " \ + pnmhisteq \ + pnmhistmap \ + pnminvert \ + "pnmmargin 2 " \ + pnmmercator \ + pnmmontage \ + "pnmnlfilt 0.5 0.5 " \ + pnmnorm \ + pnmpad \ + "pnmquant 64 " \ + "pnmrotate 90 " \ + "pnmscalefixed 1 " \ + "pnmshear 45 " \ + pnmsmooth \ + "pnmtile 4 4 " \ + pnmtoddif \ + "pnmtopclxl -colorok " + do + ${testprog} ${small_ppm} > ${out1}; status1=$? + ${testprog} < ${small_ppm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} + done + + +rm ${small_ppm} + +# Pnmquantall: overwrites input files +# Pnmremap: requires -mapfile=file +# Pnmpsnr : compares two input files +# Pnmindex: no input from stdin +# Pnmpaste: requires two input files +# Pnmstitch: requires two input files + +# pnmmargin: uses pamflip +# pnmsmooth: uses pnmconvol \ No newline at end of file diff --git a/test/stdin-pnm2.ok b/test/stdin-pnm2.ok new file mode 100644 index 00000000..093ff3f7 --- /dev/null +++ b/test/stdin-pnm2.ok @@ -0,0 +1,28 @@ +Test. Should print (command): 0 0 0 +The following are exceptions: should print (command): 0 0 0 1 +pnmtops, pstopnm, pnmtoxwd, pnmtotiffcmyk + +pnmtofiasco --progress-meter 0 : 0 0 0 0 +fiascotopnm: 0 0 0 0 +pnmtojbig: 0 0 0 0 +jbigtopnm: 0 0 0 0 +pnmtojpeg: 0 0 0 0 +jpegtopnm: 0 0 0 0 +pnmtopalm: 0 0 0 0 +palmtopnm: 0 0 0 0 +pnmtopng: 0 0 0 0 +pngtopam: 0 0 0 0 +pnmtops: 0 0 0 1 +pstopnm -stdout : 0 0 0 1 +pnmtorast: 0 0 0 0 +rasttopnm: 0 0 0 0 +pnmtorle: 0 0 0 0 +rletopnm: 0 0 0 0 +pnmtosgi: 0 0 0 0 +sgitopnm: 0 0 0 0 +pnmtosir: 0 0 0 0 +sirtopnm: 0 0 0 0 +pnmtoxwd: 0 0 0 1 +xwdtopnm: 0 0 0 0 +pnmtotiffcmyk: 0 0 0 1 +tifftopnm: 0 0 0 0 diff --git a/test/stdin-pnm2.test b/test/stdin-pnm2.test new file mode 100755 index 00000000..7622c279 --- /dev/null +++ b/test/stdin-pnm2.test @@ -0,0 +1,91 @@ +#! /bin/sh +# This script tests: pnmtofiasco fiascotopnm +# This script tests: pnmtojbig jbigtopnm +# This script tests: pnmtojpeg jpegtopnm +# This script tests: pnmtopalm palmtopnm +# This script tests: pnmtopng pngtopam +# This script tests: pnmtops pstopnm +# This script tests: pnmtorast rasttopnm +# This script tests: pnmtorle rletopnm +# This script tests: pnmtosgi sgitopnm +# This script tests: pnmtosir sirtopnm +# This script tests: pnmtoxwd xwdtopnm +# This script tests: pnmtotiffcmyk tifftopnm +# Also requires: pgmramp + +tmpdir=${tmpdir:-/tmp} +test_pgm=${tmpdir}/test.pgm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 + +pgmramp -diag 32 32 > ${test_pgm} + +echo "Test. Should print (command): 0 0 0" +echo "The following are exceptions: should print (command): 0 0 0 1" +echo "pnmtops, pstopnm, pnmtoxwd, pnmtotiffcmyk" +echo + +export NO_ADD_RLE_HISTORY=1 +# Suppress command-line sequence, execution time in pnmtorle header + +for fmt in \ + fiasco \ + jbig \ + jpeg \ + palm \ + png \ + ps \ + rast \ + rle \ + sgi \ + sir \ + xwd \ + tiffcmyk + do + + if [ ${fmt} = "fiasco" ] + then testprog1="pnmto"${fmt}" --progress-meter 0 "; + else + testprog1="pnmto"${fmt}; + fi + + if [ ${fmt} = "png" ] + then testprog2="pngtopam"; + elif [ ${fmt} = "ps" ] + then testprog2="pstopnm -stdout "; + elif [ ${fmt} = "tiffcmyk" ] + then testprog2="tifftopnm"; + else + testprog2=${fmt}"topnm"; + fi + + ${testprog1} ${test_pgm} > ${out1}; status1=$? + ${testprog1} < ${test_pgm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog1}": "${status1} ${status2} ${status3} $? + rm ${out2} + + ${testprog2} ${out1} > ${out3}; status4=$? + ${testprog2} < ${out1} > ${out4}; status5=$? + test -s ${out3}; status6=$? + cmp -s ${out3} ${out4} + echo ${testprog2}": "${status4} ${status5} ${status6} $? + rm ${out1} ${out3} ${out4} + + done + +rm ${test_pgm} + + +# pnmtofiasco width, height must be even and at least 32 +# use --progressmeter option to suppress progress meter +# +# pnmtojbig input must be bilevel black-white or gray +# pnmtops input file name embedded in output +# pnmtotiffcmyk input file name embedded in output +# "Standard input" if from stdin +# pnmtoxwd input file name embedded in output +# "stdin" if from stdin diff --git a/test/stdin-ppm1.ok b/test/stdin-ppm1.ok new file mode 100644 index 00000000..e84a31ea --- /dev/null +++ b/test/stdin-ppm1.ok @@ -0,0 +1,15 @@ +ppmchange: 0 0 0 0 +ppmcolormask -color=rgb:0/0/ff : 0 0 0 0 +ppmdim 0.5 : 0 0 0 0 +ppmdist: 0 0 0 0 +ppmdither: 0 0 0 0 +ppmflash 0.5 : 0 0 0 0 +ppmglobe 12 : 0 0 0 0 +ppmhist: 0 0 0 0 +ppmlabel: 0 0 0 0 +ppmntsc: 0 0 0 0 +ppmrelief: 0 0 0 0 +ppmshadow: 0 0 0 0 +ppmshift 2 -seed=1 : 0 0 0 0 +ppmspread 2 -randomseed=1 : 0 0 0 0 +ppmtv 0.5 : 0 0 0 0 diff --git a/test/stdin-ppm1.test b/test/stdin-ppm1.test new file mode 100755 index 00000000..84614326 --- /dev/null +++ b/test/stdin-ppm1.test @@ -0,0 +1,58 @@ +#! /bin/sh +# This script tests: ppmchange ppmcolormask ppmdim ppmdist ppmdither ppmflash +# This script tests: ppmglobe ppmhist ppmlabel ppmntsc ppmrelief ppmshadow +# This script tests: ppmshift ppmspread ppmtv +# Also requires: ppmpat + +tmpdir=${tmpdir:-/tmp} +test_ppm=${tmpdir}/test.ppm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 + +ppmpat -g2 -color=rgb:00/00/ff,rgb:ff/00/00 -mesh 12 12 > ${test_ppm} + +for testprog in \ + ppmchange \ + "ppmcolormask -color=rgb:0/0/ff " \ + "ppmdim 0.5 " \ + ppmdist \ + ppmdither \ + "ppmflash 0.5 " \ + "ppmglobe 12 " \ + ppmhist \ + ppmlabel \ + ppmntsc \ + ppmrelief \ + ppmshadow \ + "ppmshift 2 -seed=1 " \ + "ppmspread 2 -randomseed=1 " \ + "ppmtv 0.5 " + do + ${testprog} ${test_ppm} > ${out1}; status1=$? + ${testprog} < ${test_ppm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} + done + +rm ${test_ppm} + +# These utlities do not have a counterpart "ppmto*" program + +# Gouldtoppm +# Imgtoppm +# Mtvtoppm +# Pc1toppm +# Pgmtoppm +# Qrttoppm +# Rawtoppm +# Sldtoppm +# Spctoppm +# Ximtoppm + +# Tgatoppm -> Pamtotga +# Xvminitoppm -> Pamtoxvmini + +# Ppm3d and Ppmmix require input two files +# Ppmfade produces a series of output files diff --git a/test/stdin-ppm2.ok b/test/stdin-ppm2.ok new file mode 100644 index 00000000..e3fb4219 --- /dev/null +++ b/test/stdin-ppm2.ok @@ -0,0 +1,11 @@ +ppmtoacad: 0 0 0 0 +ppmtoapplevol: 0 0 0 0 +ppmtoascii: 0 0 0 0 +ppmtolj: 0 0 0 0 +ppmtomitsu: 0 0 0 0 +ppmtopgm: 0 0 0 0 +ppmtopuzz: 0 0 0 0 +ppmtosixel: 0 0 0 0 +ppmtoterm: 0 0 0 0 +ppmtoicr: 0 0 0 0 +ppmtoyuvsplit: 0 0 0 0 diff --git a/test/stdin-ppm2.test b/test/stdin-ppm2.test new file mode 100755 index 00000000..81b3954e --- /dev/null +++ b/test/stdin-ppm2.test @@ -0,0 +1,68 @@ +#! /bin/sh +# This script tests: ppmtoacad ppmtoapplevol ppmtoascii ppmtolj ppmtomitsu +# This script tests: ppmtopgm ppmtopuzz ppmtosixel ppmtoterm +# This script tests: ppmtoicr ppmtoyuvsplit +# Also requires: ppmpat + +tmpdir=${tmpdir:-/tmp} +test_ppm=${tmpdir}/test.ppm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 + +ppmpat -g2 -color=rgb:00/00/ff,rgb:ff/00/00 -mesh 12 12 > ${test_ppm} + +# These converters do not have counterparts in the reverse direction + +for testprog in \ + ppmtoacad \ + ppmtoapplevol \ + ppmtoascii \ + ppmtolj \ + ppmtomitsu \ + ppmtopgm \ + ppmtopuzz \ + ppmtosixel \ + ppmtoterm + do + ${testprog} ${test_ppm} > ${out1}; status1=$? + ${testprog} < ${test_ppm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} + done + +rm ${test_ppm} + +testprog=ppmtoicr + +# File name embedded in output; "untitled" if no name + + ${testprog} testgrid.pbm > ${out1}; status1=$? + ${testprog} < testgrid.pbm > ${out2}; status2=$? + test -s ${out1}; status3=$? + sed 's/untitled/testgrid.pbm/g' ${out2} | cmp -s ${out1} - + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} + +testprog=ppmtoyuvsplit + +# Produces three output files + + ${testprog} ${tmpdir}/base testgrid.pbm; status1=$? + cat ${tmpdir}/base.Y ${tmpdir}/base.U ${tmpdir}/base.V > ${out1} + rm ${tmpdir}/base.Y ${tmpdir}/base.U ${tmpdir}/base.V + + ${testprog} ${tmpdir}/base < testgrid.pbm; status2=$? + cat ${tmpdir}/base.Y ${tmpdir}/base.U ${tmpdir}/base.V > ${out2} + rm ${tmpdir}/base.Y ${tmpdir}/base.U ${tmpdir}/base.V + test -s ${out1}; status3=$? + cmp -s ${out1} ${out2} + echo ${testprog}": "${status1} ${status2} ${status3} $? + rm ${out1} ${out2} + +# Ppmtoppm input is from standard input + +# Ppmtoapplevol height must be 12 +# Ppmtoarbtxt needs body template file +# Ppmtompeg parameter file must be given diff --git a/test/stdin-ppm3.ok b/test/stdin-ppm3.ok new file mode 100644 index 00000000..f7ba5623 --- /dev/null +++ b/test/stdin-ppm3.ok @@ -0,0 +1,20 @@ +ppmtobmp: 0 0 0 0 +bmptopnm: 0 0 0 0 +ppmtoilbm: 0 0 0 0 +ilbmtoppm: 0 0 0 0 +ppmtoleaf: 0 0 0 0 +leaftoppm: 0 0 0 0 +ppmtoneo: 0 0 0 0 +neotoppm: 0 0 0 0 +ppmtopcx: 0 0 0 0 +pcxtoppm: 0 0 0 0 +ppmtopi1: 0 0 0 0 +pi1toppm: 0 0 0 0 +ppmtopict: 0 0 0 0 +picttoppm: 0 0 0 0 +ppmtopj: 0 0 0 0 +pjtoppm: 0 0 0 0 +ppmtospu: 0 0 0 0 +sputoppm: 0 0 0 0 +ppmtoxpm: 0 0 0 0 +xpmtoppm: 0 0 0 0 diff --git a/test/stdin-ppm3.test b/test/stdin-ppm3.test new file mode 100755 index 00000000..605b535b --- /dev/null +++ b/test/stdin-ppm3.test @@ -0,0 +1,77 @@ +#! /bin/sh +# This script tests: ppmtobmp bmptopnm +# This script tests: ppmtoilbm ilbmtoppm +# This script tests: ppmtoleaf leaftoppm +# This script tests: ppmtoneo neotoppm +# This script tests: ppmtopcx pcxtoppm +# This script tests: ppmtopi1 pi1toppm +# This script tests: ppmtopict picttoppm +# This script tests: ppmtopj pjtoppm +# This script tests: ppmtospu sputoppm +# This script tests: ppmtoxpm xpmtoppm +# Also requires: ppmmake + +tmpdir=${tmpdir:-/tmp} +small_ppm=${tmpdir}/small.ppm +large_ppm=${tmpdir}/large.ppm +out1=${tmpdir}/out1 +out2=${tmpdir}/out2 +out3=${tmpdir}/out3 +out4=${tmpdir}/out4 + +ppmmake -maxval 65535 rgb:00/00/00 8 3 > ${small_ppm} +ppmmake -maxval 7 rgb:00/00/00 320 200 > ${large_ppm} + +for fmt in \ + bmp \ + ilbm \ + leaf \ + neo \ + pcx \ + pi1 \ + pict \ + pj \ + spu \ + xpm + do + testprog1="ppmto"${fmt} + if [ ${fmt} = "bmp" ] + then testprog2=${fmt}"topnm"; + else testprog2=${fmt}"toppm"; + fi + + if [ ${fmt} = "spu" ] + then test_ppm=${large_ppm}; + else test_ppm=${small_ppm}; + fi + + ${testprog1} ${test_ppm} > ${out1}; status1=$? + ${testprog1} < ${test_ppm} > ${out2}; status2=$? + test -s ${out1}; status3=$? + if [ ${fmt} = "xpm" ] + then + sed -i '/^static char/s/static char .* = {/static char file/' \ + ${out1} ${out2}; + fi + cmp -s ${out1} ${out2} + echo ${testprog1}": "${status1} ${status2} ${status3} $? + rm ${out2} + + ${testprog2} ${out1} > ${out3}; status4=$? + ${testprog2} < ${out1} > ${out4}; status5=$? + test -s ${out1}; status6=$? + cmp -s ${out3} ${out4} + echo ${testprog2}": "${status4} ${status5} ${status6} $? + rm ${out1} ${out3} ${out4} + done + +rm ${small_ppm} ${large_ppm} + +# ppmtopict width must be 8 or more + +# ppmtospu sputoppm width=320 height=200 fixed + +# Eyuvtoppm, Yuvtoppm width, height are mandatory + +# Ppmtowinicon Winicontoppm legacy +# Winicontoppm max size 255 255 diff --git a/test/sunicon-roundtrip.test b/test/sunicon-roundtrip.test index c5b85909..38513ea8 100755 --- a/test/sunicon-roundtrip.test +++ b/test/sunicon-roundtrip.test @@ -1,27 +1,26 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtosunicon sunicontopnm -# Also requires: pamcut pnmpad +# Also requires: pbmnoise -# Width of Sun icons are multiples of 8. - -#imgsize=$(pamfile -size maze.pbm | awk '{print "-width="$1, "-height="$2}') +# Width of a Sun icon is always a multiple of 8. tmpdir=${tmpdir:-/tmp} -maze16_pbm=${tmpdir}/maze16.pbm -maze32_pbm=${tmpdir}/maze32.pbm -maze64_pbm=${tmpdir}/maze64.pbm - -pamcut -top=0 -left=0 -width=16 -height=16 maze.pbm > ${maze16_pbm} -pamcut -top=0 -left=0 -width=32 -height=32 maze.pbm > ${maze32_pbm} -pnmpad -width=64 -height=64 maze.pbm > ${maze64_pbm} +noise16_pbm=${tmpdir}/noise16.pbm +noise32_pbm=${tmpdir}/noise32.pbm +noise64_pbm=${tmpdir}/noise64.pbm echo "Test. Should print 0 three times" -pbmtosunicon ${maze16_pbm} | sunicontopnm | cmp -s - ${maze16_pbm} -echo $? -pbmtosunicon ${maze32_pbm} | sunicontopnm | cmp -s - ${maze32_pbm} -echo $? -pbmtosunicon ${maze64_pbm} | sunicontopnm | cmp -s - ${maze64_pbm} -echo $? +pbmnoise -randomseed=1 16 16 > ${noise16_pbm} && \ + pbmtosunicon ${noise16_pbm} | sunicontopnm | cmp -s - ${noise16_pbm} + echo $? + +pbmnoise -randomseed=1 32 32 > ${noise32_pbm} && \ + pbmtosunicon ${noise32_pbm} | sunicontopnm | cmp -s - ${noise32_pbm} + echo $? + +pbmnoise -randomseed=1 64 64 > ${noise64_pbm} && \ + pbmtosunicon ${noise64_pbm} | sunicontopnm | cmp -s - ${noise64_pbm} + echo $? -rm ${maze16_pbm} ${maze32_pbm} ${maze64_pbm} \ No newline at end of file +rm ${noise16_pbm} ${noise32_pbm} ${noise64_pbm} \ No newline at end of file diff --git a/test/sunrast-roundtrip.test b/test/sunrast-roundtrip.test index a5cfa8c7..dfe68402 100755 --- a/test/sunrast-roundtrip.test +++ b/test/sunrast-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtorast rasttopnm # Also requires: diff --git a/test/symmetry.ok b/test/symmetry.ok index a5945014..111f09cf 100644 --- a/test/symmetry.ok +++ b/test/symmetry.ok @@ -1,5 +1,8 @@ +Test 1. ok +Test 2. ok +Test 3. Should print ok 7 times ok ok ok @@ -7,7 +10,9 @@ ok ok ok ok +Test 4. ok +Test 5. Should print ok 7 times. ok ok ok @@ -15,4 +20,5 @@ ok ok ok ok +Test 6. ok diff --git a/test/symmetry.test b/test/symmetry.test index 52ba6388..3c495778 100755 --- a/test/symmetry.test +++ b/test/symmetry.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pgmramp pamgauss pgmkernel pbmmake pbmpscale # Also requires: pamflip @@ -25,7 +25,7 @@ tmpdir=${tmpdir:-/tmp} -# Test 1. +echo "Test 1." rect_pgm=${tmpdir}/rect.pgm pgmramp -rect 31 31 > ${rect_pgm} @@ -37,7 +37,8 @@ pgmramp -rect 31 31 > ${rect_pgm} rm ${rect_pgm} -# Test 2. + +echo "Test 2." circle_pgm=${tmpdir}/circle.pgm pgmramp -ell 63 63 > ${circle_pgm} @@ -48,7 +49,8 @@ pgmramp -ell 63 63 > ${circle_pgm} rm ${circle_pgm} -# Test 3. Should print "ok" 7 times + +echo "Test 3. Should print ok 7 times" gauss_pgm=${tmpdir}/gauss.pgm for size in 3 4 5 8 13 21 25 do @@ -63,7 +65,7 @@ rm ${gauss_pgm} done -# Test 4. +echo "Test 4." kernel_pgm=${tmpdir}/kernel.pgm pgmkernel 15 15 > ${kernel_pgm} @@ -74,12 +76,12 @@ pgmkernel 15 15 > ${kernel_pgm} rm ${kernel_pgm} -# Test 5. -# Should print "ok" 7 times. + +echo "Test 5. Should print ok 7 times." pscale_pbm=${tmpdir}/pscale.pbm -for size in `seq 1 7` -do -pbmmake -g 5 5 | pbmpscale $size > ${pscale_pbm} +for size in 1 2 3 4 5 6 7 # for size in `seq 7` + do + pbmmake -g 5 5 | pbmpscale ${size} > ${pscale_pbm} ( for op in -null -tb -lr -r90 do pamflip $op ${pscale_pbm} | cksum @@ -89,7 +91,8 @@ pbmmake -g 5 5 | pbmpscale $size > ${pscale_pbm} rm ${pscale_pbm} done -# Test 6. + +echo "Test 6." ell_pgm=${tmpdir}/ell.pgm pgmramp -ell 101 33 > ${ell_pgm} diff --git a/test/tiff-flate-lzw-roundtrip.test b/test/tiff-flate-lzw-roundtrip.test index f62c6767..2b0a4536 100755 --- a/test/tiff-flate-lzw-roundtrip.test +++ b/test/tiff-flate-lzw-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtotiff tifftopnm # Also requires: ppmpat diff --git a/test/tiff-roundtrip.test b/test/tiff-roundtrip.test index b4169319..c33ee904 100755 --- a/test/tiff-roundtrip.test +++ b/test/tiff-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtotiff tifftopnm # Also requires: ppmpat pampick ppmtopgm diff --git a/test/tiffcmyk-roundtrip.test b/test/tiffcmyk-roundtrip.test index 133c81b7..ebbc5666 100755 --- a/test/tiffcmyk-roundtrip.test +++ b/test/tiffcmyk-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtotiffcmyk tifftopnm # Also requires: pnmpsnr diff --git a/test/utahrle-roundtrip.test b/test/utahrle-roundtrip.test index 17f1a6c4..4dce0b40 100755 --- a/test/utahrle-roundtrip.test +++ b/test/utahrle-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtorle rletopnm # Also requires: pamchannel pamtopnm diff --git a/test/wbmp-roundtrip.test b/test/wbmp-roundtrip.test index 6197032c..cf747487 100755 --- a/test/wbmp-roundtrip.test +++ b/test/wbmp-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtowbmp wbmptopbm # Also requires: diff --git a/test/winicon-roundtrip.test b/test/winicon-roundtrip.test index b4814fee..0acadd53 100755 --- a/test/winicon-roundtrip.test +++ b/test/winicon-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtowinicon ppmtowinicon winicontopam # Also requires: pamchannel pamcut pamdepth pamtopam diff --git a/test/winicon-roundtrip2.test b/test/winicon-roundtrip2.test index d1f29cc9..eae4ce90 100755 --- a/test/winicon-roundtrip2.test +++ b/test/winicon-roundtrip2.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtowinicon winicontopam # Also requires: pamchannel pamdepth pamstack pamtopam pbmmake ppmpat diff --git a/test/xbm-roundtrip.test b/test/xbm-roundtrip.test index 3f06e9a5..a8754150 100755 --- a/test/xbm-roundtrip.test +++ b/test/xbm-roundtrip.test @@ -1,8 +1,8 @@ -#! /bin/bash +#! /bin/sh # This script tests: pbmtoxbm xbmtopbm # Also requires: echo "Test. Should print 281226646 481 twice" pbmtoxbm maze.pbm | xbmtopbm | cksum -pbmtoxbm -x10 maze.pbm | xbmtopbm | cksum +pbmtoxbm -x10 < maze.pbm | xbmtopbm | cksum diff --git a/test/xpm-roundtrip.test b/test/xpm-roundtrip.test index 61a5192d..6e3e415b 100755 --- a/test/xpm-roundtrip.test +++ b/test/xpm-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtoxpm xpmtoppm # Also requires: pgmtopbm ppmtopgm diff --git a/test/xv-roundtrip.test b/test/xv-roundtrip.test index d73933a1..70b298df 100755 --- a/test/xv-roundtrip.test +++ b/test/xv-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pamtoxvmini xvminitoppm # Also requires: pamdepth diff --git a/test/xwd-roundtrip.test b/test/xwd-roundtrip.test index 4dffbbb0..2d00971d 100755 --- a/test/xwd-roundtrip.test +++ b/test/xwd-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: pnmtoxwd xwdtopnm # Also requires: pamchannel pamtopnm pamdepth diff --git a/test/yuv-roundtrip.test b/test/yuv-roundtrip.test index e339b418..68f459e8 100755 --- a/test/yuv-roundtrip.test +++ b/test/yuv-roundtrip.test @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # This script tests: ppmtoyuv yuvtoppm # Also requires: pamgradient |