about summary refs log tree commit diff
path: root/test/palm-roundtrip.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-09-30 18:51:40 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-09-30 18:51:40 +0000
commit8b2ff6a4ae59c1ab37af590a7340656f93dbddee (patch)
tree36477ce3fc89409c484ee53afa10dac9685e7700 /test/palm-roundtrip.test
parenteb9c9ea7fe9a04f1977bdd040c173c84f841d431 (diff)
downloadnetpbm-mirror-8b2ff6a4ae59c1ab37af590a7340656f93dbddee.tar.gz
netpbm-mirror-8b2ff6a4ae59c1ab37af590a7340656f93dbddee.tar.xz
netpbm-mirror-8b2ff6a4ae59c1ab37af590a7340656f93dbddee.zip
Copy Development as new Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3083 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/palm-roundtrip.test')
-rwxr-xr-xtest/palm-roundtrip.test32
1 files changed, 32 insertions, 0 deletions
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}