about summary refs log tree commit diff
path: root/absl/random/bernoulli_distribution_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/random/bernoulli_distribution_test.cc')
-rw-r--r--absl/random/bernoulli_distribution_test.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/absl/random/bernoulli_distribution_test.cc b/absl/random/bernoulli_distribution_test.cc
index 5581af502641..b250f8787c6e 100644
--- a/absl/random/bernoulli_distribution_test.cc
+++ b/absl/random/bernoulli_distribution_test.cc
@@ -21,6 +21,7 @@
 #include <utility>
 
 #include "gtest/gtest.h"
+#include "absl/random/internal/pcg_engine.h"
 #include "absl/random/internal/sequence_urbg.h"
 #include "absl/random/random.h"
 
@@ -63,7 +64,10 @@ TEST_P(BernoulliTest, Accuracy) {
   size_t trials = para.second;
   double p = para.first;
 
-  absl::InsecureBitGen rng;
+  // We use a fixed bit generator for distribution accuracy tests.  This allows
+  // these tests to be deterministic, while still testing the qualify of the
+  // implementation.
+  absl::random_internal::pcg64_2018_engine rng(0x2B7E151628AED2A6);
 
   size_t yes = 0;
   absl::bernoulli_distribution dist(p);