|Title||Test case seed generation is not random enough|
|Assigned user||Gareth Rees|
|Description||Test case seed generation in the function randomize() in testlib.c  is not very good, the output of time() is in seconds. This means that you if run a fast test case many times in succession, you get at most one different run per second.|
|Analysis||The comment in testlib.c  line 269 says|
/* time_t uses an arbitrary encoding, but hopefully the low order */
/* 31 bits will have at least one bit changed from run to run. */
but time() "shall return the value of time in seconds since the Epoch" .
This should use a clock with higher resolution, perhaps gettimeofday(), but we need to check that it's available on all the platforms we support, and that we don't break compatibility of old random number seeds.
|Created by||Gareth Rees|
|Created on||2013-05-15 16:46:24|
|Last modified by||Gareth Rees|
|Last modified on||2013-05-16 13:17:42|
|History||2013-05-15 GDR Created.|
|181855||closed||2013-05-16 13:17:42||Gareth Rees||EventClock has enough entropy on all the platforms we support that we can use it to choose the random number seed.|