micro-test-plus 6.0.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::detail::plain_text Struct Reference

Writes values as text, as the messages of the checks are written. More...

#include "micro-os-plus/micro-test-plus.h"

Static Public Member Functions

template<class T>
requires extension::printable<T>
static void append (std::string &text, const T &value)
 Appends a value to a text, in the plain mode of the formatter.

Detailed Description

Gives access to the plain mode of the expression_formatter, which is private, so that the names of the test cases generated by test_each() show their values as the messages do: the numbers without the type suffixes, and the strings and the characters unquoted. Also used by expression_formatter::append_operand() for the operands of the application types, so that their operator<< writes them as it writes them in the messages.

Definition at line 1702 of file expression-formatter.h.

Member Function Documentation

◆ append()

template<class T>
requires extension::printable<T>
void micro_os_plus::micro_test_plus::detail::plain_text::append ( std::string & text,
const T & value )
static

The text is moved into a local formatter, the value is appended, and the text is moved back, so that no other buffer is allocated.

Template Parameters
TThe type of the value, which must satisfy extension::printable.
Parameters
textThe text to which the value is appended.
valueThe value to append.
Returns
Nothing.

The text is moved into a formatter in the plain mode, the value is appended with the same operator<< overloads as the messages, and the text is moved back.

Definition at line 844 of file expression-formatter-inlines.h.

845 {
846 expression_formatter formatter{ std::move (text) };
847 formatter << value;
848 text = std::move (formatter.buffer_);
849 }
detail::expression_formatter expression_formatter
Public name of the formatter used to report operand values.

References micro_os_plus::micro_test_plus::detail::expression_formatter::buffer_.

Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::append_operand(), micro_os_plus::micro_test_plus::detail::anonymous_namespace{expression-formatter.cpp}::append_wide_text(), and micro_os_plus::micro_test_plus::detail::test_each_value().


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