about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2018-01-06 03:28:54 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2018-01-06 03:28:54 +0000
commit733798d7f10211ad1ebe60482ce5c0be92f170f4 (patch)
treef0dcc3edf448700a9b1e294cd53ce4fb1585cf1a /test
parent4d797dc32c3142447fb51ce1fed91c36f78b11cf (diff)
downloadnetpbm-mirror-733798d7f10211ad1ebe60482ce5c0be92f170f4.tar.gz
netpbm-mirror-733798d7f10211ad1ebe60482ce5c0be92f170f4.tar.xz
netpbm-mirror-733798d7f10211ad1ebe60482ce5c0be92f170f4.zip
Add -targetX
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3110 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test')
-rw-r--r--test/jpeg-roundtrip.ok6
-rwxr-xr-xtest/jpeg-roundtrip.test23
-rw-r--r--test/pnmpsnr.ok3
-rwxr-xr-xtest/pnmpsnr.test3
-rw-r--r--test/tiffcmyk-roundtrip.ok10
-rwxr-xr-xtest/tiffcmyk-roundtrip.test33
6 files changed, 26 insertions, 52 deletions
diff --git a/test/jpeg-roundtrip.ok b/test/jpeg-roundtrip.ok
index 9a93f216..5551f78e 100644
--- a/test/jpeg-roundtrip.ok
+++ b/test/jpeg-roundtrip.ok
@@ -1,3 +1,3 @@
-  3 1000.00 1000.00 1000.00
-  3 1000.00 1000.00 1000.00
-  3 1000.00 1000.00 1000.00
+match
+match
+match
diff --git a/test/jpeg-roundtrip.test b/test/jpeg-roundtrip.test
index 23df6341..7cc0fc20 100755
--- a/test/jpeg-roundtrip.test
+++ b/test/jpeg-roundtrip.test
@@ -4,29 +4,16 @@
 
 # TODO: threshold has been determined without much thought.
 # Observed pnmpsnr output: 56.20 58.26 49.38
+# On another system:       54.73 49.41 44.52
 # A small margin has been added to the above numbers.
 
-# Should print 3 1 1 1 three times
+# Should print "match" three times
 
 pnmtojpeg testimg.ppm | jpegtopnm | \
-  pnmpsnr -machine - testimg.ppm |\
-  awk '{printf("%3d %.2f %.2f %.2f\n", NF,
-                $1>55.0 ? 1000.00 : $1,
-                $2>57.0 ? 1000.00 : $2,
-                $3>48.0 ? 1000.00 : $3) }'
-
+  pnmpsnr -target1=54 -target2=49 -target3=44 - testimg.ppm
 
 pnmtojpeg testimg.ppm -opt | jpegtopnm | \
-  pnmpsnr -machine - testimg.ppm |\
-  awk '{printf("%3d %.2f %.2f %.2f\n", NF,
-                $1>55.0 ? 1000.00 : $1,
-                $2>57.0 ? 1000.00 : $2,
-                $3>48.0 ? 1000.00 : $3) }'
-
+  pnmpsnr -target1=54 -target2=49 -target3=44 - testimg.ppm
 
 pnmtojpeg testimg.ppm -progressive | jpegtopnm | \
-  pnmpsnr -machine - testimg.ppm |\
-  awk '{printf("%3d %.2f %.2f %.2f\n", NF,
-                $1>55.0 ? 1000.00 : $1,
-                $2>57.0 ? 1000.00 : $2,
-                $3>48.0 ? 1000.00 : $3) }'
+  pnmpsnr -target1=54 -target2=49 -target3=44 - testimg.ppm
diff --git a/test/pnmpsnr.ok b/test/pnmpsnr.ok
index 4c7eccde..3469f836 100644
--- a/test/pnmpsnr.ok
+++ b/test/pnmpsnr.ok
@@ -1,4 +1,7 @@
 0.00
 inf
 1000.00
+match
 300.00 300.00 300.00
+match
+match
diff --git a/test/pnmpsnr.test b/test/pnmpsnr.test
index c7591983..f24c08aa 100755
--- a/test/pnmpsnr.test
+++ b/test/pnmpsnr.test
@@ -15,6 +15,9 @@ pbmmake -b 10 10 > ${b_pbm}
 pnmpsnr  ${w_pbm}  ${b_pbm} -machine
 pnmpsnr  ${w_pbm}  ${w_pbm} -machine
 pnmpsnr  ${w_pbm}  ${w_pbm} -machine -max=1000
+pnmpsnr  ${w_pbm}  ${w_pbm} -target=1000
 pnmpsnr  testimg.ppm  testimg.ppm -machine -max=300
+pnmpsnr  testimg.ppm  testimg.ppm -target=1000
+pnmpsnr  testimg.ppm  testimg.ppm -target1=1000 -target2=1000 -target3=1000
 
 rm ${b_pbm} ${w_pbm}
diff --git a/test/tiffcmyk-roundtrip.ok b/test/tiffcmyk-roundtrip.ok
index 5f4963cd..05c0b188 100644
--- a/test/tiffcmyk-roundtrip.ok
+++ b/test/tiffcmyk-roundtrip.ok
@@ -1,5 +1,5 @@
-  3 1000.00 1000.00 1000.00
-  3 1000.00 1000.00 1000.00
-  3 1000.00 1000.00 1000.00
-  3 1000.00 1000.00 1000.00
-  3 1000.00 1000.00 1000.00
+match
+match
+match
+match
+match
diff --git a/test/tiffcmyk-roundtrip.test b/test/tiffcmyk-roundtrip.test
index 99e02c48..133c81b7 100755
--- a/test/tiffcmyk-roundtrip.test
+++ b/test/tiffcmyk-roundtrip.test
@@ -15,47 +15,28 @@ output_tiff=${tmpdir}/output.tiff
 
 pnmtotiffcmyk testimg.ppm > ${output_tiff} && \
   tifftopnm -headerdump -byrow ${output_tiff} | \
-  pnmpsnr -machine - testimg.ppm | \
-  awk '{printf("%3d %.2f %.2f %.2f\n", NF,
-                $1>45.0 ? 1000.00 : $1,
-                $2>59.5 ? 1000.00 : $2,
-                $3>56.5 ? 1000.00 : $3) }'
+  pnmpsnr -target1=45.0 -target2=59.5 -target3=56.5 - testimg.ppm
 
 
 # Note that "-rowsperstrip=1" does not work
 pnmtotiffcmyk -rowsperstrip 1 -lsb2msb testimg.ppm > ${output_tiff} && \
   tifftopnm -respectfillorder -byrow  ${output_tiff} | \
-  pnmpsnr -machine - testimg.ppm | \
-  awk '{printf("%3d %.2f %.2f %.2f\n", NF,
-                $1>45.0 ? 1000.00 : $1,
-                $2>59.5 ? 1000.00 : $2,
-                $3>56.5 ? 1000.00 : $3) }'
+  pnmpsnr -target1=45.0 -target2=59.5 -target3=56.5 - testimg.ppm
 
 
 pnmtotiffcmyk -packbits testimg.ppm > ${output_tiff} && \
   tifftopnm -byrow ${output_tiff} | \
-  pnmpsnr -machine - testimg.ppm | \
-  awk '{printf("%3d %.2f %.2f %.2f\n", NF,
-                $1>45.0 ? 1000.00 : $1,
-                $2>59.5 ? 1000.00 : $2,
-                $3>56.5 ? 1000.00 : $3) }'
+  pnmpsnr -target1=45.0 -target2=59.5 -target3=56.5 - testimg.ppm
 
 
 pnmtotiffcmyk -lzw testimg.ppm > ${output_tiff} && \
   tifftopnm -byrow ${output_tiff} | \
-    pnmpsnr -machine - testimg.ppm | \
-  awk '{printf("%3d %.2f %.2f %.2f\n", NF,
-                $1>45.0 ? 1000.00 : $1,
-                $2>59.5 ? 1000.00 : $2,
-                $3>56.5 ? 1000.00 : $3) }'
+  pnmpsnr -target1=45.0 -target2=59.5 -target3=56.5 - testimg.ppm
 
 
 pnmtotiffcmyk -lzw -predictor 2 testimg.ppm > ${output_tiff} && \
   tifftopnm -respectfillorder -byrow ${output_tiff} | \
-  pnmpsnr -machine - testimg.ppm | \
-  awk '{printf("%3d %.2f %.2f %.2f\n", NF,
-                $1>45.0 ? 1000.00 : $1,
-                $2>59.5 ? 1000.00 : $2,
-                $3>56.5 ? 1000.00 : $3) }'
+  pnmpsnr -target1=45.0 -target2=59.5 -target=56.5 - testimg.ppm
 
-rm ${output_tiff}
\ No newline at end of file
+
+rm ${output_tiff}