diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:45:11 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:45:11 +0000 |
commit | cdf6e0151411d887fef61245cb303ef190b29335 (patch) | |
tree | 678c2212e125e66e0a868773e2b4ec460794da4e /test/bmp-roundtrip.test | |
parent | de1311e820dc892f1a3c5c9ae70dbc56868030d8 (diff) | |
download | netpbm-mirror-cdf6e0151411d887fef61245cb303ef190b29335.tar.gz netpbm-mirror-cdf6e0151411d887fef61245cb303ef190b29335.tar.xz netpbm-mirror-cdf6e0151411d887fef61245cb303ef190b29335.zip |
Promote Advanced to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@3641 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/bmp-roundtrip.test')
-rwxr-xr-x | test/bmp-roundtrip.test | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/test/bmp-roundtrip.test b/test/bmp-roundtrip.test index be9a4548..c9ef363a 100755 --- a/test/bmp-roundtrip.test +++ b/test/bmp-roundtrip.test @@ -1,7 +1,42 @@ #! /bin/bash # This script tests: bmptopnm ppmtobmp -# Also requires: +# Also requires: pamchannel pamtopnm pamseq +tmpdir=${tmpdir:-/tmp} -ppmtobmp testimg.ppm | bmptopnm | cksum -ppmtobmp testgrid.pbm | bmptopnm | cksum +# Test 1. Should print 2425386270 41 four times + +echo PBM + +for mode in "" "-bpp=1" "-windows" "-os2" + do + ppmtobmp ${mode} testgrid.pbm | bmptopnm | cksum + done + +# Test 2. Should print 1926073387 101484 four times + +echo PPM + +for mode in "" "-bpp=24" "-windows" "-os2" + do + ppmtobmp ${mode} testimg.ppm | bmptopnm | cksum + done + +# Test 3. Should print 1571496937 33838 nine times + +echo PGM + +red_pgm=${tmpdir}/red.pgm +mapfile_pgm=${tmpdir}/mapfile.pgm +pamseq -tupletype="GRAYSCALE" 1 255 > ${mapfile_pgm} + +pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | \ + pamtopnm | tee ${red_pgm} | cksum + +for mode in "" "-bpp=8" "-windows" "-os2" + do + ppmtobmp ${mode} ${red_pgm} | bmptopnm | cksum + ppmtobmp ${mode} -mapfile=${mapfile_pgm} ${red_pgm} | bmptopnm | cksum + done + +rm ${mapfile_pgm} ${red_pgm} \ No newline at end of file |