Hegel 0.3.5
Property-based testing for C++
Loading...
Searching...
No Matches
random.h
1#pragma once
2
3#include <cstdint>
4#include <optional>
5#include <random>
6
7#include "hegel/core.h"
8#include "hegel/generators/numeric.h"
9
10namespace hegel::generators {
11
17 false;
22 };
23
42 public:
44 using result_type = uint32_t;
45
54 explicit HegelRandom(const TestCase& tc);
55
64 explicit HegelRandom(uint64_t seed);
65
66 static constexpr result_type min() {
67 return std::numeric_limits<result_type>::min();
68 }
69
70 static constexpr result_type max() {
71 return std::numeric_limits<result_type>::max();
72 }
73
75 result_type operator()();
77
78 private:
79 const TestCase* tc_ = nullptr;
80 std::optional<std::mt19937> engine_;
81 };
82
85
118
120
121} // namespace hegel::generators
Handle to the currently-executing test case.
Definition test_case.h:34
The base class of all generators.
Definition core.h:157
A random engine that integrates with Hypothesis via Hegel.
Definition random.h:41
Hegel generators.
Definition core.h:16
Generator< HegelRandom > randoms(RandomsParams params={})
Generate random number generators.
Parameters for randoms() generator.
Definition random.h:15
bool use_true_random
Definition random.h:16