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

Unified Diff: base/rand_util_unittest.cc

Issue 3053050: Add RandomNumberGenerator adapter to base/rand_util.h (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Compile on Windows, too... Created 10 years, 4 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: base/rand_util_unittest.cc
diff --git a/base/rand_util_unittest.cc b/base/rand_util_unittest.cc
index f56c0ece09421ae098bc8ddca7b81138217714ae..cbc338a3b4eec23299af3c4a7d97082ed60904d0 100644
--- a/base/rand_util_unittest.cc
+++ b/base/rand_util_unittest.cc
@@ -27,3 +27,11 @@ TEST(RandUtilTest, RandDouble) {
EXPECT_GT(1.0, number);
EXPECT_LE(0.0, number);
}
+
+// Make sure that it is still appropriate to use RandGenerator in conjunction
+// with std::random_shuffle().
+TEST(RandUtilTest, RandGeneratorForRandomShuffle) {
+ EXPECT_EQ(base::RandGenerator(1), 0U);
+ EXPECT_LE(std::numeric_limits<ptrdiff_t>::max(),
+ std::numeric_limits<int64>::max());
+}

Powered by Google App Engine
This is Rietveld 408576698