diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-03-27 23:20:22 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-03-27 23:20:22 +0000 |
commit | 772c4792d998deb70f1719c1a2ad82f2defde5f0 (patch) | |
tree | f512ff95f5e767aa5bb1655caa0aaf87063a624a /test/ppmshift.test | |
parent | f336dfc59346a26a045f7e0df0ecba32d904c55e (diff) | |
download | netpbm-mirror-772c4792d998deb70f1719c1a2ad82f2defde5f0.tar.gz netpbm-mirror-772c4792d998deb70f1719c1a2ad82f2defde5f0.tar.xz netpbm-mirror-772c4792d998deb70f1719c1a2ad82f2defde5f0.zip |
Promote Development release to Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4318 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ppmshift.test')
-rwxr-xr-x | test/ppmshift.test | 35 |
1 files changed, 25 insertions, 10 deletions
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} |