rand: remove narrowing cast warning in test

This commit is contained in:
Danny Robson 2014-12-16 15:29:26 +11:00
parent 557842441f
commit 7c8562407f

View File

@ -13,7 +13,7 @@ using namespace std;
void void
test_bool (void) { test_bool (void) {
static const unsigned ITERATIONS = 8192; static const unsigned ITERATIONS = 8192;
static const unsigned THRESHOLD = ITERATIONS * 0.1; static const unsigned THRESHOLD = ITERATIONS / 10;
unsigned counts[2] = { 0, 0 }; unsigned counts[2] = { 0, 0 };
for (unsigned i = 0; i < ITERATIONS; ++i) for (unsigned i = 0; i < ITERATIONS; ++i)
@ -33,7 +33,7 @@ test_float (void) {
static const unsigned BUCKETS = 8; static const unsigned BUCKETS = 8;
static const unsigned ITERATIONS = 8912; static const unsigned ITERATIONS = 8912;
static const unsigned EXPECTED = ITERATIONS / BUCKETS; static const unsigned EXPECTED = ITERATIONS / BUCKETS;
static const float THRESHOLD = EXPECTED * 0.1; static const float THRESHOLD = EXPECTED / 10;
unsigned counts[BUCKETS] = { 0 }; unsigned counts[BUCKETS] = { 0 };
for (unsigned i = 0; i < ITERATIONS; ++i) for (unsigned i = 0; i < ITERATIONS; ++i)