fix further test glitches (due to using real random numbers now)
This commit is contained in:
parent
9c04637aea
commit
f7a3fdb7a5
3 changed files with 13 additions and 3 deletions
|
|
@ -117,7 +117,7 @@ namespace test{
|
|||
virtual long
|
||||
apiFunc()
|
||||
{
|
||||
long rr = ii * (rand() % MAX_RAND);
|
||||
long rr = ii * (1 + rand() % MAX_RAND);
|
||||
mark (rr);
|
||||
_callSum += rr;
|
||||
return rr;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "lib/time/digxel.hpp"
|
||||
#include "lib/util.hpp"
|
||||
|
||||
#include <time.h>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <boost/format.hpp>
|
||||
|
|
@ -55,7 +56,15 @@ namespace test{
|
|||
{
|
||||
double arbitrary = (rand() % RAND_RANGE);
|
||||
arbitrary /= (1 + rand() % RAND_DENOM);
|
||||
return arbitrary;
|
||||
|
||||
static double prevVal;
|
||||
if (arbitrary != prevVal)
|
||||
{
|
||||
prevVal = arbitrary;
|
||||
return arbitrary;
|
||||
}
|
||||
else
|
||||
return randomFrac();
|
||||
}
|
||||
|
||||
inline uint
|
||||
|
|
@ -267,7 +276,7 @@ namespace test{
|
|||
|
||||
CHECK (d1 == d2);
|
||||
|
||||
double someValue = randomFrac();
|
||||
double someValue = d1 + randomFrac();
|
||||
d1 = someValue;
|
||||
|
||||
CHECK (d1 == someValue);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "lib/util.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <time.h>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <boost/format.hpp>
|
||||
|
|
|
|||
Loading…
Reference in a new issue