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

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

Issue 358363002: Move platform abstraction to base library (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
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 dc29f1ad00c601ed26bc97df04ac8742461f6e36..ecf941062aee7f280e0667ad96eb3eb6e6bc9efa 100644
--- a/test/cctest/test-random-number-generator.cc
+++ b/test/cctest/test-random-number-generator.cc
@@ -28,8 +28,8 @@
#include "src/v8.h"
#include "test/cctest/cctest.h"
+#include "src/base/utils/random-number-generator.h"
#include "src/isolate-inl.h"
-#include "src/utils/random-number-generator.h"
using namespace v8::internal;
@@ -42,7 +42,7 @@ static const int kRandomSeeds[] = {
TEST(NextIntWithMaxValue) {
for (unsigned n = 0; n < ARRAY_SIZE(kRandomSeeds); ++n) {
- RandomNumberGenerator rng(kRandomSeeds[n]);
+ v8::base::RandomNumberGenerator rng(kRandomSeeds[n]);
for (int max = 1; max <= kMaxRuns; ++max) {
int n = rng.NextInt(max);
CHECK_LE(0, n);
@@ -54,7 +54,7 @@ TEST(NextIntWithMaxValue) {
TEST(NextBoolReturnsBooleanValue) {
for (unsigned n = 0; n < ARRAY_SIZE(kRandomSeeds); ++n) {
- RandomNumberGenerator rng(kRandomSeeds[n]);
+ v8::base::RandomNumberGenerator rng(kRandomSeeds[n]);
for (int k = 0; k < kMaxRuns; ++k) {
bool b = rng.NextBool();
CHECK(b == false || b == true);
@@ -65,7 +65,7 @@ TEST(NextBoolReturnsBooleanValue) {
TEST(NextDoubleRange) {
for (unsigned n = 0; n < ARRAY_SIZE(kRandomSeeds); ++n) {
- RandomNumberGenerator rng(kRandomSeeds[n]);
+ v8::base::RandomNumberGenerator rng(kRandomSeeds[n]);
for (int k = 0; k < kMaxRuns; ++k) {
double d = rng.NextDouble();
CHECK_LE(0.0, d);
@@ -79,9 +79,9 @@ TEST(RandomSeedFlagIsUsed) {
for (unsigned n = 0; n < ARRAY_SIZE(kRandomSeeds); ++n) {
FLAG_random_seed = kRandomSeeds[n];
v8::Isolate* i = v8::Isolate::New();
- RandomNumberGenerator& rng1 =
+ v8::base::RandomNumberGenerator& rng1 =
*reinterpret_cast<Isolate*>(i)->random_number_generator();
- RandomNumberGenerator rng2(kRandomSeeds[n]);
+ v8::base::RandomNumberGenerator rng2(kRandomSeeds[n]);
for (int k = 1; k <= kMaxRuns; ++k) {
int64_t i1, i2;
rng1.NextBytes(&i1, sizeof(i1));

Powered by Google App Engine
This is Rietveld 408576698