fix further test glitches (due to using real random numbers now)

This commit is contained in:
Fischlurch 2011-10-23 22:06:32 +02:00
parent 9c04637aea
commit f7a3fdb7a5
3 changed files with 13 additions and 3 deletions

View file

@ -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;

View file

@ -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);

View file

@ -25,6 +25,7 @@
#include "lib/util.hpp"
#include <cmath>
#include <time.h>
#include <vector>
#include <iostream>
#include <boost/format.hpp>