reset rng injection before runnign test.

This commit is contained in:
Enno Rehling 2021-03-12 20:43:43 +01:00
parent dd23307e8e
commit 9c8df88525
1 changed files with 9 additions and 8 deletions

View File

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