]> git.draconx.ca Git - cdecl99.git/commitdiff
tests: Limit automatic random seed to 8 digits.
authorNick Bowler <nbowler@draconx.ca>
Sat, 27 Jan 2024 01:52:25 +0000 (20:52 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 27 Jan 2024 01:52:25 +0000 (20:52 -0500)
In the event that the test_strtoumax can only convert 32-bit types for
whatever reason, attempting to pass values >= 2**32 spits an error.

We don't need this kind of excess range for the automatic random seed.
Just truncate it to 8 digits which will always fit in 32 bits.

testsuite.at

index 328f4273654c0c65366879cf0b21e0028ea1ff12..f47ad86d640e860a904eb50641aef1982c5cf99e 100644 (file)
@@ -30,7 +30,8 @@ m4_divert_pop([PREPARE_TESTS])
 AT_ARG_OPTION_ARG([random-seed],
   [AS_HELP_STRING([--random-seed=ARG],
     [Integer seed for randomized testing (default: auto)])],
-  [random_seed=$at_optarg], [random_seed=$RANDOM$$])
+  [random_seed=$at_optarg],
+  [random_seed=`echo $RANDOM$$ | sed 's/\(........\).*/\1/'`])#'
 
 AT_ARG_OPTION_ARG([random-iterations],
   [AS_HELP_STRING([--random-iterations=N],