Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/generators/catch_generators_random.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-05-17 17:57:15 +0200
committerMartin Hořeňovský2022-05-17 17:57:21 +0200
commit7a2a6c632feb7d6e438671b8520beb80efd60ad2 (patch)
treea2ed263dca51619468153ee267e81419496b41e8 /src/catch2/generators/catch_generators_random.cpp
parent359cd6187d7e8fe40dec82e77bafe5066115cb53 (diff)
downloadcatch3-7a2a6c632feb7d6e438671b8520beb80efd60ad2.tar.gz
Make Random*Generators be seedable
This is a necessary step to fix issue with combining multiple random generators in one test case, with different section nesting.
Diffstat (limited to 'src/catch2/generators/catch_generators_random.cpp')
-rw-r--r--src/catch2/generators/catch_generators_random.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/catch2/generators/catch_generators_random.cpp b/src/catch2/generators/catch_generators_random.cpp
new file mode 100644
index 00000000..57ad1745
--- /dev/null
+++ b/src/catch2/generators/catch_generators_random.cpp
@@ -0,0 +1,13 @@
+
+// Copyright Catch2 Authors
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// https://www.boost.org/LICENSE_1_0.txt)
+
+// SPDX-License-Identifier: BSL-1.0
+
+#include <catch2/generators/catch_generators_random.hpp>
+
+#include <catch2/internal/catch_context.hpp>
+
+std::uint32_t Catch::Generators::Detail::getSeed() { return sharedRng()(); }