Tests and RNG
Derek Atkins
warlord at MIT.EDU
Wed Feb 8 13:46:58 EST 2006
Unfortunately there's just no good way to do this.. There's no
way to record the initial random seed after-the-fact, because
it's actually initialized in libqof (in guid.c, in fact). Also,
there's just not a good infrastructure to set an initial random
seed for the tests during the standard "make check" sequence.
Many tests do have a commented-out srand(1) to re-inialize the RNG
in order to make a deterministic test. However, /most/ of the
time the bugs we find through the RNG are bugs in the test, not
bugs in the code being tested.
-derek
"cxl000 at hotmail.com" <cxl000 at hotmail.com> writes:
> I have seen mentioned a number of times were the inital seed for the RNG
> can effect the outcome of the test because under some conditions it may
> trigger a bug and that the current test infrastructure does not help in
> being able to reproduce these problems.
>
> I would like to suggest that test be change to take an optional seed and
> to report the seed being used.
> The default behavior is not changed allowing a wide range of random
> conditions to be tested but when a test does fail the seed used can be
> found in the logs and provided to allow reporoducing the problem.
>
> Regards,
> Chris Leach
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel
mailing list