aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/random/random_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/lib/random/random_test.cc')
-rw-r--r--tensorflow/core/lib/random/random_test.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/tensorflow/core/lib/random/random_test.cc b/tensorflow/core/lib/random/random_test.cc
new file mode 100644
index 0000000000..7ed37c8b5e
--- /dev/null
+++ b/tensorflow/core/lib/random/random_test.cc
@@ -0,0 +1,21 @@
+#include "tensorflow/core/lib/random/random.h"
+
+#include <set>
+#include "tensorflow/core/platform/port.h"
+#include <gtest/gtest.h>
+
+namespace tensorflow {
+namespace random {
+namespace {
+
+TEST(New64Test, SanityCheck) {
+ std::set<uint64> values;
+ for (int i = 0; i < 1000000; i++) {
+ uint64 x = New64();
+ EXPECT_TRUE(values.insert(x).second) << "duplicate " << x;
+ }
+}
+
+} // namespace
+} // namespace random
+} // namespace tensorflow