about summary refs log tree commit diff
path: root/test/palm-roundtrip2.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/palm-roundtrip2.test')
-rwxr-xr-xtest/palm-roundtrip2.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/palm-roundtrip2.test b/test/palm-roundtrip2.test
new file mode 100755
index 00000000..4c94df8c
--- /dev/null
+++ b/test/palm-roundtrip2.test
@@ -0,0 +1,31 @@
+#! /bin/bash
+# This script tests: pnmtopalm palmtopnm
+# Also requires: pnmremap
+
+tmpdir=${tmpdir:-/tmp}
+test256color_ppm=${tmpdir}/test256color.ppm
+
+if [ ${CHECK_TYPE} = install ]
+  then mapfile=$(netpbm-config --datadir)/palmcolor8.map
+  else mapfile=${PALMMAPDIR}/palmcolor8.map
+fi
+
+if [ ! -f ${mapfile} ]
+  then
+  echo "Cannot find palmcolor8.map.  Skipping." 1>&2
+  exit 80;
+fi
+
+
+# Test. Should print 438301914 101484
+# 5 times
+
+pnmremap -mapfile=${mapfile} 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}