about summary refs log tree commit diff
path: root/test/ppmshift.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/ppmshift.test')
-rwxr-xr-xtest/ppmshift.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/ppmshift.test b/test/ppmshift.test
new file mode 100755
index 00000000..cd086d68
--- /dev/null
+++ b/test/ppmshift.test
@@ -0,0 +1,27 @@
+#! /bin/bash
+# This script tests: ppmshift
+# Also requires:
+
+echo "Test 1. Should print: 3705777303 101484"
+ppmshift -seed=1 10 testimg.ppm | cksum
+
+echo "Test 2. Should print: 202790723 685"
+ppmshift -seed=1 1 testgrid.pbm | cksum
+
+echo "Test 3. Should print: 0 : 0"
+ppmshift -seed=1 0 testimg.ppm | cmp -s - testimg.ppm | \
+  echo ${PIPESTATUS[@]} ":" $?
+
+tmpdir=${tmpdir:-/tmp}
+test_pbm=${tmpdir}/test.pbm
+
+ppmshift -seed=2 14 testgrid.pbm > ${test_pbm}
+
+for i in 15 16 20 1000
+  do
+  echo "Test 4. ("$i") Should print: 0 : 0"
+  ppmshift -seed=2 $i testgrid.pbm > ${test_pbm} | cmp -s - testgrid.ppm | \
+    echo ${PIPESTATUS[@]} ":" $?
+  done
+
+rm ${test_pbm}
\ No newline at end of file