48 void _checkAssertion(
bool is_error,
const TraceInfo& where,
61 bool is_error = (!condition);
62 _checkAssertion(is_error, where,
"true",
"false", pm);
68 bool is_error = (condition);
69 _checkAssertion(is_error, where,
"false",
"true", pm);
79 bool is_error = (expected != actual);
80 _checkAssertion(is_error, where, expected, actual, pm);
84 void assertEqual(
const TraceInfo& where,
const T& expected,
const T& actual,
IParallelMng* pm =
nullptr)
87 bool is_error = (!(expected == actual));
88 _checkAssertion(is_error, where, String::fromNumber(expected), String::fromNumber(actual), pm);
92 void assertNearlyEqual(
const TraceInfo& where,
const T& expected,
93 const T& actual, IParallelMng* pm =
nullptr)
95 bool is_error = (!math::isNearlyEqual(expected, actual));
96 _checkAssertion(is_error, where, String::fromNumber(expected), String::fromNumber(actual), pm);
100 void assertNearlyZero(
const TraceInfo& where,
const T& actual, IParallelMng* pm =
nullptr)
102 bool is_error = (!math::isNearlyZero(actual));
103 _checkAssertion(is_error, where,
"0", String::fromNumber(actual), pm);
106 template <
typename T>
107 void assertNearlyEqualWithEpsilon(
const TraceInfo& where,
const T& expected,
108 const T& actual,
const T& epsilon, IParallelMng* pm =
nullptr)
110 bool is_error = (!math::isNearlyEqualWithEpsilon(expected, actual, epsilon));
111 _checkAssertion(is_error, where, String::fromNumber(expected), String::fromNumber(actual), pm);
114 template <
typename T>
115 void assertNearlyZeroWithEpsilon(
const TraceInfo& where,
const T& actual,
116 const T& epsilon, IParallelMng* pm =
nullptr)
118 bool is_error = (!math::isNearlyZeroWithEpsilon(actual, epsilon));
119 _checkAssertion(is_error, where,
"0", String::fromNumber(actual), pm);