Checking the validity of certain values. More...
#include <arcane/utils/ValueChecker.h>
Public Member Functions | |
| ValueChecker (const TraceInfo &ti) | |
| template<typename T1, typename T2, typename X = std::is_convertible<T2, T1>> | |
| void | areEqual (const T1 &value, const T2 &expected_value, const String &message) |
| template<typename T1, typename T2, typename ValueType = typename T1::value_type, typename X1 = std::is_convertible<T1, Span<const ValueType>>, typename X2 = std::is_convertible<T1, Span<const ValueType>>> | |
| void | areEqualArray (const T1 &x_values, const T2 &x_expected_values, const String &message) |
| Checks that the two arrays values and expected_values have the same values. | |
| template<typename T> | |
| void | areEqualArray (Span2< const T > values, Span2< const T > expected_values, const String &message) |
| Checks that the two 2D arrays values and expected_values have the same values. | |
| template<typename T> | |
| void | areEqualArray (SmallSpan2< T > values, SmallSpan2< T > expected_values, const String &message) |
| Checks that the two arrays values and expected_values have the same values. | |
| void | throwIfError () |
| Throws an exception if nbError()!=0. | |
| void | setThrowOnError (bool v) |
| Indicates whether an exception is thrown in case of an error. | |
| bool | throwOnError () const |
| Indicates whether an exception is thrown in case of an error. | |
| Integer | nbError () const |
| Number of errors. | |
Checking the validity of certain values.
This class provides a set of methods to check that values conform to a reference.
By default, if a value is different from its reference, an exception is thrown. It is possible to change this behavior by setting setThrowIfError() to false. In this case, it is possible to manually throw the exception by calling throwIfError().
Definition at line 41 of file ValueChecker.h.
|
inline |
Definition at line 45 of file ValueChecker.h.
|
inline |
Checks that value and expected_value have the same values.
Definition at line 57 of file ValueChecker.h.
|
inline |
Checks that the two arrays values and expected_values have the same values.
Definition at line 72 of file ValueChecker.h.
References Arcane::SpanImpl< T, SizeType, Extent >::size().
Referenced by areEqualArray(), and areEqualArray().
|
inline |
Checks that the two arrays values and expected_values have the same values.
Definition at line 124 of file ValueChecker.h.
References areEqualArray().
|
inline |
Checks that the two 2D arrays values and expected_values have the same values.
Definition at line 102 of file ValueChecker.h.
References areEqualArray(), and Arcane::Span2Impl< T, SizeType, Extent1, Extent2 >::dim1Size().
|
inline |
Number of errors.
Definition at line 145 of file ValueChecker.h.
|
inline |
Indicates whether an exception is thrown in case of an error.
Definition at line 136 of file ValueChecker.h.
| void Arcane::ValueChecker::throwIfError | ( | ) |
Throws an exception if nbError()!=0.
Definition at line 44 of file ValueChecker.cc.
|
inline |
Indicates whether an exception is thrown in case of an error.
Definition at line 142 of file ValueChecker.h.