diff --git a/tests/random-utils.hh b/tests/random-utils.hh index e2bdf79641..80ace220f9 100644 --- a/tests/random-utils.hh +++ b/tests/random-utils.hh @@ -129,9 +129,14 @@ Real get_real() { return get_real(Real{0}, std::numeric_limits::max(), gen()); } -inline bool get_bool() { +template +inline bool get_bool(RandomEngine& engine) { static std::bernoulli_distribution dist; - return dist(gen()); + return dist(engine); +} + +inline bool get_bool() { + return get_bool(gen()); } inline bytes get_bytes(size_t n) {