Template Class ApproxEqualFailure

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class ApproxEqualFailure : public mu::tiny::test::Failure

Failure for CHECK_APPROX when two values differ by more than the threshold.

Template Parameters:

T – Numeric type of the values (int, float, double, etc.). Values are formatted via mu::tiny::string_from() and NaN is detected with the IEEE 754 self-comparison trick (v!=v), the same approach used by mu::tiny::test::approx_equal.

Public Functions

inline ApproxEqualFailure(Shell *test, const char *file_name, int_least32_t line_number, T expected, T actual, T threshold, const String &text)
Parameters:
  • test – The failing test.

  • file_name – Source file of the assertion.

  • line_number – Line of the assertion.

  • expected – Expected value.

  • actual – Actual value.

  • threshold – Allowed tolerance.

  • text – Optional user text.