| 43 | } |
| 44 | |
| 45 | static void DifferenceTest(const char *names, SimplePhilox *gen1, |
| 46 | SimplePhilox *gen2) { |
| 47 | static const int kIters = 100; |
| 48 | bool different = false; |
| 49 | for (int i = 0; i < kIters; ++i) { |
| 50 | if (gen1->Rand32() != gen2->Rand32()) { |
| 51 | different = true; |
| 52 | break; |
| 53 | } |
| 54 | } |
| 55 | CHECK(different) << "different seeds but same output!"; |
| 56 | } |
| 57 | |
| 58 | TEST(SimplePhiloxTest, DifferenceTest) { |
| 59 | PhiloxRandom philox1(1, 1), philox2(17, 17); |