Add RandomNumberGenerator adapter to base/rand_util.h
BUG=46679
TEST=none (yet...)
Review URL: http://codereview.chromium.org/3053050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57904 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/rand_util_unittest.cc b/base/rand_util_unittest.cc
index f56c0ec..cbc338a 100644
--- a/base/rand_util_unittest.cc
+++ b/base/rand_util_unittest.cc
@@ -27,3 +27,11 @@
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());
+}