forked from github/server
reset rng injection before runnign test.
This commit is contained in:
parent
dd23307e8e
commit
9c8df88525
|
@ -1,16 +1,17 @@
|
||||||
#ifdef _MSC_VER
|
#include "rng.h"
|
||||||
#include <platform.h>
|
#include "rand.h"
|
||||||
#endif
|
#include "tests.h"
|
||||||
|
|
||||||
#include <CuTest.h>
|
#include <CuTest.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "rng.h"
|
|
||||||
#include "rand.h"
|
|
||||||
|
|
||||||
static void test_rng_round(CuTest * tc)
|
static void test_rng_round(CuTest * tc)
|
||||||
{
|
{
|
||||||
double f = rng_double();
|
double f, r;
|
||||||
double r = RAND_ROUND(f);
|
|
||||||
|
test_setup();
|
||||||
|
f = rng_double();
|
||||||
|
r = RAND_ROUND(f);
|
||||||
CuAssertTrue(tc, f >= 0);
|
CuAssertTrue(tc, f >= 0);
|
||||||
CuAssertTrue(tc, r <= f + 1);
|
CuAssertTrue(tc, r <= f + 1);
|
||||||
CuAssertTrue(tc, r >= f);
|
CuAssertTrue(tc, r >= f);
|
||||||
|
|
Loading…
Reference in New Issue