The reporter interface.
This is the central interface to be used, when creating reporters for external domains.
virtual void mimicpp::IReporter::report_inapplicable_matches |
( |
CallReport | call, |
|
|
std::vector< MatchReport > | matchReports ) |
|
pure virtual |
Expects reports about all inapplicable
matching expectations. This is only called, if there are no better options available.
- Parameters
-
call | The call report. |
matchReports | Reports of all inapplicable matching expectations. |
This function is called, when no applicable match has been found, but actually the call expectations are fulfilled. This in fact happens, when the times
policy is already saturated (e.g. it was once expected and already matched once) or otherwise not applicable (e.g. a sequence element is not the current element).
- Attention
- Derived reporter implementations must never return and shall instead leave the function via a thrown exception or a terminating mechanism (e.g.
std::terminate
). Otherwise, this will result in undefined behavior.
Implemented in mimicpp::BasicReporter< successReporter, warningReporter, failReporter >, and mimicpp::DefaultReporter.
virtual void mimicpp::IReporter::report_no_matches |
( |
CallReport | call, |
|
|
std::vector< MatchReport > | matchReports ) |
|
pure virtual |
Expects reports about all none
matching expectations. This is only called, if there are no better options available.
- Parameters
-
call | The call report. |
matchReports | Reports of all none matching expectations. |
This function is called, when no match has been found and there are no other expectations, which are matching but inapplicable. In fact, this is the fallback reporting mechanism, for unmatched calls.
- Note
matchReports
may be empty.
- Attention
- Derived reporter implementations must never return and shall instead leave the function via a thrown exception or a terminating mechanism (e.g.
std::terminate
). Otherwise, this will result in undefined behavior.
Implemented in mimicpp::BasicReporter< successReporter, warningReporter, failReporter >, and mimicpp::DefaultReporter.
virtual void mimicpp::IReporter::report_unhandled_exception |
( |
CallReport | call, |
|
|
ExpectationReport | expectationReport, |
|
|
std::exception_ptr | exception ) |
|
pure virtual |
Expects reports about unhandled exceptions, during handle_call
.
- Parameters
-
call | The call report. |
expectationReport | The expectation report. |
exception | The exception. |
This function is called, when an expectation throws during a matches
call. There are no expectations on the behavior of this function. As this function is called inside a catch
block, throwing exceptions will result in a terminate call.
Implemented in mimicpp::BasicReporter< successReporter, warningReporter, failReporter >, and mimicpp::DefaultReporter.