about summary refs log tree commit diff
path: root/test/pamrecolor.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/pamrecolor.test')
-rwxr-xr-xtest/pamrecolor.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/pamrecolor.test b/test/pamrecolor.test
new file mode 100755
index 00000000..b5674776
--- /dev/null
+++ b/test/pamrecolor.test
@@ -0,0 +1,31 @@
+#! /bin/sh
+# This script tests: pamrecolor
+# Also requires: ppmtopgm pgmmake
+
+tmpdir=${tmpdir:-/tmp}
+base_pgm=${tmpdir}/base.pgm
+
+pgmmake 0.5 230 150 > ${base_pgm}
+
+echo "Test 1. Should produce 3500040755 101532"
+
+pamrecolor --colorfile=${base_pgm} testimg.ppm | cksum
+
+echo "Test 2. Should produce 3500040755 101532 twice"
+
+pamrecolor --targetcolor=rgb:80/80/80 testimg.ppm | cksum
+pamrecolor --colorspace=ntsc --targetcolor=rgb:80/80/80 testimg.ppm | cksum
+
+. ${srcdir}/test-invalid.inc
+
+truncated_file=${tmpdir}/truncated.txt
+echo P6 > ${truncated_file}
+
+invCmd "pamrecolor --targetcolor=rgb:00/11/22 --colorfile=${base_pgm} testimg.ppm"
+invCmd "pamrecolor --rmult=0.3  --gmult=0.3  --bmult=0.3 --colorfile=${base_pgm} testimg.ppm"
+invCmd "pamrecolor --colorspace=void --targetcolor=rgb:80/80/80 testimg.ppm"
+invCmd "pamrecolor --targetcolor=vague testimg.ppm"
+invCmd "pamrecolor --colorfile=${truncated_file} testimg.ppm"
+invCmd "pamrecolor --rmult=0.2989 --gmult=0.5866 testimg.ppm"
+
+rm ${base_pgm} ${truncated_file}