Wire Sysio
Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_random_number_generator.cpp
Go to the documentation of this file.
1
/*
2
* Created by Martin on 30/08/2017.
3
*
4
* Distributed under the Boost Software License, Version 1.0. (See accompanying
5
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
*/
7
8
#include "
catch_random_number_generator.h
"
9
#include "
catch_context.h
"
10
#include "
catch_interfaces_config.h
"
11
12
namespace
Catch
{
13
14
std::mt19937&
rng
() {
15
static
std::mt19937 s_rng;
16
return
s_rng;
17
}
18
19
void
seedRng
(
IConfig
const
&
config
) {
20
if
(
config
.rngSeed() != 0 ) {
21
std::srand(
config
.rngSeed() );
22
rng
().seed(
config
.rngSeed() );
23
}
24
}
25
26
unsigned
int
rngSeed
() {
27
return
getCurrentContext
().
getConfig
()->rngSeed();
28
}
29
}
catch_context.h
catch_interfaces_config.h
catch_random_number_generator.h
config
Definition
permessage_deflate.cpp:42
Catch
Definition
231-Cfg-OutputStreams.cpp:32
Catch::seedRng
void seedRng(IConfig const &config)
Definition
catch_random_number_generator.cpp:19
Catch::getCurrentContext
IContext & getCurrentContext()
Definition
catch_context.h:52
Catch::rngSeed
unsigned int rngSeed()
Definition
catch_random_number_generator.cpp:26
Catch::rng
std::mt19937 & rng()
Definition
catch_random_number_generator.cpp:14
Catch::IConfig
Definition
catch.hpp:4023
Catch::IContext::getConfig
virtual IConfigPtr const & getConfig() const =0
libraries
sys-vm
external
Catch2
include
internal
catch_random_number_generator.cpp
Generated by
1.12.0