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

Unified Diff: src/base/utils/random-number-generator-unittest.cc

Issue 615393002: Move unit tests to test/unittests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 3 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/base/sys-info-unittest.cc ('k') | src/compiler/arm/instruction-selector-arm-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/utils/random-number-generator-unittest.cc
diff --git a/src/base/utils/random-number-generator-unittest.cc b/src/base/utils/random-number-generator-unittest.cc
deleted file mode 100644
index 7c533db4f07abeee8b10b6110fe2b85e0bf8943f..0000000000000000000000000000000000000000
--- a/src/base/utils/random-number-generator-unittest.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <climits>
-
-#include "src/base/utils/random-number-generator.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace v8 {
-namespace base {
-
-class RandomNumberGeneratorTest : public ::testing::TestWithParam<int> {};
-
-
-static const int kMaxRuns = 12345;
-
-
-TEST_P(RandomNumberGeneratorTest, NextIntWithMaxValue) {
- RandomNumberGenerator rng(GetParam());
- for (int max = 1; max <= kMaxRuns; ++max) {
- int n = rng.NextInt(max);
- EXPECT_LE(0, n);
- EXPECT_LT(n, max);
- }
-}
-
-
-TEST_P(RandomNumberGeneratorTest, NextBooleanReturnsFalseOrTrue) {
- RandomNumberGenerator rng(GetParam());
- for (int k = 0; k < kMaxRuns; ++k) {
- bool b = rng.NextBool();
- EXPECT_TRUE(b == false || b == true);
- }
-}
-
-
-TEST_P(RandomNumberGeneratorTest, NextDoubleReturnsValueBetween0And1) {
- RandomNumberGenerator rng(GetParam());
- for (int k = 0; k < kMaxRuns; ++k) {
- double d = rng.NextDouble();
- EXPECT_LE(0.0, d);
- EXPECT_LT(d, 1.0);
- }
-}
-
-
-INSTANTIATE_TEST_CASE_P(RandomSeeds, RandomNumberGeneratorTest,
- ::testing::Values(INT_MIN, -1, 0, 1, 42, 100,
- 1234567890, 987654321, INT_MAX));
-
-} // namespace base
-} // namespace v8
« no previous file with comments | « src/base/sys-info-unittest.cc ('k') | src/compiler/arm/instruction-selector-arm-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698