Class StringBufferOutput

Inheritance Relationships

Base Type

Class Documentation

class StringBufferOutput : public mu::tiny::test::Output
[source]

Captures all output into an in-memory String for later inspection.

Used by TestingFixture to collect the output from a test run so that tests can assert on what was printed.

Public Functions

explicit StringBufferOutput() = default
[source]
~StringBufferOutput() override = default
[source]
StringBufferOutput(const StringBufferOutput&) = delete
StringBufferOutput &operator=(const StringBufferOutput&) = delete
inline virtual void print_buffer(const char *s) override

Append s to the internal output buffer.

Parameters:

s – Null-terminated string to append.

inline virtual void flush() override
[source]

Clear the internal output buffer.

inline const String &get_output()
[source]
Returns:

A reference to the accumulated output string.

Protected Attributes

String output_