about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-03-30 23:24:06 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-03-30 23:24:06 +0000
commit6737c1c1207226f61babd97adf501b2c8aa79d71 (patch)
treee38b1d5ca49a6dfdbdf79a90c40b0213ca1bcfc6 /test
parentad689dcc56c62d61cf01516b3ed49580c83989d7 (diff)
downloadnetpbm-mirror-6737c1c1207226f61babd97adf501b2c8aa79d71.tar.gz
netpbm-mirror-6737c1c1207226f61babd97adf501b2c8aa79d71.tar.xz
netpbm-mirror-6737c1c1207226f61babd97adf501b2c8aa79d71.zip
Add comments
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4079 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'test')
-rwxr-xr-xtest/random-generator.test24
1 files changed, 21 insertions, 3 deletions
diff --git a/test/random-generator.test b/test/random-generator.test
index 88c9d31d..ef204e4b 100755
--- a/test/random-generator.test
+++ b/test/random-generator.test
@@ -2,6 +2,22 @@
 # This script tests: pgmnoise
 # Also requires:
 
+# These tests are for examining the integrity of the random number
+# generator.  There is some overlap between the tests here and tests
+# in pgmnoise.test, but the tests here are better focused for
+# diagnosing problems with the random number generator.
+#
+# Test 1 is for determining the kind of random number generator in
+# use.
+#
+# Test 2 prints random numbers in an output format close to what the
+# test in the original Mersenne Twister code produces.
+#
+# If these tests fail, subsequent tests which depend on random numbers
+# will fail too.  There is no provision (beyond remarks in the script
+# files) for generators other than the Mersenne Twister in those
+# tests.
+
 echo "Test 1: Should produce:"
 
 echo "P2"
@@ -42,9 +58,11 @@ perlPgmProcessorProgram='
 pgmnoise -randomseed=5489 -plain -maxval=65535 10 200 | tee /tmp/z |
   perl -walne "$perlPgmProcessorProgram"
 
+# The above outputs (10 * 200 / 2) = 1000 samples.
+
 #    Method to generate output for Test 2 from original
 #    Mersenne Twister source code
-
+#
 # Download Mersenne Twister code.  See lib/util/randmersenne.c for URL.
 # Edit mt19937ar.c:
 #   In function main() at bottom of file, replace
@@ -64,5 +82,5 @@ pgmnoise -randomseed=5489 -plain -maxval=65535 10 200 | tee /tmp/z |
 # The number of samples must be larger than 624 to ensure proper
 # generation in batches after the first.
 
-
-
+# If you encounter problems, adjust the 200 (rows) above and tweak
+# the code in mt19937ar.c accordingly to produce more random numbers.