about summary refs log tree commit diff
path: root/test/pj-roundtrip.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/pj-roundtrip.test')
-rwxr-xr-xtest/pj-roundtrip.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/pj-roundtrip.test b/test/pj-roundtrip.test
new file mode 100755
index 00000000..3394a4d2
--- /dev/null
+++ b/test/pj-roundtrip.test
@@ -0,0 +1,22 @@
+#! /bin/bash
+# This script tests: ppmtopj pjtoppm
+# Also requires: pamseq pnmremap pamtopnm pamdepth ppmtopgm pgmtopbm
+
+echo "Test 1. Should print:  0 0 0 0 : 0"
+
+tmpdir=${tmpdir:-/tmp}
+test8_ppm=${tmpdir}/testimg8.ppm
+
+pamseq 3 1 | pnmremap -map - testimg.ppm | pamtopnm -assume > ${test8_ppm}
+
+ppmtopj ${test8_ppm} | pjtoppm | pamdepth 1 | \
+  cmp -s - ${test8_ppm} > /dev/null
+  echo ${PIPESTATUS[@]} ":" $?
+
+rm ${test8_ppm}
+
+echo "Test 2. Should print:  0 0 0 0 0 : 0"
+
+ppmtopj testgrid.pbm | pjtoppm | ppmtopgm | pgmtopbm | \
+  cmp -s - testgrid.pbm > /dev/null
+  echo ${PIPESTATUS[@]} ":" $?