Hi, Vladislav!
On Oct 17, Vladislav Vaintroub wrote:
> Kevin,
>
> a) I do not think rand() has place in unit tests.
> Unit tests is meant to be predictable, could you please rewrite without
> using this function.
> If you absolutely need to use this functionality, please use self-written
> linear congruential generator
> (http://en.wikipedia.org/wiki/Linear_congruential_generator )to make
> behavior independent from the compiler runtime library used.
Just a comment.
I use rand quite a lot in the unit tests. It doesn't make them
non-predictable, when few hundred threads repeat some operation
concurrently few thousand times, statistically result will be the same,
rand or not. I use my_rnd(), though, not system rand().
Regards / Mit vielen Grüßen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Häring