From e5751cbf159ac465c80e7071e88b455e4cf8a1c7 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 17 Apr 2021 01:18:41 +0000 Subject: New ppmforge test, add recently added tests to Test-Order git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4086 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- test/Test-Order | 8 ++++++++ test/ppmforge.ok | 11 ++++++++++- test/ppmforge.test | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 66 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/Test-Order b/test/Test-Order index aaf46985..6f4334af 100644 --- a/test/Test-Order +++ b/test/Test-Order @@ -2,6 +2,7 @@ all-in-place.test legacy-names.test +random-generator.test # Generator tests @@ -61,6 +62,7 @@ pnmtopnm-plain.test pamdepth.test pamditherbw.test +pamditherbw-random.test pamhue.test pbmclean.test @@ -77,7 +79,11 @@ ppmchange.test pambackground.test pnmpaste-pbm.test +ppmshift.test +ppmspread.test + pbmpscale.test +pamrecolor.test pnmremap1.test pnmremap2.test pnmquant.test @@ -136,6 +142,7 @@ ppmdfont.test pamfix.test pamvalidate.test pamexec.test +pbmlife.test # Round-trip tests : editors @@ -157,6 +164,7 @@ pamhue-roundtrip.test # Round-trip tests: miscellaneous utilities +pamendian-roundtrip.test pamexec-roundtrip.test channel-stack-roundtrip.test diff --git a/test/ppmforge.ok b/test/ppmforge.ok index e4a4c9e2..2f3f9501 100644 --- a/test/ppmforge.ok +++ b/test/ppmforge.ok @@ -1 +1,10 @@ -3634219838 196623 +Test 1. Should print: 547829788 196623 (Mersenne Twister) +547829788 196623 +Test 2. +match +Test 3. +match +Test 4. +match +Test 5. +match diff --git a/test/ppmforge.test b/test/ppmforge.test index 3ebea88c..959eb360 100755 --- a/test/ppmforge.test +++ b/test/ppmforge.test @@ -1,9 +1,52 @@ #! /bin/bash # 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=53.89 -target2=49.38 -target3=65.15 - ${test_ppm} + +rm ${test_ppm} -- cgit 1.4.1