about summary refs log tree commit diff
path: root/test/ppmdim.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-09-26 16:03:01 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-09-26 16:03:01 +0000
commit67e1689f9d7e6b8dfffe393f2d318e3e374c7a36 (patch)
tree5943a3e98e1f12ed80d92e2cb8c5623d8af9fcd3 /test/ppmdim.test
parentfd6e24ededb4ee1e92e101ea50fe21d88630c17f (diff)
downloadnetpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.tar.gz
netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.tar.xz
netpbm-mirror-67e1689f9d7e6b8dfffe393f2d318e3e374c7a36.zip
Promote current development as Release 10.68
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2294 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ppmdim.test')
-rwxr-xr-xtest/ppmdim.test13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/ppmdim.test b/test/ppmdim.test
index e528c3ce..cdd7df17 100755
--- a/test/ppmdim.test
+++ b/test/ppmdim.test
@@ -8,18 +8,23 @@
   alias pnmarith="${PBM_BINPREFIX}pnmarith"
   shopt -s expand_aliases
 
+tmpdir=${tmpdir:-/tmp}
+
 # Compare ppmdim and pamfunc with various dim factors
 # Due to the difference in rounding methods, pamfunc produces slightly
 # brighter images, by about 0.5 per pixel.
 # If the mean difference is between 0 and 0.75 we consider the output
 # normal.  This works for dim values up to 0.994 .
+dim1_ppm=${tmpdir}/dim1.ppm
+dim2_ppm=${tmpdir}/dim2.ppm
 
 for i in  0.125 0.25 0.5 0.75 0.1 0.0117 0.2 0.4 0.333 0.666 0.8 0.9 0.95
   do
-  ppmdim $i testimg.ppm > ${tmpdir}/dim1.ppm
-  pamfunc -mult=$i testimg.ppm > ${tmpdir}/dim2.ppm
-  pnmarith -diff ${tmpdir}/dim1.ppm ${tmpdir}/dim2.ppm | \
+  ppmdim $i testimg.ppm > ${dim1_ppm}
+  pamfunc -mult=$i testimg.ppm > ${dim2_ppm}
+  pnmarith -diff ${dim1_ppm} ${dim2_ppm} | \
     pamsumm -mean -brief | \
     awk '{print $1<0.75 ? "ok" : "fail"}'
   done
-rm ${tmpdir}/dim[12].ppm
+
+rm ${dim1_ppm} ${dim2_ppm}