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.
This commit is contained in:
Martin Hořeňovský
2019-10-06 21:47:54 +02:00
parent 319cb9e1da
commit 535da5c513
14 changed files with 565 additions and 23 deletions

View File

@@ -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;
}
}