diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-05-31 14:13:14 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-05-31 14:13:14 +0000 |
commit | 577a72dcb88b48d77c787ccf21e663a2a4072383 (patch) | |
tree | 8512158f216603da34d57235d3681006f6672e9f /test | |
parent | 0fa2352db4da3d7fc9ed344e618e040a74d3eece (diff) | |
download | netpbm-mirror-577a72dcb88b48d77c787ccf21e663a2a4072383.tar.gz netpbm-mirror-577a72dcb88b48d77c787ccf21e663a2a4072383.tar.xz netpbm-mirror-577a72dcb88b48d77c787ccf21e663a2a4072383.zip |
Add tests for pamrestack, pamshuffle; rename testimg.ppm work file; correct errors in 'also requires' entries
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4347 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test')
-rw-r--r-- | test/Test-Order | 2 | ||||
-rw-r--r-- | test/all-in-place.ok | 2 | ||||
-rwxr-xr-x | test/all-in-place.test | 2 | ||||
-rwxr-xr-x | test/channel-stack-roundtrip.test | 4 | ||||
-rwxr-xr-x | test/gif-roundtrip.test | 64 | ||||
-rwxr-xr-x | test/pamflip-pbm-roundtrip.test | 2 | ||||
-rwxr-xr-x | test/pamhue.test | 4 | ||||
-rwxr-xr-x | test/pamrecolor.test | 2 | ||||
-rw-r--r-- | test/pamrestack.ok | 68 | ||||
-rwxr-xr-x | test/pamrestack.test | 91 | ||||
-rwxr-xr-x | test/pamscale-filters1.test | 2 | ||||
-rwxr-xr-x | test/pamscale-filters2.test | 2 | ||||
-rwxr-xr-x | test/pamscale-filters3.test | 2 | ||||
-rwxr-xr-x | test/pamshuffle.ok | 19 | ||||
-rwxr-xr-x | test/pamshuffle.test | 67 | ||||
-rwxr-xr-x | test/pcx-roundtrip.test | 3 | ||||
-rwxr-xr-x | test/pdb-roundtrip.test | 2 | ||||
-rwxr-xr-x | test/pnmquantall.test | 30 | ||||
-rwxr-xr-x | test/rgb3-roundtrip.test | 18 | ||||
-rwxr-xr-x | test/stdin-pam3.test | 2 | ||||
-rwxr-xr-x | test/stdin-pbm2.test | 4 | ||||
-rwxr-xr-x | test/winicon-roundtrip.test | 1 | ||||
-rwxr-xr-x | test/winicon-roundtrip2.test | 1 |
23 files changed, 323 insertions, 71 deletions
diff --git a/test/Test-Order b/test/Test-Order index dd89a91c..eafcb974 100644 --- a/test/Test-Order +++ b/test/Test-Order @@ -83,6 +83,8 @@ pambackground.test pnmpad-reportonly.test pnmpaste-pbm.test +pamrestack.test +pamshuffle.test ppmshift.test ppmspread.test diff --git a/test/all-in-place.ok b/test/all-in-place.ok index 21f7f225..0af78737 100644 --- a/test/all-in-place.ok +++ b/test/all-in-place.ok @@ -109,6 +109,7 @@ pamtopdbimg: ok pamtopfm: ok pamtopng: ok pamtopnm: ok +pamtoqoi: ok pamtosrf: ok pamtosvg: ok pamtotga: ok @@ -302,6 +303,7 @@ ppmtv: ok ppmwheel: ok psidtopgm: ok pstopnm: ok +qoitopam: ok qrttoppm: ok rasttopnm: ok rawtopgm: ok diff --git a/test/all-in-place.test b/test/all-in-place.test index 41bd1774..c2b99328 100755 --- a/test/all-in-place.test +++ b/test/all-in-place.test @@ -151,6 +151,7 @@ ordinary_testprogs="\ pamtopfm \ pamtopng \ pamtopnm \ + pamtoqoi \ pamtosrf \ pamtosvg \ pamtotga \ @@ -344,6 +345,7 @@ ordinary_testprogs="\ ppmwheel \ psidtopgm \ pstopnm \ + qoitopam \ qrttoppm \ rasttopnm \ rawtopgm \ diff --git a/test/channel-stack-roundtrip.test b/test/channel-stack-roundtrip.test index a640b98d..14ac0d2e 100755 --- a/test/channel-stack-roundtrip.test +++ b/test/channel-stack-roundtrip.test @@ -1,6 +1,6 @@ #! /bin/sh -# This script tests: pamchanel pamstack -# Also requires: pamtopam pamstack pamtopnm +# This script tests: pamchannel pamstack +# Also requires: pamtopam pamtopnm tmpdir=${tmpdir:-/tmp} r_pam=${tmpdir}/testimg_r.pam diff --git a/test/gif-roundtrip.test b/test/gif-roundtrip.test index 2bc3a98d..a30be1aa 100755 --- a/test/gif-roundtrip.test +++ b/test/gif-roundtrip.test @@ -10,40 +10,40 @@ tmpdir=${tmpdir:-/tmp} echo "Test 1. Should print 1926073387 101484" -test_ppm=${tmpdir}/testimg.ppm +rose_ppm=${tmpdir}/rose.ppm -cp testimg.ppm ${tmpdir} && -ppmtorgb3 ${test_ppm} +cp testimg.ppm ${rose_ppm} && +ppmtorgb3 ${rose_ppm} -test_red=${tmpdir}/testimg.red -test_grn=${tmpdir}/testimg.grn -test_blu=${tmpdir}/testimg.blu +rose_red=${tmpdir}/rose.red +rose_grn=${tmpdir}/rose.grn +rose_blu=${tmpdir}/rose.blu out_red=${tmpdir}/out.red out_grn=${tmpdir}/out.grn #out_blu=${tmpdir}/out.blu -pamtogif ${test_red} | giftopnm > ${out_red} && -pamtogif ${test_grn} | giftopnm > ${out_grn} && -pamtogif ${test_blu} | giftopnm | \ +pamtogif ${rose_red} | giftopnm > ${out_red} && +pamtogif ${rose_grn} | giftopnm > ${out_grn} && +pamtogif ${rose_blu} | giftopnm | \ rgb3toppm ${out_red} ${out_grn} - | \ cksum -rm ${test_ppm} ${test_grn} ${test_blu} ${out_red} ${out_grn} +rm ${rose_ppm} ${rose_grn} ${rose_blu} ${out_red} ${out_grn} echo "Test 2. Should produce 1571496937 33838 six times" -test_gif=${tmpdir}/testimg.gif +rose_gif=${tmpdir}/rose.gif -cat ${test_red} | cksum -pamtogif ${test_red} | giftopnm | cksum -pamtogif -interlace ${test_red} | giftopnm | cksum -pamtogif -noclear ${test_red} | giftopnm | cksum -pamtogif -sort ${test_red} | tee ${test_gif} | \ +cat ${rose_red} | cksum +pamtogif ${rose_red} | giftopnm | cksum +pamtogif -interlace ${rose_red} | giftopnm | cksum +pamtogif -noclear ${rose_red} | giftopnm | cksum +pamtogif -sort ${rose_red} | tee ${rose_gif} | \ giftopnm | cksum -echo "junk" >> ${test_gif} && \ - giftopnm -image=1 -quitearly ${test_gif} | cksum +echo "junk" >> ${rose_gif} && \ + giftopnm -image=1 -quitearly ${rose_gif} | cksum -rm ${test_gif} ${test_red} +rm ${rose_gif} ${rose_red} echo "Test 3. Should produce 281226646 481 six times" # maze.pbm is too small for -noclear to take effect @@ -78,7 +78,7 @@ echo "" echo "Test 5. Should produce: N : 0 0 0 0 : 0 , N : 0 0 0 0 : 0" echo "(N=238, 239, 240, 241, 255, 256, 257, 4030, 4031, 4097)" -test_pgm=${tmpdir}/testimg.pgm +rose_pgm=${tmpdir}/rose.pgm # The following awk scripts produce a PGM file with no repeated # sequences. Obviously this cannot be compressed at all; the codes @@ -114,14 +114,14 @@ awk -v maxval=${maxval} 'BEGIN \ for size in 238 239 240 241 255 256 257 do - pamcut -height=${size} ${test257_pgm} > ${test_pgm} && - pamtogif -verbose ${test_pgm} | giftopnm | pamdepth ${maxval} | \ - cmp - ${test_pgm} + pamcut -height=${size} ${test257_pgm} > ${rose_pgm} && + pamtogif -verbose ${rose_pgm} | giftopnm | pamdepth ${maxval} | \ + cmp - ${rose_pgm} echo -n ${size} ":" ${PIPESTATUS[@]} ":" $? ", " - pamtogif -nolzw -verbose ${test_pgm} | giftopnm | pamdepth ${maxval} | \ - cmp - ${test_pgm} + pamtogif -nolzw -verbose ${rose_pgm} | giftopnm | pamdepth ${maxval} | \ + cmp - ${rose_pgm} echo ${size} ":" ${PIPESTATUS[@]} ":" $? - rm ${test_pgm} + rm ${rose_pgm} done rm ${test257_pgm} @@ -144,16 +144,16 @@ awk -v maxval=${maxval} 'BEGIN \ for size in 4030 4031 4097 do - pamcut -height ${size} ${test4097_pgm} > ${test_pgm} && - pamtogif -verbose ${test_pgm} | giftopnm | pamdepth ${maxval} | \ - cmp - ${test_pgm} + pamcut -height ${size} ${test4097_pgm} > ${rose_pgm} && + pamtogif -verbose ${rose_pgm} | giftopnm | pamdepth ${maxval} | \ + cmp - ${rose_pgm} # pamdepth ${maxval} is necessary because # giftopnm output is maxval 255 echo -n ${size} ":" ${PIPESTATUS[@]} ":" $? ", " - pamtogif -nolzw ${test_pgm} | giftopnm | pamdepth ${maxval} | \ - cmp - ${test_pgm} + pamtogif -nolzw ${rose_pgm} | giftopnm | pamdepth ${maxval} | \ + cmp - ${rose_pgm} echo ${size} ":" ${PIPESTATUS[@]} ":" $? - rm ${test_pgm} + rm ${rose_pgm} done rm ${test4097_pgm} diff --git a/test/pamflip-pbm-roundtrip.test b/test/pamflip-pbm-roundtrip.test index 71f2e926..02a342cb 100755 --- a/test/pamflip-pbm-roundtrip.test +++ b/test/pamflip-pbm-roundtrip.test @@ -1,6 +1,6 @@ #! /bin/sh # This script tests: pamflip -# Also requires: ppmpat pamseq pamtopnm +# Also requires: pbmmake pbmnoise tmpdir=${tmpdir:-/tmp} dot_pbm=${tmpdir}/dot.pbm diff --git a/test/pamhue.test b/test/pamhue.test index 622fdf2f..cd5430a8 100755 --- a/test/pamhue.test +++ b/test/pamhue.test @@ -16,7 +16,7 @@ pamseq -tupletype=RGB 3 1 | pamdepth 255 | pamhue -huechange=60 | \ echo "Test 3" # pamhue has no effect on monotone images -# Should print 281226646 481 twice +# Should print 0 0 : 0 twice pamhue -huechange=45 maze.pbm | cmp -s - maze.pbm echo ${PIPESTATUS[@]} ":" $? @@ -25,7 +25,7 @@ pamhue -huechange=180 maze.pbm | cmp -s - maze.pbm echo "Test 4" # spinning the color wheel by multiples of 360 leaves the image unchanged -# Should print 1926073387 101484 twice +# Should print 0 0 : 0 twice pamhue -huechange=0 testimg.ppm | cmp -s - testimg.ppm echo ${PIPESTATUS[@]} ":" $? diff --git a/test/pamrecolor.test b/test/pamrecolor.test index 6f323169..0ba35b66 100755 --- a/test/pamrecolor.test +++ b/test/pamrecolor.test @@ -1,6 +1,6 @@ #! /bin/sh # This script tests: pamrecolor -# Also requires: ppmtopgm pgmmake +# Also requires: pgmmake tmpdir=${tmpdir:-/tmp} base_pgm=${tmpdir}/base.pgm diff --git a/test/pamrestack.ok b/test/pamrestack.ok new file mode 100644 index 00000000..07552913 --- /dev/null +++ b/test/pamrestack.ok @@ -0,0 +1,68 @@ +Test 1. +P2 +24 1 +7 +0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +P2 +10 3 +7 +0 1 2 3 4 5 6 7 0 1 +2 3 4 5 6 7 0 1 2 3 +4 5 6 7 0 0 0 0 0 0 +P2 +10 2 +7 +0 1 2 3 4 5 6 7 0 1 +2 3 4 5 6 7 0 1 2 3 +P2 +4 6 +7 +0 1 2 3 +4 5 6 7 +0 1 2 3 +4 5 6 7 +0 1 2 3 +4 5 6 7 +P2 +12 2 +7 +0 1 2 3 4 5 6 7 0 1 2 3 +4 5 6 7 0 1 2 3 4 5 6 7 +Test 2. Should print 0 twelve times +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +Test 3. Should produce 3141273448 431 fifteen times +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +3141273448 431 +Test 4. Should produce 1768948962 101484 twice +1768948962 101484 +1768948962 101484 +Test Invalid. +Expected failure 1 1 +Expected failure 2 1 +Expected failure 3 1 +Expected failure 4 1 +Expected failure 5 1 diff --git a/test/pamrestack.test b/test/pamrestack.test new file mode 100755 index 00000000..17e42e30 --- /dev/null +++ b/test/pamrestack.test @@ -0,0 +1,91 @@ +#! /bin/sh +# This script tests: pamrestack +# Also requires: pamfile pamflip pgmramp pnmcrop pnminvert + +tmpdir=${tmpdir:-/tmp} +ramp_pgm=${tmpdir}/ramp.pgm +ramp2_pgm=${tmpdir}/ramp2.pgm +maze_singlerow_pbm=${tmpdir}/maze_singlerow.pbm +maze_inverted_pbm=${tmpdir}/maze_inverted.pbm + +echo "Test 1." + +pgmramp -lr -maxval=7 8 3 | tee ${ramp_pgm} | pamrestack -plain +pamrestack -width=10 -trim=fill -plain ${ramp_pgm} +pamrestack -width=10 -trim=crop -plain ${ramp_pgm} +pamrestack -width=4 -trim=fill -plain ${ramp_pgm} +pamrestack -width=12 -trim=fill -plain ${ramp_pgm} + +echo "Test 2. Should print 0 twelve times" + +for width in 2 4 5 8 12 24 +do + pamrestack -width=${width} -trim=crop ${ramp_pgm} > ${ramp2_pgm} + for flag in "-trim=crop" "-trim=fill" + do + pamrestack -width=${width} ${flag} ${ramp2_pgm} | cmp -s - ${ramp2_pgm} + echo $? + done +done + +rm ${ramp_pgm} ${ramp2_pgm} + +echo "Test 3. Should produce 3141273448 431 fifteen times" + +# Invert maze.pbm because the lower right corner is black + +pixels=`pamfile -size maze.pbm | awk '{print $1 * $2}'` + +pnminvert maze.pbm | tee ${maze_inverted_pbm} | \ + pamrestack | tee ${maze_singlerow_pbm} | pnmcrop -right -black | cksum +for width in 1 2 3 100 1000 ${pixels} $((pixels -1)) +do +pamrestack -width=${width} ${maze_inverted_pbm} | pamrestack | \ + pnmcrop -right -black | cksum +pamrestack -width=${width} ${maze_singlerow_pbm} | \ + pamrestack | pnmcrop -right -black | cksum +done + +rm ${maze_inverted_pbm} ${maze_singlerow_pbm} + +echo "Test 4. Should produce 1768948962 101484 twice" + +pamrestack -width=1 testimg.ppm | pamflip -ccw | cksum +pamrestack \ + -width=`pamfile -size testimg.ppm | cut -d " " -f2` testimg.ppm | \ + pamrestack | cksum + +test_out=${tmpdir}/test_out +echo "Test Invalid." + +echo 1>&2 +echo "Invalid command-line argument combinations." 1>&2 +echo "Error messages should appear below the line." 1>&2 +echo "-----------------------------------------------------------" 1>&2 + +pamrestack testgrid.pbm maze.pbm > ${test_out} || \ + echo -n "Expected failure 1" + test -s ${test_out}; echo " "$? + rm -f ${test_out} + +pamrestack -abort \ + -width=$((pixels * 2 + 1 )) maze.pbm > ${test_out} || \ + echo -n "Expected failure 2" + test -s ${test_out}; echo " "$? + rm -f ${test_out} + +pamrestack -crop \ + -width=$((pixels * 2 + 1)) maze.pbm > ${test_out} || \ + echo -n "Expected failure 3" + test -s ${test_out}; echo " "$? + rm -f ${test_out} + +pamrestack -width=0 maze.pbm > ${test_out} || \ + echo -n "Expected failure 4" + test -s ${test_out}; echo " "$? + rm -f ${test_out} + +pamrestack -width maze.pbm > ${test_out} || \ + echo -n "Expected failure 5" + test -s ${test_out}; echo " "$? + rm -f ${test_out} diff --git a/test/pamscale-filters1.test b/test/pamscale-filters1.test index 575355c6..c81dcf9a 100755 --- a/test/pamscale-filters1.test +++ b/test/pamscale-filters1.test @@ -1,6 +1,6 @@ #! /bin/bash # This script tests: pamscale pamenlarge -# Also requires: pamvalidate pnmpsnr +# Also requires: pamfile pamvalidate pnmpsnr tmpdir=${tmpdir:-/tmp} enlarge_ppm=${tmpdir}/enlarge.ppm diff --git a/test/pamscale-filters2.test b/test/pamscale-filters2.test index 764488c5..d3cb8d6c 100755 --- a/test/pamscale-filters2.test +++ b/test/pamscale-filters2.test @@ -1,6 +1,6 @@ #! /bin/bash # This script tests: pamscale pamstretch pamstretch-gen -# Also requires: pamvalidate pnmpsnr +# Also requires: pamfile pamvalidate pnmpsnr tmpdir=${tmpdir:-/tmp} stretch_ppm=${tmpdir}/stretch.ppm diff --git a/test/pamscale-filters3.test b/test/pamscale-filters3.test index 23e79373..8d20e690 100755 --- a/test/pamscale-filters3.test +++ b/test/pamscale-filters3.test @@ -1,6 +1,6 @@ #! /bin/bash # This script tests: pamscale pamstretch pamstretch-gen -# Also requires: pamvalidate pnmpsnr +# Also requires: pamfile pamvalidate pnmpsnr tmpdir=${tmpdir:-/tmp} stretch_ppm=${tmpdir}/stretch.ppm diff --git a/test/pamshuffle.ok b/test/pamshuffle.ok new file mode 100755 index 00000000..4f829744 --- /dev/null +++ b/test/pamshuffle.ok @@ -0,0 +1,19 @@ +Test 1. Should print 1081361896 1432 five times +1081361896 1432 +1081361896 1432 +1081361896 1432 +1081361896 1432 +1081361896 1432 +Test 2. Should print 1936883899 143517 four times +1936883899 143517 +1936883899 143517 +1936883899 143517 +1936883899 143517 +Test 3. Should print nomatch three times +nomatch +nomatch +nomatch +Test Invalid. +Expected failure 1 1 +Expected failure 2 1 +Expected failure 3 1 diff --git a/test/pamshuffle.test b/test/pamshuffle.test new file mode 100755 index 00000000..5582ce3b --- /dev/null +++ b/test/pamshuffle.test @@ -0,0 +1,67 @@ +#! /bin/sh +# This script tests: pamshuffle +# Also requires: pamseq pamrestack pgmhist ppmhist pnmpsnr + +tmpdir=${tmpdir:-/tmp} +seq_pam=${tmpdir}/seq.pam +seq16_pam=${tmpdir}/seq16.pam + +out1_pam=${tmpdir}/out1.pam + +echo "Test 1. Should print 1081361896 1432 five times" + +pgmhist -machine maze.pbm | cksum +pamshuffle -randomseed=1 maze.pbm | pgmhist -machine | cksum +pamshuffle -randomseed=2 maze.pbm | pgmhist -machine | cksum +pamshuffle -column -randomseed=3 maze.pbm | pgmhist -machine | cksum +pamrestack maze.pbm | pamshuffle -randomseed=3 | pgmhist -machine | cksum + +echo "Test 2. Should print 1936883899 143517 four times" + +pamseq -tupletype="RGB" 3 15 > ${seq_pam} + +ppmhist -map ${seq_pam} | cksum +pamshuffle -randomseed=2 ${seq_pam} | ppmhist -map | cksum +pamrestack -width=16 -trim=abort ${seq_pam} | tee ${seq16_pam} | \ + ppmhist -map | cksum +pamshuffle -column -randomseed=3 ${seq16_pam} | ppmhist -map | cksum + +echo "Test 3. Should print nomatch three times" + +pamshuffle -randomseed=$((100 +i)) ${seq16_pam} > ${out1_pam} +pamshuffle -randomseed=${i} ${seq16_pam} | \ +pnmpsnr -target=14.0 ${out1_pam} - +rm ${seq_pam} ${seq16_pam} ${out1_pam} + +pamshuffle -randomseed=$((100 +i)) testimg.ppm > ${out1_pam} +pamshuffle -randomseed=${i} testimg.ppm | \ + pnmpsnr -target=14.0 ${out1_pam} - +rm ${out1_pam} + +pamshuffle -randomseed=$((100 +i)) -column testimg.ppm > ${out1_pam} +pamshuffle -randomseed=${i} -column testimg.ppm | \ + pnmpsnr -target=14.0 ${out1_pam} - +rm ${out1_pam} + +test_out=${tmpdir}/test_out +echo "Test Invalid." + +echo 1>&2 +echo "Invalid command-line argument combinations." 1>&2 +echo "Error messages should appear below the line." 1>&2 +echo "-----------------------------------------------------------" 1>&2 + +pamshuffle testimg.ppm testgrid.pbm > ${test_out} || \ + echo -n "Expected failure 1" + test -s ${test_out}; echo " "$? + rm -f ${test_out} + +pamshuffle -randomseed -column testgrid.pbm > ${test_out} || \ + echo -n "Expected failure 2" + test -s ${test_out}; echo " "$? + rm -f ${test_out} + +pamshuffle -randomseed=null testgrid.pbm > ${test_out} || \ + echo -n "Expected failure 3" + test -s ${test_out}; echo " "$? + rm -f ${test_out} diff --git a/test/pcx-roundtrip.test b/test/pcx-roundtrip.test index 3a78faba..194af131 100755 --- a/test/pcx-roundtrip.test +++ b/test/pcx-roundtrip.test @@ -1,7 +1,6 @@ #! /bin/sh # This script tests: ppmtopcx pcxtoppm -# Also requires: pnmremap - +# Also requires: pgmtoppm pnmremap tmpdir=${tmpdir:-/tmp} pcxstd_ppm=${tmpdir}/pcxstd_ppm diff --git a/test/pdb-roundtrip.test b/test/pdb-roundtrip.test index c31a63e1..f56be1bf 100755 --- a/test/pdb-roundtrip.test +++ b/test/pdb-roundtrip.test @@ -1,6 +1,6 @@ #! /bin/bash # This script tests: pamtopdbimg pdbimgtopam -# Also requires: pnmtile pgmramp pamtopnm pamdepth +# Also requires: pbmnoise pgmramp pamtopnm pamdepth tmpdir=${tmpdir:-/tmp} noise_pbm=${tmpdir}/noise.pbm diff --git a/test/pnmquantall.test b/test/pnmquantall.test index fb3beebb..f3594c0f 100755 --- a/test/pnmquantall.test +++ b/test/pnmquantall.test @@ -3,45 +3,45 @@ # Also requires: ppmtorgb3 pgmhist pnmcat tmpdir=${tmpdir:-/tmp} -test_ppm=${tmpdir}/testimg.ppm +rose_ppm=${tmpdir}/rose.ppm -cp testimg.ppm ${tmpdir} && -ppmtorgb3 ${test_ppm} +cp testimg.ppm ${rose_ppm} && +ppmtorgb3 ${rose_ppm} -test_red=${tmpdir}/testimg.red -test_grn=${tmpdir}/testimg.grn -test_blu=${tmpdir}/testimg.blu +rose_red=${tmpdir}/rose.red +rose_grn=${tmpdir}/rose.grn +rose_blu=${tmpdir}/rose.blu -pnmquantall 20 ${test_red} ${test_grn} ${test_blu} +pnmquantall 20 ${rose_red} ${rose_grn} ${rose_blu} -for i in ${test_red} ${test_grn} ${test_blu} +for i in ${rose_red} ${rose_grn} ${rose_blu} do cat $i | cksum done # Should print 1 -pnmcat ${test_red} ${test_grn} ${test_blu} -tb | \ +pnmcat ${rose_red} ${rose_grn} ${rose_blu} -tb | \ pgmhist -m | awk '$2>0 {s++}; END { print (s<=20) }' tmpdir=${tmpdir:-/tmp} -test_out=${tmpdir}/test_out +rose_out=${tmpdir}/rose_out echo 1>&2 echo "Invalid command-line argument combinations." 1>&2 echo "Error messages should appear below the line." 1>&2 echo "-----------------------------------------------------------" 1>&2 -pnmquantall -ext xx 0 ${test_red} ${test_grn} ${test_blu} || \ +pnmquantall -ext xx 0 ${rose_red} ${rose_grn} ${rose_blu} || \ echo "Expected failure 1" -rm ${test_red}xx ${test_grn}xx ${test_blu}xx || \ +rm ${rose_red}xx ${rose_grn}xx ${rose_blu}xx || \ echo "Expected failure 1.rm" -pnmquantall -ext xx 1 ${test_red} ${test_grn} ${test_blu} || \ +pnmquantall -ext xx 1 ${rose_red} ${rose_grn} ${rose_blu} || \ echo "Expected failure 2" -rm ${test_red}xx ${test_grn}xx ${test_blu}xx || \ +rm ${rose_red}xx ${rose_grn}xx ${rose_blu}xx || \ echo "Expected failure 2.rm" pnmquantall -ext xx 2 || \ echo "Expected failure 3" -rm ${test_red} ${test_grn} ${test_blu} ${test_ppm} \ No newline at end of file +rm ${rose_red} ${rose_grn} ${rose_blu} ${rose_ppm} \ No newline at end of file diff --git a/test/rgb3-roundtrip.test b/test/rgb3-roundtrip.test index 5edb1f19..76bd90f1 100755 --- a/test/rgb3-roundtrip.test +++ b/test/rgb3-roundtrip.test @@ -11,20 +11,20 @@ tmpdir=${tmpdir:-/tmp} # Test 1. PPM (color) input echo "Test 1. Should print 1926073387 101484" -testimg_ppm=${tmpdir}/testimg.ppm -testimg_red=${tmpdir}/testimg.red -testimg_grn=${tmpdir}/testimg.grn -testimg_blu=${tmpdir}/testimg.blu +rose_ppm=${tmpdir}/rose.ppm +rose_red=${tmpdir}/rose.red +rose_grn=${tmpdir}/rose.grn +rose_blu=${tmpdir}/rose.blu -cp testimg.ppm ${tmpdir} && -ppmtorgb3 ${testimg_ppm} && -rgb3toppm ${testimg_red} ${testimg_grn} ${testimg_blu} | cksum +cp testimg.ppm ${rose_ppm} && +ppmtorgb3 ${rose_ppm} && +rgb3toppm ${rose_red} ${rose_grn} ${rose_blu} | cksum # Simple cat of three planes echo "Test 2. Should print 3744829044 101514" -cat ${testimg_red} ${testimg_grn} ${testimg_blu} | cksum +cat ${rose_red} ${rose_grn} ${rose_blu} | cksum -rm ${testimg_ppm} ${testimg_red} ${testimg_grn} ${testimg_blu} +rm ${rose_ppm} ${rose_red} ${rose_grn} ${rose_blu} # Test 3. PBM (monochrome) input echo "Test 3. Should print 281226646 481 twice" diff --git a/test/stdin-pam3.test b/test/stdin-pam3.test index 169bb5cd..e8c31781 100755 --- a/test/stdin-pam3.test +++ b/test/stdin-pam3.test @@ -16,7 +16,7 @@ # Also requires: pgmmake tmpdir=${tmpdir:-/tmp} -test_pgm=${tmpdir}/test.ppm +test_pgm=${tmpdir}/test.pgm out1=${tmpdir}/out1 out2=${tmpdir}/out2 out3=${tmpdir}/out3 diff --git a/test/stdin-pbm2.test b/test/stdin-pbm2.test index 724a9934..ba585516 100755 --- a/test/stdin-pbm2.test +++ b/test/stdin-pbm2.test @@ -4,13 +4,13 @@ # This script tests: cmuwmtopbm pbmtocmuwm # This script tests: escp2topbm pbmtoescp2 # This script tests: g3topbm pbmtog3 -# This script tests: gemtopbm pbmtogem +# This script tests: gemtopnm 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: sunicontopnm pbmtosunicon # This script tests: wbmptopbm pbmtowbmp # This script tests: ybmtopbm pbmtoybm # Also requires: diff --git a/test/winicon-roundtrip.test b/test/winicon-roundtrip.test index 0acadd53..31fb89aa 100755 --- a/test/winicon-roundtrip.test +++ b/test/winicon-roundtrip.test @@ -1,6 +1,7 @@ #! /bin/sh # This script tests: pamtowinicon ppmtowinicon winicontopam # Also requires: pamchannel pamcut pamdepth pamtopam +# Also requires: pngtopam pnmtopng tmpdir=${tmpdir:-/tmp} test_pam=${tmpdir}/testimg.pam diff --git a/test/winicon-roundtrip2.test b/test/winicon-roundtrip2.test index eae4ce90..de40446e 100755 --- a/test/winicon-roundtrip2.test +++ b/test/winicon-roundtrip2.test @@ -1,6 +1,7 @@ #! /bin/sh # This script tests: pamtowinicon winicontopam # Also requires: pamchannel pamdepth pamstack pamtopam pbmmake ppmpat +# Also requires: pngtopam pnmtopng tmpdir=${tmpdir:-/tmp} test_pam=${tmpdir}/testimg.pam |