##// END OF EJS Templates
Some refactoring on PB11 wrappers...
Some refactoring on PB11 wrappers Most sciqlop core wrappers are moved into a dedicated python module. We needs to get rid off sqpapp! All current sciqlop modules should either be stateless or act as real singletons they must not need any app to be used. This will ease testing, wrapping and usage. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1175:9f9ab053f00b
r1341:f18e017310bc
Show More
FuzzingUtils.cpp
25 lines | 527 B | text/x-c | CppLexer
Alexandre Leroux
Adds utility class to get random values
r1175 #include "FuzzingUtils.h"
RandomGenerator &RandomGenerator::instance()
{
static auto instance = RandomGenerator();
return instance;
}
double RandomGenerator::generateDouble(double min, double max)
{
std::uniform_real_distribution<double> dist{min, max};
return dist(m_Mt);
}
int RandomGenerator::generateInt(int min, int max)
{
std::uniform_int_distribution<int> dist{min, max};
return dist(m_Mt);
}
RandomGenerator::RandomGenerator()
{
std::random_device rd{};
m_Mt = std::mt19937{rd()};
}