Index: test/cctest/test-random-number-generator.cc |
diff --git a/test/cctest/test-random-number-generator.cc b/test/cctest/test-random-number-generator.cc |
index d2e67c76977e64978f7793ecba9c3405826b0c13..04b58820a208d71c62e49302a5f15d2168504e83 100644 |
--- a/test/cctest/test-random-number-generator.cc |
+++ b/test/cctest/test-random-number-generator.cc |
@@ -34,28 +34,16 @@ |
using namespace v8::internal; |
-static const int kMaxRuns = 12345; |
-static const int kRandomSeeds[] = { |
- -1, 1, 42, 100, 1234567890, 987654321 |
-}; |
+static const int64_t kRandomSeeds[] = {-1, 1, 42, 100, 1234567890, 987654321}; |
TEST(RandomSeedFlagIsUsed) { |
for (unsigned n = 0; n < arraysize(kRandomSeeds); ++n) { |
- FLAG_random_seed = kRandomSeeds[n]; |
+ FLAG_random_seed = static_cast<int>(kRandomSeeds[n]); |
v8::Isolate* i = v8::Isolate::New(); |
- v8::base::RandomNumberGenerator& rng1 = |
+ v8::base::RandomNumberGenerator& rng = |
*reinterpret_cast<Isolate*>(i)->random_number_generator(); |
- v8::base::RandomNumberGenerator rng2(kRandomSeeds[n]); |
- for (int k = 1; k <= kMaxRuns; ++k) { |
- int64_t i1, i2; |
- rng1.NextBytes(&i1, sizeof(i1)); |
- rng2.NextBytes(&i2, sizeof(i2)); |
- CHECK_EQ(i2, i1); |
- CHECK_EQ(rng2.NextInt(), rng1.NextInt()); |
- CHECK_EQ(rng2.NextInt(k), rng1.NextInt(k)); |
- CHECK_EQ(rng2.NextDouble(), rng1.NextDouble()); |
- } |
+ CHECK_EQ(kRandomSeeds[n], rng.initial_seed()); |
i->Dispose(); |
} |
} |