about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-06-29 19:18:54 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-06-29 19:18:54 +0000
commit1610a1f6aa54ad1d97926c1d8605720933059df7 (patch)
tree798e7e0a8fc53429b26d536ecb6ec1a176923ded /test
parent99eb1b4c7590cc6a8328245e6ec1427ca4d16555 (diff)
downloadnetpbm-mirror-1610a1f6aa54ad1d97926c1d8605720933059df7.tar.gz
netpbm-mirror-1610a1f6aa54ad1d97926c1d8605720933059df7.tar.xz
netpbm-mirror-1610a1f6aa54ad1d97926c1d8605720933059df7.zip
Update Advanced series to Release 10.67
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2221 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test')
-rw-r--r--test/Test-Order3
-rw-r--r--test/pamflip1.ok (renamed from test/pamflip.ok)1
-rw-r--r--[-rwxr-xr-x]test/pamflip1.test (renamed from test/pamflip.test)2
-rw-r--r--test/pamflip2.ok3
-rw-r--r--test/pamflip2.test19
-rwxr-xr-xtest/ppmcie.test6
-rwxr-xr-xtest/symmetry.test45
7 files changed, 54 insertions, 25 deletions
diff --git a/test/Test-Order b/test/Test-Order
index ff4b9855..9a9210e4 100644
--- a/test/Test-Order
+++ b/test/Test-Order
@@ -50,7 +50,8 @@ pamditherbw.test
 pbmclean.test
 pamcut.test
 pnmcat.test
-pamflip.test
+pamflip1.test
+pamflip2.test
 pamenlarge.test
 pnminvert.test
 pamchannel.test
diff --git a/test/pamflip.ok b/test/pamflip1.ok
index c7427e46..64e0407e 100644
--- a/test/pamflip.ok
+++ b/test/pamflip1.ok
@@ -3,4 +3,3 @@
 2052917888 101484
 3375384165 41
 604323149 41
-490797850 37
diff --git a/test/pamflip.test b/test/pamflip1.test
index 4ea275bd..0f60b72b 100755..100644
--- a/test/pamflip.test
+++ b/test/pamflip1.test
@@ -15,5 +15,3 @@ pamflip -tb testimg.ppm | cksum
 pamflip -lr testgrid.pbm | cksum
 # Test 5.  Should print 604323149 41
 pamflip -tb testgrid.pbm | cksum
-# Test 6.  Should print 490797850 37
-pamflip -cw testgrid.pbm | cksum
diff --git a/test/pamflip2.ok b/test/pamflip2.ok
new file mode 100644
index 00000000..d2ea501e
--- /dev/null
+++ b/test/pamflip2.ok
@@ -0,0 +1,3 @@
+490797850 37
+3727293411 37
+3511745816 37
diff --git a/test/pamflip2.test b/test/pamflip2.test
new file mode 100644
index 00000000..d9418b25
--- /dev/null
+++ b/test/pamflip2.test
@@ -0,0 +1,19 @@
+#! /bin/bash
+# This script tests: pamflip
+# Also requires: 
+
+  alias pamflip="${PBM_TESTPREFIX}pamflip"
+  shopt -s expand_aliases
+
+# Failure message
+## Failure with this test indicates a problem with pamflip transpositions
+## (90 degree flips) when input is PBM.  This operation is done by an
+## optional SSE routine.  If you make a wrong choice during configure,
+## this test will fail.
+
+# Test 1.  Should print 490797850 37
+pamflip -cw testgrid.pbm | cksum
+# Test 1.  Should print 3727293411 37
+pamflip -ccw testgrid.pbm | cksum
+# Test 2.  Should print 3511745816 37
+pamflip -xy testgrid.pbm | cksum
diff --git a/test/ppmcie.test b/test/ppmcie.test
index 2584ece4..c4338195 100755
--- a/test/ppmcie.test
+++ b/test/ppmcie.test
@@ -40,8 +40,8 @@ pamsumm --mean --brief ${tmpdir}/ppmcie.ppm | \
 # x86 64 bit: 0.002478
 
 pamsharpness ${tmpdir}/ppmcie.ppm 2>&1 | \
-  awk 'NF==4 && $2=="Sharpness" \
-       {if (0.002475 < $4 && $4 < 0.002479) print "ok"; else print $4}
-       NF>0 && NF!=4 {print "error"}'
+  awk 'NF==3 && $1=="Sharpness" \
+       {if (0.002475 < $3 && $3 < 0.002479) print "ok"; else print $3}
+       NF>0 && NF!=3 {print "error"}'
 
 rm ${tmpdir}/ppmcie.ppm
diff --git a/test/symmetry.test b/test/symmetry.test
index 5fdb3918..5f09e91e 100755
--- a/test/symmetry.test
+++ b/test/symmetry.test
@@ -29,67 +29,76 @@
 ## Failure with this test indicates that a generator or editor which
 ## should produce symmetric output images isn't doing so.
 
+tmpdir=${tmpdir:-/tmp}
+
 # Test 1.
-pgmramp -rect 31 31 > ${tmpdir}/rect.pgm
+rect_pgm=${tmpdir}/rect.pgm
+
+pgmramp -rect 31 31 > ${rect_pgm}
 
 ( for op in -null -tb -lr -r90
-    do pamflip $op ${tmpdir}/rect.pgm | cksum
+    do pamflip $op ${rect_pgm} | cksum
     done ) | uniq -c | \
   awk '$1==4 && $3>0 { print "ok"; exit }; { print }'
 
-rm ${tmpdir}/rect.pgm
+rm ${rect_pgm}
 
 # Test 2.
-pgmramp -ell 63 63 > ${tmpdir}/circle.pgm
+circle_pgm=${tmpdir}/circle.pgm
+pgmramp -ell 63 63 > ${circle_pgm}
 
 ( for op in -null -tb -lr -r90
-    do pamflip $op ${tmpdir}/circle.pgm | cksum
+    do pamflip $op ${circle_pgm} | cksum
     done ) | uniq -c | \
   awk '$1==4 && $3>0 { print "ok"; exit }; { print }'
 
-rm ${tmpdir}/circle.pgm
+rm ${circle_pgm}
 
 # Test 3.
-pamgauss -sigma=0.1 -tupletype=GRAYSCALE 25 25 > ${tmpdir}/gauss.pam
+gauss_pgm=${tmpdir}/gauss.pgm
+pamgauss -sigma=0.1 -tupletype=GRAYSCALE 25 25 > ${gauss_pgm}
 
 ( for op in -null -tb -lr -r90
-    do pamflip $op ${tmpdir}/gauss.pam | cksum
+    do pamflip $op ${gauss_pgm} | cksum
     done ) | uniq -c | \
   awk '$1==4 && $3>0 { print "ok"; exit }; { print }'
 
-rm ${tmpdir}/gauss.pam
+rm ${gauss_pgm}
 
 # Test 4.
-pgmkernel 15 15 > ${tmpdir}/kernel.pgm
+kernel_pgm=${tmpdir}/kernel.pgm
+pgmkernel 15 15 > ${kernel_pgm}
 
 ( for op in -null -tb -lr -r90
-    do pamflip $op ${tmpdir}/kernel.pgm | cksum
+    do pamflip $op ${kernel_pgm} | cksum
     done ) | uniq -c | \
   awk '$1==4 && $3>0 { print "ok"; exit }; { print }'
 
-rm ${tmpdir}/kernel.pgm
+rm ${kernel_pgm}
 
 # Test 5.
 # Should print "ok" 7 times.
+pscale_pbm=${tmpdir}/pscale.pbm
 for size in `seq 1 7`
 do
-pbmmake -g 5 5 | pbmpscale $size > ${tmpdir}/pscale.pbm
+pbmmake -g 5 5 | pbmpscale $size > ${pscale_pbm}
 
 ( for op in -null -tb -lr -r90
-    do pamflip $op ${tmpdir}/pscale.pbm | cksum
+    do pamflip $op ${pscale_pbm} | cksum
     done ) | uniq -c | \
   awk '$1==4 && $3>0 { print "ok"; exit }; { print }'
 
-rm ${tmpdir}/pscale.pbm
+rm ${pscale_pbm}
 done
 
 # Test 6.
-pgmramp -ell 101 33 > ${tmpdir}/ell.pgm
+ell_pgm=${tmpdir}/ell.pgm
+pgmramp -ell 101 33 > ${ell_pgm}
 
 ( for op in -null -tb -lr
-  do pamflip $op ${tmpdir}/ell.pgm | cksum
+  do pamflip $op ${ell_pgm} | cksum
   done ) | uniq -c | \
   awk '$1==3 && $3>0 { print "ok"; exit }; { print }'
 
-rm ${tmpdir}/ell.pgm
+rm ${ell_pgm}