about summary refs log tree commit diff
path: root/test/ppmforge.test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:29:32 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:29:32 +0000
commit23ce26f64c34e30951ad9ade2151552ed77e7357 (patch)
treed73b31a0c2f7c7be4a69f8a8e84e00dd39c432b5 /test/ppmforge.test
parent1b6e51a266008348ad93ed8b6ac9ec91b5024fea (diff)
downloadnetpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.gz
netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.xz
netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.zip
promote Advanced to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@4558 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test/ppmforge.test')
-rwxr-xr-xtest/ppmforge.test55
1 files changed, 49 insertions, 6 deletions
diff --git a/test/ppmforge.test b/test/ppmforge.test
index 3ebea88c..75de7cf7 100755
--- a/test/ppmforge.test
+++ b/test/ppmforge.test
@@ -1,9 +1,52 @@
-#! /bin/bash
+#! /bin/sh
 # This script tests: ppmforge
-# Also requires:
+# Also requires: pnmpsnr
 
-# Use small x y values to avoid floating point issues.
-
-# Should print: 3634219838 196623 (Glibc)
-#               3262664440 196623 (MAC OS)
+echo "Test 1. Should print: 547829788 196623  (Mersenne Twister)" 
+#               3634219838 196623 (Glibc rand() )
+#               3262664440 196623 (MAC OS rand() )
 ppmforge -night -seed 1 | cksum
+
+tmpdir=${tmpdir:-/tmp}
+test_ppm=${tmpdir}/test.ppm
+
+
+# Target values for following tests were determined by running the
+# ppmforge command pairs 30 times with different seeds, finding
+# the minimum (or "poorest match") for each component and 
+# subtracting 0.01 dB.   As such these are weak tests.
+
+
+echo "Test 2."
+ppmforge -cloud -seed 1 -power 0.75 > ${test_ppm}
+ppmforge -cloud -seed 1 -power 0.74 | \
+  pnmpsnr -rgb -target1=41.15 -target2=41.15 -target3=999 - ${test_ppm}
+
+rm ${test_ppm}
+
+echo "Test 3."
+ppmforge -cloud -seed 1 -dimension 2.15 > ${test_ppm}
+ppmforge -cloud -seed 1 -dimension 2.175 | \
+  pnmpsnr -rgb -target1=43.39 -target2=43.39 -target3=999 - ${test_ppm}
+
+  # Note that there should be no difference for the target3: blue.
+
+
+
+rm ${test_ppm}
+
+echo "Test 4."
+ppmforge -seed 1 -stars 0 -ice 0.01 -power 1.18 -hour 10 >  ${test_ppm}
+ppmforge -seed 1 -stars 0 -ice 0.01 -power 1.22 -hour 10 | \
+  pnmpsnr -target1=27.89 -target2=24.25 -target3=37.87 - ${test_ppm}
+
+rm ${test_ppm}
+
+echo "Test 5."
+ppmforge -seed 1 -stars 0 -ice 0.01 \
+    -inclination 9  -hour 12 -power 200 > ${test_ppm} 
+ppmforge -seed 1 -stars 0 -ice 0.01 \
+    -inclination 10 -hour 12 -power 200 | \
+  pnmpsnr -target1=46.07 -target2=52.00 -target3=67.77 - ${test_ppm}
+
+rm ${test_ppm}