summaryrefslogtreecommitdiff
path: root/src/mongo/platform/random_test.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-11-12 10:40:07 -0500
committerEliot Horowitz <eliot@10gen.com>2012-11-12 10:41:09 -0500
commitb74de7eadee1fb15527a915aae0b68b823251a66 (patch)
treea85b46492e15d5a238bbd9a478737128419a2cb0 /src/mongo/platform/random_test.cpp
parent6b5c84d267c283babf22155c956764a78d5ad5d2 (diff)
downloadmongo-b74de7eadee1fb15527a915aae0b68b823251a66.tar.gz
make a SecureRandom class
Diffstat (limited to 'src/mongo/platform/random_test.cpp')
-rw-r--r--src/mongo/platform/random_test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/platform/random_test.cpp b/src/mongo/platform/random_test.cpp
index 10001306945..67084ab5c37 100644
--- a/src/mongo/platform/random_test.cpp
+++ b/src/mongo/platform/random_test.cpp
@@ -29,4 +29,17 @@ namespace mongo {
ASSERT_EQUALS( a.nextInt32(), b.nextInt32() );
}
}
+
+ TEST( RandomTest, Secure1 ) {
+ SecureRandom* a = SecureRandom::create();
+ SecureRandom* b = SecureRandom::create();
+
+ for ( int i = 0; i< 100; i++ ) {
+ ASSERT_NOT_EQUALS( a->nextInt64(), b->nextInt64() );
+ }
+
+ delete a;
+ delete b;
+
+ }
}