| 27 | namespace { |
| 28 | |
| 29 | TEST(SimplePhiloxTest, FloatTest) { |
| 30 | PhiloxRandom philox(7, 7); |
| 31 | SimplePhilox gen(&philox); |
| 32 | static const int kIters = 1000000; |
| 33 | for (int i = 0; i < kIters; ++i) { |
| 34 | float f = gen.RandFloat(); |
| 35 | EXPECT_LE(0.0f, f); |
| 36 | EXPECT_GT(1.0f, f); |
| 37 | } |
| 38 | for (int i = 0; i < kIters; ++i) { |
| 39 | double d = gen.RandDouble(); |
| 40 | EXPECT_LE(0.0, d); |
| 41 | EXPECT_GT(1.0, d); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | static void DifferenceTest(const char *names, SimplePhilox *gen1, |
| 46 | SimplePhilox *gen2) { |
nothing calls this directly
no test coverage detected