From 445e3a12541741be2aa863fa5f1efa16413e49a2 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 20 Aug 2017 22:02:30 +0000 Subject: Add palm-roundtrip tests git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3048 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/Test-Order | 1 + test/palm-roundtrip.ok | 10 ++++++++++ test/palm-roundtrip.test | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 test/palm-roundtrip.ok create mode 100755 test/palm-roundtrip.test diff --git a/test/Test-Order b/test/Test-Order index d67c7f29..92ffe7ef 100644 --- a/test/Test-Order +++ b/test/Test-Order @@ -132,6 +132,7 @@ macp-roundtrip.test mda-roundtrip.test mgr-roundtrip.test mrf-roundtrip.test +palm-roundtrip.test pcx-roundtrip.test pfm-roundtrip.test pi3-roundtrip.test diff --git a/test/palm-roundtrip.ok b/test/palm-roundtrip.ok new file mode 100644 index 00000000..6c9114a4 --- /dev/null +++ b/test/palm-roundtrip.ok @@ -0,0 +1,10 @@ +584219238 236 +584219238 236 +584219238 236 +584219238 236 +584219238 236 +600373046 101484 +600373046 101484 +600373046 101484 +600373046 101484 +600373046 101484 diff --git a/test/palm-roundtrip.test b/test/palm-roundtrip.test new file mode 100755 index 00000000..5570e968 --- /dev/null +++ b/test/palm-roundtrip.test @@ -0,0 +1,32 @@ +#! /bin/bash +# This script tests: pnmtopalm palmtopnm +# Also requires: pamdepth pnmquant + +tmpdir=${tmpdir:-/tmp} +test4bit_pgm=${tmpdir}/test4bit.pgm +test256color_ppm=${tmpdir}/test256color.ppm + +# Test 1. Should print 584219238 236 5 times + +pamdepth 15 testgrid.pbm | tee ${test4bit_pgm} | cksum + +for flags in "" \ + "-scanline_compression" \ + "-rle_compression" \ + "-packbits_compression" + do pnmtopalm $flags ${test4bit_pgm} | palmtopnm | cksum; done + +rm ${test4bit_pgm} + + +# Test 2. Should print 600373046 101484 5 times + +pnmquant 256 testimg.ppm | tee ${test256color_ppm} | cksum + +for flags in "" \ + "-scanline_compression" \ + "-rle_compression" \ + "-packbits_compression" + do pnmtopalm -colormap $flags ${test256color_ppm} | palmtopnm | cksum; done + +rm ${test256color_ppm} -- cgit 1.4.1