about summary refs log tree commit diff
path: root/test/fiasco-roundtrip.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-03-28 15:34:36 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-03-28 15:34:36 +0000
commitca561223546a7e8acd055d5b2114869dd88f5114 (patch)
tree79a54d551eac6df794c539d8b8924aab217a1941 /test/fiasco-roundtrip.test
parent8b32628b4c65cdd2b09e877150bbc4bcdd9b6ba7 (diff)
downloadnetpbm-mirror-ca561223546a7e8acd055d5b2114869dd88f5114.tar.gz
netpbm-mirror-ca561223546a7e8acd055d5b2114869dd88f5114.tar.xz
netpbm-mirror-ca561223546a7e8acd055d5b2114869dd88f5114.zip
Copy Development as new Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2932 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/fiasco-roundtrip.test')
-rwxr-xr-xtest/fiasco-roundtrip.test20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/fiasco-roundtrip.test b/test/fiasco-roundtrip.test
index f733c04a..6fd43432 100755
--- a/test/fiasco-roundtrip.test
+++ b/test/fiasco-roundtrip.test
@@ -1,8 +1,20 @@
 #! /bin/bash
 # This script tests: pnmtofiasco fiascotopnm
-# Also requires: pnmpad
+# Also requires: pnmpad pnmpsnr
 
-# Should print 215556145 102615
+# Pnmtofiasco: number of rows, cols in input file must be even
+# Pnmpsnr output: 15.11 22.71 30.09
+# TODO: As in jpeg-rountrip.test the threshold has been determined
+# without much thought.
 
-pnmpad --black --bottom 1 --left 1 testimg.ppm | \
-    pnmtofiasco --progress-meter 0 | fiascotopnm | cksum
+# Should print 3 1 1 1
+
+tmpdir=${tmpdir:-/tmp}
+padded_ppm=${tmpdir}/padded.ppm
+
+pnmpad --black --bottom 1 --left 1 testimg.ppm > ${padded_ppm} &&
+pnmtofiasco --progress-meter 0 ${padded_ppm} | fiascotopnm | \
+    pnmpsnr -machine - ${padded_ppm} | \
+    awk '{printf("%3d %1d %1d %1d",NF,$1>14.0,$2>21.0,$3>$29.0)}'
+
+rm ${padded_ppm}
\ No newline at end of file