about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-04-24 00:09:33 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-04-24 00:09:33 +0000
commita8687fd4bd5b2ea6b541b5464bc7a340766e84f8 (patch)
tree97cad586ee76916847b71ce849ae706399665e88
parent6c791c551342a88dff3b74b45e0c0fa14d85d4f9 (diff)
downloadnetpbm-mirror-a8687fd4bd5b2ea6b541b5464bc7a340766e84f8.tar.gz
netpbm-mirror-a8687fd4bd5b2ea6b541b5464bc7a340766e84f8.tar.xz
netpbm-mirror-a8687fd4bd5b2ea6b541b5464bc7a340766e84f8.zip
Additional tests
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2715 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--test/Test-Order5
-rw-r--r--test/enlarge-reduce-roundtrip.ok17
-rwxr-xr-xtest/enlarge-reduce-roundtrip.test34
-rw-r--r--test/fiasco-roundtrip.ok1
-rwxr-xr-xtest/fiasco-roundtrip.test8
-rw-r--r--test/pnmquantall.ok5
-rwxr-xr-xtest/pnmquantall.test19
7 files changed, 88 insertions, 1 deletions
diff --git a/test/Test-Order b/test/Test-Order
index 92efca05..38873bd4 100644
--- a/test/Test-Order
+++ b/test/Test-Order
@@ -62,6 +62,7 @@ pambackground.test
 pbmpscale.test
 pnmremap1.test
 pnmremap2.test
+pnmquantall.test
 pnmtile.test
 ppmbrighten.test
 ppmdither.test
@@ -103,6 +104,7 @@ ppmchange-roundtrip.test
 pamdice-roundtrip.test
 pamslice-roundtrip.test
 lookup-roundtrip.test
+enlarge-reduce-roundtrip.test
 
 # Round-trip tests : lossless converters
 
@@ -150,6 +152,7 @@ xpm-roundtrip.test
 xv-roundtrip.test
 xwd-roundtrip.test
 
-# Round-trip tests : lossy converter
+# Round-trip tests : lossy converters
 
+fiasco-roundtrip.test
 yuv-roundtrip.test
diff --git a/test/enlarge-reduce-roundtrip.ok b/test/enlarge-reduce-roundtrip.ok
new file mode 100644
index 00000000..8ee8118a
--- /dev/null
+++ b/test/enlarge-reduce-roundtrip.ok
@@ -0,0 +1,17 @@
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
+2364818683 590
diff --git a/test/enlarge-reduce-roundtrip.test b/test/enlarge-reduce-roundtrip.test
new file mode 100755
index 00000000..54b52c60
--- /dev/null
+++ b/test/enlarge-reduce-roundtrip.test
@@ -0,0 +1,34 @@
+#! /bin/bash
+# This script tests: pamenlarge pbmpscale pbmreduce
+# Also requires: pbmtext
+
+tmpdir=${tmpdir:-/tmp}
+xanadu_pbm=${tmpdir}/xanadu.pbm
+
+echo "In Xanadu did Kubla khan" | pbmtext > ${xanadu_pbm} 
+
+# Should print 2364818683 590
+
+cat ${xanadu_pbm} | cksum
+
+# Should print 2364818683 590 eight times
+
+for scale in 2 4 6 7
+  do
+  for flag in "-fs -randomseed=0" "-threshold -v 0.4"
+    do
+    pamenlarge ${scale} ${xanadu_pbm} | pbmreduce ${flag} ${scale} | cksum
+    done
+  done
+
+# Should print 2364818683 590 eight times
+
+for scale in 5 7 9 11
+  do
+  for flag in "-fs -randomseed=0" "-threshold"
+    do
+    pbmpscale ${scale} ${xanadu_pbm} | pbmreduce ${flag} ${scale} | cksum
+    done
+  done
+
+rm ${xanadu_pbm}
diff --git a/test/fiasco-roundtrip.ok b/test/fiasco-roundtrip.ok
new file mode 100644
index 00000000..e26677f4
--- /dev/null
+++ b/test/fiasco-roundtrip.ok
@@ -0,0 +1 @@
+215556145 102615
diff --git a/test/fiasco-roundtrip.test b/test/fiasco-roundtrip.test
new file mode 100755
index 00000000..f733c04a
--- /dev/null
+++ b/test/fiasco-roundtrip.test
@@ -0,0 +1,8 @@
+#! /bin/bash
+# This script tests: pnmtofiasco fiascotopnm
+# Also requires: pnmpad
+
+# Should print 215556145 102615
+
+pnmpad --black --bottom 1 --left 1 testimg.ppm | \
+    pnmtofiasco --progress-meter 0 | fiascotopnm | cksum
diff --git a/test/pnmquantall.ok b/test/pnmquantall.ok
new file mode 100644
index 00000000..bd5bbc05
--- /dev/null
+++ b/test/pnmquantall.ok
@@ -0,0 +1,5 @@
+got color map
+2373957371 33838 testimg.red
+3892560659 33838 testimg.grn
+1383839923 33838 testimg.blu
+1
diff --git a/test/pnmquantall.test b/test/pnmquantall.test
new file mode 100755
index 00000000..e40276e5
--- /dev/null
+++ b/test/pnmquantall.test
@@ -0,0 +1,19 @@
+#! /bin/bash
+# This script tests: pnmquantall
+# Also requires: ppmtorgb3 pgmhist
+
+PATH=/src/netpbm/pbin/:/usr/bin
+
+ppmtorgb3 testimg.ppm
+
+pnmquantall 20 testimg.red testimg.grn testimg.blu
+
+for i in testimg.red testimg.grn testimg.blu
+do
+cksum $i
+done
+
+# Should print 1
+
+pnmcat testimg.red testimg.grn testimg.blu -tb | \
+    pgmhist -m | awk '$2>0 {s++}; END { print s<=20 }'