Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Unified Diff: test/cctest/test-random-number-generator.cc

Issue 333053002: Untangle RNG from v8 core (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/random-number-generator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b8cf860d19edebdc31050be9d7fce7fd2225a4e3..db7ec758200c1840137e3be7e3de561c77978f15 100644
--- a/test/cctest/test-random-number-generator.cc
+++ b/test/cctest/test-random-number-generator.cc
@@ -28,6 +28,7 @@
#include "src/v8.h"
#include "src/utils/random-number-generator.h"
+#include "src/isolate-inl.h"
#include "test/cctest/cctest.h"
using namespace v8::internal;
@@ -77,7 +78,9 @@ TEST(NextDoubleRange) {
TEST(RandomSeedFlagIsUsed) {
for (unsigned n = 0; n < ARRAY_SIZE(kRandomSeeds); ++n) {
FLAG_random_seed = kRandomSeeds[n];
- RandomNumberGenerator rng1;
+ v8::Isolate* i = v8::Isolate::New();
+ RandomNumberGenerator& rng1 =
+ *reinterpret_cast<Isolate*>(i)->random_number_generator();
RandomNumberGenerator rng2(kRandomSeeds[n]);
for (int k = 1; k <= kMaxRuns; ++k) {
int64_t i1, i2;
@@ -88,5 +91,6 @@ TEST(RandomSeedFlagIsUsed) {
CHECK_EQ(rng2.NextInt(k), rng1.NextInt(k));
CHECK_EQ(rng2.NextDouble(), rng1.NextDouble());
}
+ i->Dispose();
}
}
« no previous file with comments | « src/utils/random-number-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698