Class Failure

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class Failure : public mu::tiny::test::Failure
[source]

Base class for all mock-layer failure messages.

Extends test::Failure to carry expectation history in the failure message. Concrete subclasses describe specific kinds of mock violations. Reported via FailureReporter from Support.

Subclassed by mu::tiny::mock::CallOrderFailure, mu::tiny::mock::ExpectedCallsDidntHappenFailure, mu::tiny::mock::ExpectedObjectDidntHappenFailure, mu::tiny::mock::ExpectedParameterDidntHappenFailure, mu::tiny::mock::NoWayToCompareCustomTypeFailure, mu::tiny::mock::NoWayToCopyCustomTypeFailure, mu::tiny::mock::UnexpectedCallHappenedFailure, mu::tiny::mock::UnexpectedInputParameterFailure, mu::tiny::mock::UnexpectedObjectFailure, mu::tiny::mock::UnexpectedOutputParameterFailure

Public Functions

Failure(test::Shell *test)

Construct an empty mock failure attached to test.

Parameters:

test – The test shell that triggered the failure.

Failure(Failure&&) noexcept = default
virtual ~Failure() override = default
[source]

Protected Functions

void add_expectations_and_call_history(const ExpectedCallsList &expectations)

Append the full expectations/call history to the failure message.

Parameters:

expectations – The expected-calls list at the time of failure.

Append history filtered to a specific function name.

Parameters:
  • name – Name of the function whose history to include.

  • expectations – The full expected-calls list.