List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:October 17 2008 10:16am
Subject:Re: bzr commit into mysql-6.0-falcon-team branch (klewis:2865)
Bug#39672
View as plain text  
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
Thread
bzr commit into mysql-6.0-falcon-team branch (klewis:2865) Bug#39672Kevin Lewis16 Oct
  • RE: bzr commit into mysql-6.0-falcon-team branch (klewis:2865)Bug#39672Vladislav Vaintroub17 Oct
    • Re: bzr commit into mysql-6.0-falcon-team branch (klewis:2865)Bug#39672Sergei Golubchik17 Oct
      • RE: bzr commit into mysql-6.0-falcon-team branch (klewis:2865)Bug#39672Vladislav Vaintroub17 Oct