diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:21:21 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-06-28 17:21:21 +0000 |
commit | 0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0 (patch) | |
tree | 3e8db9f13fb33464324c6986e7d80540a42a86c7 /test/pdb-roundtrip.test | |
parent | 7dd37058c4c8e0f6ca272e329162a52f958e4951 (diff) | |
download | netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.tar.gz netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.tar.xz netpbm-mirror-0d513aca5cbbb8db0a9d127e101ac3b534cc8bf0.zip |
promote Stable to Super Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@4557 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/pdb-roundtrip.test')
-rwxr-xr-x | test/pdb-roundtrip.test | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/pdb-roundtrip.test b/test/pdb-roundtrip.test new file mode 100755 index 00000000..6b4e152c --- /dev/null +++ b/test/pdb-roundtrip.test @@ -0,0 +1,55 @@ +#! /bin/bash +# This script tests: pamtopdbimg pdbimgtopam +# Also requires: pnmtile pgmramp pamtopnm + +tmpdir=${tmpdir:-/tmp} +tiled_pbm=${tmpdir}/tiled.pbm +ellipse_pgm=${tmpdir}/ellipse.pgm + + +# Test 1. Should produce 2224198737 25671 +# 3 times +echo pbm grid +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} +for flag in "" "-compressed" "-maybecompressed" "-uncompressed" + do + pamtopdbimg ${flag} ${tiled_pbm} | pdbimgtopam | pamtopnm | \ + cmp -s - ${tiled_pbm} + echo ${PIPESTATUS[@]} ":" $? + done +rm ${tiled_pbm} + + +# Test 3. Should produce 0 0 0 +# 4 times +echo pgm ellipse +pgmramp -ellipse 160 160 -maxval=3 > ${ellipse_pgm} +for flag in "" "-compressed" "-maybecompressed" "-uncompressed" + do + pamtopdbimg ${flag} ${ellipse_pgm} | pdbimgtopam | \ + pamtopnm | pamdepth 3 | cmp -s - ${ellipse_pgm} + echo ${PIPESTATUS[@]} ":" $? + done +rm ${ellipse_pgm} + + +# Test 3. Should produce 0 0 0 +# 3 times +echo pgm ellipse -4depth +pgmramp -ellipse 160 160 -maxval=15 > ${ellipse_pgm} +for flag in "-compressed" "-maybecompressed" "-uncompressed" + do + pamtopdbimg -4depth ${flag} ${ellipse_pgm} | pdbimgtopam | \ + pamtopnm | pamdepth 15 | cmp -s - ${ellipse_pgm} + echo ${PIPESTATUS[@]} ":" $? + done +rm ${ellipse_pgm} \ No newline at end of file |