mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Rename global rng() to sharedRng()
This commit is contained in:
parent
9c72b303d9
commit
359cd6187d
@ -25,7 +25,7 @@ class RandomFloatingGenerator final : public IGenerator<Float> {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
RandomFloatingGenerator(Float a, Float b):
|
RandomFloatingGenerator(Float a, Float b):
|
||||||
m_rng(rng()),
|
m_rng(sharedRng()),
|
||||||
m_dist(a, b) {
|
m_dist(a, b) {
|
||||||
static_cast<void>(next());
|
static_cast<void>(next());
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ class RandomIntegerGenerator final : public IGenerator<Integer> {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
RandomIntegerGenerator(Integer a, Integer b):
|
RandomIntegerGenerator(Integer a, Integer b):
|
||||||
m_rng(rng()),
|
m_rng(sharedRng()),
|
||||||
m_dist(a, b) {
|
m_dist(a, b) {
|
||||||
static_cast<void>(next());
|
static_cast<void>(next());
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ namespace Catch {
|
|||||||
Context::~Context() = default;
|
Context::~Context() = default;
|
||||||
|
|
||||||
|
|
||||||
SimplePcg32& rng() {
|
SimplePcg32& sharedRng() {
|
||||||
static SimplePcg32 s_rng;
|
static SimplePcg32 s_rng;
|
||||||
return s_rng;
|
return s_rng;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ namespace Catch {
|
|||||||
void cleanUpContext();
|
void cleanUpContext();
|
||||||
|
|
||||||
class SimplePcg32;
|
class SimplePcg32;
|
||||||
SimplePcg32& rng();
|
SimplePcg32& sharedRng();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CATCH_CONTEXT_HPP_INCLUDED
|
#endif // CATCH_CONTEXT_HPP_INCLUDED
|
||||||
|
@ -598,7 +598,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void seedRng(IConfig const& config) {
|
void seedRng(IConfig const& config) {
|
||||||
rng().seed(config.rngSeed());
|
sharedRng().seed(config.rngSeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int rngSeed() {
|
unsigned int rngSeed() {
|
||||||
|
Loading…
Reference in New Issue
Block a user