(RANDOM, SRANDOM): New, to allow overriding the PRNG on the compiler

command line for reproducible automated tests.  This is expected to be
a temporary solution until we get more capable system configuration.
Callers of random(), srandom() changed.  From Marc Olzheim.
This commit is contained in:
Markus Armbruster 2004-03-23 15:05:20 +00:00
parent 43c511e8ad
commit 0608bff5b4

View file

@ -121,7 +121,13 @@ static int DISTINCT_ISLANDS = 1;
#if !defined(_WIN32)
#define max(a,b) (a>b?a:b)
#endif
#define rnd(x) (random() % (x))
#ifndef SRANDOM
#define SRANDOM srandom
#endif
#ifndef RANDOM
#define RANDOM random
#endif
#define rnd(x) (RANDOM() % (x))
int secs; /* number of sectors grown */
int ctot; /* total number of continents and islands grown */
@ -221,7 +227,7 @@ main(int argc, char *argv[])
}
}
#endif
srandom(rnd_seed);
SRANDOM(rnd_seed);
if (config_file == NULL) {
sprintf(tbuf, "%s/econfig", datadir);
config_file = tbuf;