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:
|
||||
|
||||
RandomFloatingGenerator(Float a, Float b):
|
||||
m_rng(rng()),
|
||||
m_rng(sharedRng()),
|
||||
m_dist(a, b) {
|
||||
static_cast<void>(next());
|
||||
}
|
||||
@ -47,7 +47,7 @@ class RandomIntegerGenerator final : public IGenerator<Integer> {
|
||||
public:
|
||||
|
||||
RandomIntegerGenerator(Integer a, Integer b):
|
||||
m_rng(rng()),
|
||||
m_rng(sharedRng()),
|
||||
m_dist(a, b) {
|
||||
static_cast<void>(next());
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ namespace Catch {
|
||||
Context::~Context() = default;
|
||||
|
||||
|
||||
SimplePcg32& rng() {
|
||||
SimplePcg32& sharedRng() {
|
||||
static SimplePcg32 s_rng;
|
||||
return s_rng;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ namespace Catch {
|
||||
void cleanUpContext();
|
||||
|
||||
class SimplePcg32;
|
||||
SimplePcg32& rng();
|
||||
SimplePcg32& sharedRng();
|
||||
}
|
||||
|
||||
#endif // CATCH_CONTEXT_HPP_INCLUDED
|
||||
|
@ -598,7 +598,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
void seedRng(IConfig const& config) {
|
||||
rng().seed(config.rngSeed());
|
||||
sharedRng().seed(config.rngSeed());
|
||||
}
|
||||
|
||||
unsigned int rngSeed() {
|
||||
|
Loading…
Reference in New Issue
Block a user