This class implements a helper class to validate the precision of algorithms or objects across multiple iterations.
More...
|
| | ValidationPrecision (const double threshold, const unsigned int minimumIterations=1u) |
| | Creates a new precision-based validation object with specified threshold.
|
| |
| | ValidationPrecision (const double threshold, RandomGenerator &randomGenerator, const unsigned int minimumIterations=1u) |
| | Creates a new validation object associated with a random generator, by default the verified has succeeded.
|
| |
| void | addIteration (const bool accurate) |
| | Explicitly adds a new iteration which is either accurate or not.
|
| |
| void | addIterations (const size_t accurateIterations, const size_t iterations) |
| | Explicitly adds new iterations for which the amount of accurate iterations is known.
|
| |
| uint64_t | iterations () const |
| | Returns the number of iterations in which the precision has been determined.
|
| |
| uint64_t | necessaryIterations () const |
| | Returns the necessary iterations to allow determining success or failure based on the specified success threshold.
|
| |
| bool | needMoreIterations () const |
| | Returns whether the number of iterations is not yet sufficient to determine a success or failure.
|
| |
| bool | succeeded () const override |
| | Returns if this validation has succeeded.
|
| |
| double | accuracy () const |
| | Returns the accuracy of all iterations.
|
| |
| double | threshold () const |
| | Returns the defined threshold.
|
| |
| bool | hasSetFailed () const |
| | Returns whether this validation object has been set to failed explicitly.
|
| |
| | Validation ()=default |
| | Default constructor, by default the validation has succeeded.
|
| |
| | Validation (RandomGenerator &randomGenerator) |
| | Creates a new validation object associated with a random generator, by default the validation has succeeded.
|
| |
| virtual | ~Validation () |
| | Destructs this validation object.
|
| |
| void | expectTrue (const bool value) |
| | Informs this validation object that a value is expected to be True.
|
| |
| void | expectTrue (const bool value, const char *file, const int line) |
| | Informs this validation object that a value is expected to be True.
|
| |
| void | expectFalse (const bool value) |
| | Informs this validation object that a value is expected to be False.
|
| |
| void | expectFalse (const bool value, const char *file, const int line) |
| | Informs this validation object that a value is expected to be False.
|
| |
| template<typename T > |
| void | expectEqual (const T &value0, const T &value1) |
| | Informs this validation object that a value is expected to be equal to another value.
|
| |
| template<typename T > |
| void | expectEqual (const T &value0, const T &value1, const char *file, const int line) |
| | Informs this validation object that a value is expected to be equal to another value.
|
| |
| template<typename T > |
| void | expectNotEqual (const T &value0, const T &value1) |
| | Informs this validation object that a value is expected to be not equal to another value.
|
| |
| template<typename T > |
| void | expectNotEqual (const T &value0, const T &value1, const char *file, const int line) |
| | Informs this validation object that a value is expected to be not equal to another value.
|
| |
| template<typename T > |
| void | expectLess (const T &value0, const T &value1) |
| | Informs this validation object that a value is expected to be less than another value.
|
| |
| template<typename T > |
| void | expectLess (const T &value0, const T &value1, const char *file, const int line) |
| | Informs this validation object that a value is expected to be less than another value.
|
| |
| template<typename T > |
| void | expectLessEqual (const T &value0, const T &value1) |
| | Informs this validation object that a value is expected to be less than or equal to another value.
|
| |
| template<typename T > |
| void | expectLessEqual (const T &value0, const T &value1, const char *file, const int line) |
| | Informs this validation object that a value is expected to be less than or equal to another value.
|
| |
| template<typename T > |
| void | expectGreater (const T &value0, const T &value1) |
| | Informs this validation object that a value is expected to be greater than another value.
|
| |
| template<typename T > |
| void | expectGreater (const T &value0, const T &value1, const char *file, const int line) |
| | Informs this validation object that a value is expected to be greater than another value.
|
| |
| template<typename T > |
| void | expectGreaterEqual (const T &value0, const T &value1) |
| | Informs this validation object that a value is expected to be greater than or equal to another value.
|
| |
| template<typename T > |
| void | expectGreaterEqual (const T &value0, const T &value1, const char *file, const int line) |
| | Informs this validation object that a value is expected to be greater than or equal to another value.
|
| |
| template<typename T > |
| void | expectInsideRange (const T &lower, const T &value, const T &upper) |
| | Informs this validation object that a value is expected to be inside a range.
|
| |
| template<typename T > |
| void | expectInsideRange (const T &lower, const T &value, const T &upper, const char *file, const int line) |
| | Informs this validation object that a value is expected to be inside a range.
|
| |
| void | setFailed () |
| | Explicitly sets the validation to be failed.
|
| |
| void | setFailed (const char *file, const int line) |
| | Explicitly sets the validation to be failed.
|
| |
| bool | succeededSoFar () const |
| | Returns whether this validation has succeeded so far.
|
| |
| std::string | randomGeneratorOutput () const |
| | Returns a string containing the random generator's initial seed, if any.
|
| |
This class implements a helper class to validate the precision of algorithms or objects across multiple iterations.
The main purpose is to allow a configurable percentage of iterations to be imprecise while still considering the overall test as successful. This class inherits from Validation and extends it with precision-based validation capabilities. As this class inherits from Validation, the entire validation can also be invalidated using base class methods (e.g., OCEAN_EXPECT_TRUE, OCEAN_SET_FAILED) for errors unrelated to precision.
- See also
- Validation, ScopedIteration.