Hegel 0.18.3
Property-based testing for C++
Loading...
Searching...
No Matches
hegel::stateful::InvariantParams< T > Struct Template Reference

Arguments for the Invariant constructor. More...

#include <stateful.h>

Public Attributes

std::string name
 The name of the invariant.
bool always_check = false
bool pause_faults = false
std::function< void(const T &)> invariant
 The predicate. It throws when the invariant is violated.

Detailed Description

template<typename T>
struct hegel::stateful::InvariantParams< T >

Arguments for the Invariant constructor.

{.name = "sorted",
.always_check = true,
.invariant = [](const Stack& stack) { ... }});
An invariant is a predicate that must hold at any point in the stateful test. They are evaluated in f...
Definition stateful.h:939
Template Parameters
TThe state-machine type the invariant checks

Member Data Documentation

◆ always_check

template<typename T>
bool hegel::stateful::InvariantParams< T >::always_check = false

If true, check the invariant after every step or round instead of sampling it.

◆ pause_faults

template<typename T>
bool hegel::stateful::InvariantParams< T >::pause_faults = false

If true, fault injection is paused for the duration of each check of the invariant.


The documentation for this struct was generated from the following file: