Skip to main content

failure_info Struct

The details of a check, displayed when it fails. More...

Declaration​

struct micro_os_plus::micro_test_plus::detail::failure_info { ... }

Included Headers​

#include <check-result.h>

Public Member Attributes Index​

boolhas_expression

Indicates whether the check has an associated expression. More...

check_kindkind

The kind of the check. More...

reflection::source_locationlocation

The source location of the check. More...

std::stringmessage

The message passed via operator<<(), if any. More...

Description​

The details of a check, displayed when it fails.

Grouped in one object, passed to reporter::fail(), so that the call sites do not pass unlabelled Boolean arguments. Held by check_result, and built by test_case when reporting an unexpected exception.

The message is also displayed when the check passes.

Definition at line 126 of file check-result.h.

Public Member Attributes​

has_expression​

bool micro_os_plus::micro_test_plus::detail::failure_info::has_expression

Indicates whether the check has an associated expression.

Set when the checked expression is a framework comparator, whose formatted text is displayed on failure.

Definition at line 152 of file check-result.h.

Referenced by micro_os_plus::micro_test_plus::detail::reporter::fail.

kind​

check_kind micro_os_plus::micro_test_plus::detail::failure_info::kind

The kind of the check.

Determines whether the failure stops the test case, and whether the reporter displays the abort notice.

Definition at line 135 of file check-result.h.

Referenced by micro_os_plus::micro_test_plus::detail::check_result::~check_result and micro_os_plus::micro_test_plus::detail::reporter::fail.

location​

reflection::source_location micro_os_plus::micro_test_plus::detail::failure_info::location

The source location of the check.

Displayed with failures, and used when aborting.

Definition at line 160 of file check-result.h.

Referenced by micro_os_plus::micro_test_plus::detail::check_result::~check_result and micro_os_plus::micro_test_plus::detail::reporter::fail.

message​

std::string micro_os_plus::micro_test_plus::detail::failure_info::message

The message passed via operator<<(), if any.

Displayed before the expression and the source location.

Definition at line 143 of file check-result.h.

143 std::string message;

Referenced by micro_os_plus::micro_test_plus::detail::check_result::~check_result, micro_os_plus::micro_test_plus::detail::reporter::fail and micro_os_plus::micro_test_plus::test_case::fail_unexpected_exception.


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


Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.