diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2021-03-23 23:42:47 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2021-03-23 23:42:47 +0000 |
commit | c99a377d51e2980dcd4766b533c2d05d5293e756 (patch) | |
tree | b54f4b12dd6b7135a1f8d215f839b717feb30992 /test/ppmshift.test | |
parent | 7b8f9eec8c0936fea2b2b87f8652246a665d2998 (diff) | |
download | netpbm-mirror-c99a377d51e2980dcd4766b533c2d05d5293e756.tar.gz netpbm-mirror-c99a377d51e2980dcd4766b533c2d05d5293e756.tar.xz netpbm-mirror-c99a377d51e2980dcd4766b533c2d05d5293e756.zip |
random number tests et al
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4060 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ppmshift.test')
-rwxr-xr-x | test/ppmshift.test | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/ppmshift.test b/test/ppmshift.test new file mode 100755 index 00000000..cd086d68 --- /dev/null +++ b/test/ppmshift.test @@ -0,0 +1,27 @@ +#! /bin/bash +# This script tests: ppmshift +# Also requires: + +echo "Test 1. Should print: 3705777303 101484" +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 ${PIPESTATUS[@]} ":" $? + +tmpdir=${tmpdir:-/tmp} +test_pbm=${tmpdir}/test.pbm + +ppmshift -seed=2 14 testgrid.pbm > ${test_pbm} + +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 ${PIPESTATUS[@]} ":" $? + done + +rm ${test_pbm} \ No newline at end of file |