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

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_context.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-10-06 21:47:54 +0200
committerMartin Hořeňovský2019-10-07 19:56:23 +0200
commit535da5c5132bcbba6f29c60ed6bb7ded29b9ec3e (patch)
tree2cf1263bd8d3707e1f4087885dbdf7fa5a7ed84c /include/internal/catch_context.cpp
parent319cb9e1daec5076ff1a3acd10b959c2bce05c5b (diff)
downloadcatch3-535da5c5132bcbba6f29c60ed6bb7ded29b9ec3e.tar.gz
Introduce Catch's own RNG based on the PCG family of RNGs
In the future, we will also want to introduce our own `uniform_int_distribution` and `uniform_real_distribution` to get repeatable test runs across different platforms.
Diffstat (limited to 'include/internal/catch_context.cpp')
-rw-r--r--include/internal/catch_context.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/internal/catch_context.cpp b/include/internal/catch_context.cpp
index 52fca302..e444a6b3 100644
--- a/include/internal/catch_context.cpp
+++ b/include/internal/catch_context.cpp
@@ -7,6 +7,7 @@
*/
#include "catch_context.h"
#include "catch_common.h"
+#include "catch_random_number_generator.h"
namespace Catch {
@@ -59,4 +60,11 @@ namespace Catch {
IContext::~IContext() = default;
IMutableContext::~IMutableContext() = default;
Context::~Context() = default;
+
+
+ SimplePcg32& rng() {
+ static SimplePcg32 s_rng;
+ return s_rng;
+ }
+
}