detail.h File
C++ header file with declarations for the µTest++ internals. More...
Included Headers
Namespaces Index
| namespace | micro_os_plus |
|
The primary namespace for the µOS++ framework. More... | |
| namespace | micro_test_plus |
|
Primary namespace for the µTest++ testing framework. More... | |
| namespace | detail |
|
Internal implementation details for the µTest++ framework. More... | |
| namespace | extension |
|
The templates and the concepts for extending the µTest++ testing framework. More... | |
Classes Index
| struct | and_op<Lhs_T, Rhs_T> |
|
Logical AND comparator struct template. More... | |
| struct | approx_op<Lhs_T, Rhs_T, Epsilon_T> |
|
Approximate comparator struct template. More... | |
| struct | array_operand<T> |
|
An array operand of a comparator, other than a character array. More... | |
| struct | basic_c_string<Char_T> |
|
A C string operand of a comparator. More... | |
| struct | binary_op<Lhs_T, Rhs_T> |
|
Common base struct template for binary comparators. More... | |
| struct | callable_op |
|
Common base struct for callable-wrapping operators. More... | |
| struct | callable_result |
|
The result of the invocation of the callable of a check. More... | |
| struct | compare_op<Lhs_T, Rhs_T, Compare_T> |
|
Relational comparator struct template. More... | |
| struct | compare_op<Lhs_T, Rhs_T, Compare_T> |
|
Relational comparator struct template. More... | |
| struct | equal_to |
|
Equality tag for compare_op. More... | |
| struct | failed_requirement |
|
The exception thrown to stop a test case after a failed require(). More... | |
| struct | greater |
|
Greater than tag for compare_op. More... | |
| struct | greater_equal |
|
Greater than or equal tag for compare_op. More... | |
| struct | less |
|
Less than tag for compare_op. More... | |
| struct | less_equal |
|
Less than or equal tag for compare_op. More... | |
| struct | not_equal_to |
|
Non-equality tag for compare_op. More... | |
| struct | not_op<T> |
|
Logical NOT comparator struct template. More... | |
| struct | nothrow_op |
|
Operator struct to check if an expression does not throw any exception. More... | |
| struct | or_op<Lhs_T, Rhs_T> |
|
Logical OR comparator struct template. More... | |
| struct | predicate_op<T, Predicate_T> |
|
Unary predicate struct template. More... | |
| struct | predicate_op<T, Predicate_T> |
|
Unary predicate struct template. More... | |
| struct | throws_op<Exception_T> |
|
Operator struct template to check if an expression throws a specific exception. More... | |
| struct | throws_op<void> |
|
Operator struct to check if an expression throws any exception. More... | |
| struct | unary_op<T> |
|
Common base struct template for unary comparators. More... | |
Concepts Index
| concept | character |
|
Concept satisfied by the character types. More... | |
| concept | character_pointer |
|
Concept satisfied by the pointers to the character types. More... | |
| concept | approx_operand |
|
Concept satisfied when T is a valid operand of the approximate comparator. More... | |
Typedefs Index
| using | c_string = basic_c_string< char > |
|
The C string operand of char strings. More... | |
template <class T> | |
| using | stored_operand_t = std::conditional_t< std::is_lvalue_reference_v< T > and not std::is_copy_constructible_v< std::remove_cvref_t< T > >, const std::remove_reference_t< T > &, std::remove_cvref_t< T > > |
|
The type with which an expression stores an operand. More... | |
template <class T> | |
| using | unwrapped_t = std::remove_cvref_t< decltype(detail::unwrap( std::declval< const std::remove_cvref_t< T > & >()))> |
|
The type of an operand, after the framework wrappers are removed by detail::unwrap(). More... | |
Enumerations Index
| enum class | throw_outcome : unsigned char { ... } |
|
The kind of exception thrown by the callable of a check. More... | |
Operators Index
template <class T, class R> | |
| constexpr auto | operator<=> (const array_operand< T > &lhs, const R &rhs) |
|
Orders an array operand and a range lexicographically. More... | |
template <character Char_T> | |
| constexpr std::strong_ordering | operator<=> (const basic_c_string< Char_T > &lhs, const basic_c_string< Char_T > &rhs) noexcept |
|
Orders two C string operands. More... | |
template <character Char_T> | |
| constexpr std::strong_ordering | operator<=> (const basic_c_string< Char_T > &lhs, std::type_identity_t< std::basic_string_view< Char_T > > rhs) noexcept |
|
Orders a C string operand and a string. More... | |
template <class T, class R> | |
| constexpr bool | operator== (const array_operand< T > &lhs, const R &rhs) |
|
Compares an array operand with a range for equality. More... | |
template <character Char_T> | |
| constexpr bool | operator== (const basic_c_string< Char_T > &lhs, const basic_c_string< Char_T > &rhs) noexcept |
|
Compares two C string operands for equality. More... | |
template <character Char_T> | |
| constexpr bool | operator== (const basic_c_string< Char_T > &lhs, std::nullptr_t) noexcept |
|
Checks whether a C string operand is a null pointer. More... | |
template <character Char_T> | |
| constexpr bool | operator== (const basic_c_string< Char_T > &lhs, std::type_identity_t< std::basic_string_view< Char_T > > rhs) noexcept |
|
Compares a C string operand with a string. More... | |
Functions Index
template <typename Lhs_T, typename Rhs_T> | |
| and_op (Lhs_T &&, Rhs_T &&) -> and_op< stored_operand_t< Lhs_T >, stored_operand_t< Rhs_T > > | |
|
Deduction guide for the logical AND comparator. More... | |
template <class T> | |
| void | append_number (std::string &buffer, T v) |
|
Appends the shortest decimal representation of a numeric value to a buffer. More... | |
template <class T> | |
| void | append_pointer (std::string &buffer, T *v) |
|
Appends the hexadecimal address of a pointer to a buffer. More... | |
template <class Lhs_T, class Rhs_T, class Epsilon_T> | |
| approx_op (Lhs_T &&, Rhs_T &&, Epsilon_T &&) -> approx_op< stored_operand_t< Lhs_T >, stored_operand_t< Rhs_T >, stored_operand_t< Epsilon_T > > | |
|
Deduction guide for the approximate comparator. More... | |
template <class T> | |
| constexpr auto | as_operand (T &&t) noexcept -> decltype(auto) |
|
Prepares an operand of a comparator. More... | |
template <class Lhs_T, class Rhs_T, class Compare_T> | |
| compare_op (Lhs_T &&, Rhs_T &&, Compare_T) -> compare_op< stored_operand_t< decltype(detail::as_operand(std::declval< Lhs_T >()))>, stored_operand_t< decltype(detail::as_operand(std::declval< Rhs_T >()))>, Compare_T > | |
|
Deduction guide for the relational comparator. More... | |
template <class Lhs_T, class Rhs_T, class Epsilon_T> | |
| constexpr bool | differ_by_at_most (Lhs_T lhs, Rhs_T rhs, Epsilon_T epsilon) |
|
Tells whether two numbers differ by at most a tolerance. More... | |
template <typename Lhs_T, typename Rhs_T> | |
| or_op (Lhs_T &&, Rhs_T &&) -> or_op< stored_operand_t< Lhs_T >, stored_operand_t< Rhs_T > > | |
|
Deduction guide for the logical OR comparator. More... | |
template <class T, class Predicate_T> | |
| predicate_op (T &&, Predicate_T) -> predicate_op< stored_operand_t< decltype(detail::as_operand(std::declval< T >()))>, Predicate_T > | |
|
Deduction guide for the unary predicate. More... | |
template <class T> | |
| auto | unwrap (const T &t) -> decltype(auto) constexpr |
|
Returns the value wrapped by a framework type, or the operand itself. More... | |
template <class Lhs_T, class Rhs_T> | |
| constexpr bool | within_tolerance (const Lhs_T &lhs, const Rhs_T &rhs) |
|
Deprecated check whether two operands are equal within the tolerance of the floating-point wrappers. More... | |
Macro Definitions Index
| #define | MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE "zu" |
|
Portable printf() conversion for the size_t values. More... | |
Description
C++ header file with declarations for the µTest++ internals.
This header provides the declarations for the internal components of the µTest++ framework, encapsulated within the micro_os_plus::micro_test_plus::detail namespace. It defines the core mechanisms, helper structures, and utility templates that underpin the framework's value retrieval, comparator logic, operand preparation, and exception checking facilities.
All definitions reside within the micro_os_plus::micro_test_plus::detail namespace.
This file is included by micro-os-plus/micro-test-plus.h, which is the header that the applications include.
Typedefs
c_string
|
The C string operand of char strings.
The type to which as_operand() converts the char arrays, including the string literals, and the char pointers; the framework itself names basic_c_string, and the alias is kept for the tests that name the type of a comparator.
Definition at line 1746 of file detail.h.
stored_operand_t
|
The type with which an expression stores an operand.
Applied by the deduction guides and the factory functions to the type deduced for a forwarding reference: X& (or const X&) for an lvalue, X for an rvalue.
An lvalue is copied into the expression, so that an expression built in a function from its parameters, and returned, does not refer to the destroyed locals of that function. An rvalue is moved into the expression, so that an expression that outlives the statement, like auto op = eq (f (), 1);, does not refer to a destroyed temporary.
The arrays and the character pointers are first converted by as_operand() to basic_c_string or array_operand, which are stored, but which refer to the characters or to the elements of the operand, without copying them; such an expression is valid only as long as the operand.
Only an lvalue of a class type that cannot be copied (for example a std::unique_ptr) is stored as a const reference; such a reference remains valid only as long as the named operand, which is always the case within the statement that checks the expression.
- Template Parameters
-
T The type deduced for a forwarding reference.
Definition at line 234 of file detail.h.
unwrapped_t
|
The type of an operand, after the framework wrappers are removed by detail::unwrap().
- Template Parameters
-
T The type of the operand, possibly a reference.
Without references and qualifiers; for example int for a to_i wrapper and for a 42_i literal, and the type itself for the other operands. Used by extension::approx_operand and by comparison_operand_t.
Definition at line 828 of file detail.h.
Enumerations
throw_outcome
| strong |
The kind of exception thrown by the callable of a check.
- Enumeration values
-
none Nothing was thrown, or the expected exception was thrown std_exception A std::exception that was not the expected one was thrown; its what() is kept unknown_exception Another exception was thrown
Kept only when the check failed, to be written in the report.
Operators
operator<=>()
| nodiscard constexpr |
Orders an array operand and a range lexicographically.
- Template Parameters
-
T The element type of the array operand.
R The type of the range.
- Parameters
-
lhs The array operand.
rhs The range, which may be another array operand.
- Returns
The lexicographic order of the elements.
A range that is a prefix of the other is the lesser one.
Definition at line 1696 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::array_operand< T >::begin, micro_os_plus::micro_test_plus::detail::array_operand< T >::end and micro_os_plus::micro_test_plus::detail::operator<=>.
operator<=>()
| nodiscard constexpr noexcept |
Orders two C string operands.
- Template Parameters
-
Char_T The character type.
- Parameters
-
lhs The left operand.
rhs The right operand.
- Returns
The lexicographic order of the characters; a null pointer is equal to another null pointer and less than any string.
A null pointer orders before any string.
Definition at line 1594 of file detail-inlines.h.
Referenced by micro_os_plus::micro_test_plus::detail::operator<=>.
operator<=>()
| nodiscard constexpr noexcept |
Orders a C string operand and a string.
- Template Parameters
-
Char_T The character type.
- Parameters
-
lhs The C string operand.
rhs The string.
- Returns
The lexicographic order of the characters; a null pointer is less than any string.
A null pointer orders before any string.
Definition at line 1610 of file detail-inlines.h.
operator==()
| nodiscard constexpr |
Compares an array operand with a range for equality.
- Template Parameters
-
T The element type of the array operand.
R The type of the range.
- Parameters
-
lhs The array operand.
rhs The range, which may be another array operand.
- Return Values
-
true The ranges have the same size and equal elements.
false Otherwise.
Ranges of different sizes are not equal, without comparing any element. The elements are compared as the scalar operands of eq() are, with equal_to::apply(), so that integers of different signedness are compared by value, not by converting the signed one to the unsigned type.
Definition at line 1681 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::array_operand< T >::begin and micro_os_plus::micro_test_plus::detail::array_operand< T >::end.
operator==()
| nodiscard constexpr noexcept |
Compares two C string operands for equality.
- Template Parameters
-
Char_T The character type.
- Parameters
-
lhs The left operand.
rhs The right operand.
- Return Values
-
true Both are null, or both are strings with the same characters.
false Otherwise.
Two null pointers are equal; a null pointer is not equal to any string, not even an empty one.
Definition at line 1555 of file detail-inlines.h.
operator==()
| nodiscard constexpr noexcept |
Checks whether a C string operand is a null pointer.
- Template Parameters
-
Char_T The character type.
- Parameters
-
lhs The C string operand.
- Return Values
-
true The operand is a null pointer.
false Otherwise.
Returns whether the operand is a null pointer.
Definition at line 1584 of file detail-inlines.h.
operator==()
| nodiscard constexpr noexcept |
Compares a C string operand with a string.
Also used for the standard strings of the same character type, which convert to the string view, and, as a rewritten candidate, with the operands in the reverse order.
- Template Parameters
-
Char_T The character type.
- Parameters
-
lhs The C string operand.
rhs The string.
- Return Values
-
true The operand is not null and has the same characters.
false Otherwise.
A null pointer is not equal to any string.
Definition at line 1571 of file detail-inlines.h.
Functions
and_op()
|
Deduction guide for the logical AND comparator.
Deduces Lhs_T and Rhs_T from the constructor arguments, so that and_op{ lhs, rhs } can be written without explicit template arguments. The operand types are deduced as forwarding references, and stored as stored_operand_t selects.
append_number()
|
Appends the shortest decimal representation of a numeric value to a buffer.
- Template Parameters
-
T The numeric type to format.
- Parameters
-
buffer The string to append to.
v The value to format.
- Returns
Nothing.
The value is formatted into a local buffer, which is then appended to buffer.
For long double, a platform-specific path is chosen:
- On Windows and on platforms where long double has the same storage width as double (e.g. 32-bit Arm), the value is cast to double and formatted with std::to_chars.
- On all other platforms (e.g. x86-64 Linux/macOS with 80-bit extended precision, or AArch64 and RISC-V with 128-bit quad precision), snprintf with %.*Lg is used as a portable fallback, because std::to_chars for long double may be unavailable (e.g. when linking with lld). The precision starts at LDBL_DIG and is increased until the text reads back, with strtold, as the same value, up to LDBL_DECIMAL_DIG, which always reads back exactly. This gives the shortest exact form, as std::to_chars gives for the other types; a shorter form would need fewer than LDBL_DIG digits, and Lg removes the trailing zeros, so starting at LDBL_DIG does not lose it. For zero and the subnormal values, which have fewer significant digits, the precision starts at 1. The value of errno, which strtold may set for subnormal values, is preserved. If no precision reads back exactly, the C library handles long double with the precision of double (e.g. newlib on AArch64 and RISC-V), and the value is cast to double and formatted with std::to_chars, as above.
For all other numeric types, std::to_chars is called directly, providing locale-independent formatting. The snprintf() path uses the decimal point of the C locale, which is . unless the application changes it with setlocale().
Definition at line 1348 of file detail-inlines.h.
Reference micro_os_plus::micro_test_plus::detail::append_number.
Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::append_first_difference, micro_os_plus::micro_test_plus::detail::append_number, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::detail::reporter::operator<<.
append_pointer()
|
Appends the hexadecimal address of a pointer to a buffer.
Shared by the reporter and the expression_formatter, so that the pointers are displayed identically in the messages and in the expressions. Pointers to const or volatile objects, and function pointers, are accepted too.
- Template Parameters
-
T The type pointed to (an object or a function type).
- Parameters
-
buffer The string to append to.
v The pointer.
- Returns
Nothing.
Null pointers are rendered as "0x0", regardless of the platform, avoiding platform-specific representations such as "(nil)" on Linux/glibc. Non-null pointers are formatted with snprintf(), using the p specifier.
The p specifier expects a void*. Object pointers are converted implicitly to const volatile void*, which accepts any qualification, and the qualifiers are then removed with const_cast; a reinterpret_cast to void* would not compile for pointers to const objects. The object is not accessed. Function pointers, which do not convert to void* implicitly, use reinterpret_cast.
Definition at line 1454 of file detail-inlines.h.
Reference micro_os_plus::micro_test_plus::detail::append_pointer.
Referenced by micro_os_plus::micro_test_plus::detail::append_pointer, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::detail::reporter::operator<<.
approx_op()
|
Deduction guide for the approximate comparator.
Deduces Lhs_T, Rhs_T, and Epsilon_T from the constructor arguments, which are stored as stored_operand_t selects.
as_operand()
| nodiscard constexpr noexcept |
Prepares an operand of a comparator.
The arrays and the pointers of the character types (char, wchar_t, char8_t, char16_t, and char32_t, but not signed char or unsigned char, which are byte buffers) are converted to basic_c_string, so that they are compared by content; the other arrays, including those of volatile characters, are converted to array_operand, so that they are compared element by element, the functions to function pointers, and all other operands are returned unchanged, so the other pointers, including the pointers to volatile characters, and the functions are compared by address.
The other operands are forwarded, so that the comparator moves a temporary, and refers to a named operand.
- Template Parameters
-
T The type deduced for the forwarding reference.
- Parameters
-
t The operand.
- Returns
A basic_c_string for the C strings, an array_operand for the other arrays, otherwise t, forwarded.
Arrays of the character types are converted using their size as a bound, pointers to them using the null terminator; the const qualifier of the characters is ignored. The volatile characters are not strings, since basic_c_string cannot refer to them: an array of them is converted to array_operand, like the other arrays, and compared element by element, and a pointer to them is forwarded, and compared by address, like the other pointers. The functions are converted to function pointers. Every other operand is forwarded, unchanged, as an lvalue or an rvalue reference.
The qualifiers of an array are those of its elements, so the element type is taken from the type of the argument, not from the type without qualifiers, which would lose the volatile of the elements, and the conversion to the pointer to const elements would not compile.
Definition at line 1725 of file detail-inlines.h.
Reference micro_os_plus::micro_test_plus::detail::as_operand.
Referenced by micro_os_plus::micro_test_plus::detail::compare_op< Lhs_T, Rhs_T, Compare_T >::compare_op, micro_os_plus::micro_test_plus::detail::predicate_op< T, Predicate_T >::predicate_op, micro_os_plus::micro_test_plus::detail::as_operand, micro_os_plus::micro_test_plus::detail::compare_op, micro_os_plus::micro_test_plus::eq, micro_os_plus::micro_test_plus::ge, micro_os_plus::micro_test_plus::gt, micro_os_plus::micro_test_plus::le, micro_os_plus::micro_test_plus::lt and micro_os_plus::micro_test_plus::ne.
compare_op()
|
Deduction guide for the relational comparator.
Deduces Lhs_T, Rhs_T, and Compare_T from the constructor arguments, so that compare_op{ lhs, rhs, equal_to{} } can be written without explicit template arguments. The operand types are deduced as forwarding references, prepared by as_operand(), and stored as stored_operand_t selects.
Definition at line 941 of file detail.h.
References micro_os_plus::micro_test_plus::detail::as_operand and micro_os_plus::micro_test_plus::detail::differ_by_at_most.
differ_by_at_most()
| nodiscard constexpr |
Tells whether two numbers differ by at most a tolerance.
If the three values are integers, the distance is computed exactly, as an unsigned value, also for operands of mixed signedness, and compared with the tolerance with std::cmp_less_equal(), so that neither overflows nor wraps around. Otherwise, the values are converted to their common floating-point type, and the absolute value of the difference is compared with the tolerance. A negative tolerance, or a NaN, makes the result false.
- Template Parameters
-
Lhs_T The arithmetic type of the first value.
Rhs_T The arithmetic type of the second value.
Epsilon_T The arithmetic type of the tolerance.
- Parameters
-
lhs The first value.
rhs The second value.
epsilon The tolerance.
- Return Values
-
true The distance between the values is less than or equal to the tolerance.
false Otherwise.
For the integers, the larger value is selected with std::cmp_less(), and the distance is computed in std::uintmax_t: when both values have the same sign, as the modular difference of their conversions, which is exact; otherwise, as the sum of the larger value and of the magnitude of the negative one. A sum that does not fit in std::uintmax_t is flagged as an overflow, and gives false, since the true distance is larger than any tolerance. The tolerance is compared with std::cmp_less_equal(), so a negative one gives false.
For the other types, the values are converted to their common type, which is a floating-point one, so std::int64_t values compared with a float tolerance lose precision; the comparison is inclusive, so a distance equal to the tolerance succeeds. Two equal values, including two infinities of the same sign, whose difference would be NaN, are at the distance zero; a NaN operand always fails.
Definition at line 940 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::math::abs and micro_os_plus::micro_test_plus::detail::differ_by_at_most.
Referenced by micro_os_plus::micro_test_plus::detail::approx_op< Lhs_T, Rhs_T, Epsilon_T >::approx_op, micro_os_plus::micro_test_plus::detail::compare_op and micro_os_plus::micro_test_plus::detail::differ_by_at_most.
or_op()
|
Deduction guide for the logical OR comparator.
Deduces Lhs_T and Rhs_T from the constructor arguments, so that or_op{ lhs, rhs } can be written without explicit template arguments. The operand types are deduced as forwarding references, and stored as stored_operand_t selects.
predicate_op()
|
Deduction guide for the unary predicate.
Deduces T and Predicate_T from the constructor arguments, so that predicate_op{ t, even{} } can be written without explicit template arguments. The operand type is deduced as a forwarding reference, prepared by as_operand(), and stored as stored_operand_t selects.
unwrap()
| nodiscard constexpr |
Returns the value wrapped by a framework type, or the operand itself.
Always call it qualified, as detail::unwrap(), so that argument-dependent lookup cannot select a function of the application, defined in the namespace of an operand.
The operand is returned by reference, without a copy; the result is valid only as long as the operand.
- Template Parameters
-
T The type of the operand.
- Parameters
-
t The operand.
- Returns
The value returned by t.get() for the framework wrappers (the literals and the to_* wrappers), otherwise a reference to t.
If the type T is a framework expression type (see extension::is_op) that provides a get() member function, it is invoked and its result returned. Otherwise a reference to the argument itself is returned, so that the types of the application, even those with a get() member function, are compared with their own operators, without a copy. The selection is performed at compile time via if constexpr with an inline requires expression; the return type is deduced with decltype (auto) from the selected branch.
Declaration at line 167 of file detail.h, definition at line 98 of file detail-inlines.h.
Reference micro_os_plus::micro_test_plus::detail::unwrap.
Referenced by micro_os_plus::micro_test_plus::detail::approx_op< Lhs_T, Rhs_T, Epsilon_T >::approx_op, micro_os_plus::micro_test_plus::detail::compare_op< Lhs_T, Rhs_T, Compare_T >::compare_op, micro_os_plus::micro_test_plus::detail::predicate_op< T, Predicate_T >::predicate_op, micro_os_plus::micro_test_plus::detail::approx_op< Lhs_T, Rhs_T, Epsilon_T >::epsilon, micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::lhs, micro_os_plus::micro_test_plus::detail::unary_op< T >::operand, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<, micro_os_plus::micro_test_plus::detail::binary_op< Lhs_T, Rhs_T >::rhs, micro_os_plus::micro_test_plus::detail::unwrap and micro_os_plus::micro_test_plus::detail::within_tolerance.
Macro Definitions
MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE
|
Portable printf() conversion for the size_t values.
The format checker of Clang (MSVC target) on Windows rejects the standard z modifier, even though the C runtime printf() implementation supports it, so the Microsoft-specific I modifier is used there ("Iu"). The format checker of GCC (MinGW-w64, the "ms_printf" archetype) rejects z too, but also ignores I, so the modifier that matches the width of size_t is used ("llu" for 64-bit Windows, "u" for 32-bit Windows). Elsewhere, including Clang for MinGW, it is "zu".
It is used in all the library formats that print size_t values, in the reporter output and in the trace messages alike, concatenated with the adjacent string literals, as the standard PRIu32 macros are (for example "%" MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE " checks").
The templates in the inline headers use it too; their string literals are concatenated when they are parsed, not when they are instantiated, so the macro is undefined at the end of micro-test-plus.h, after all the headers, to keep it out of the application code. The library sources include the individual headers, which keep it defined.
Definition at line 102 of file detail.h.
Referenced by micro_os_plus::micro_test_plus::detail::runnable_base::runnable_base, micro_os_plus::micro_test_plus::suite::suite, micro_os_plus::micro_test_plus::test_case::test_case, micro_os_plus::micro_test_plus::detail::reporter_tap::end_session, micro_os_plus::micro_test_plus::detail::reporter_tap::end_suite, micro_os_plus::micro_test_plus::detail::reporter_human::end_test_case, micro_os_plus::micro_test_plus::detail::reporter_tap::end_test_case, micro_os_plus::micro_test_plus::detail::reporter::format_session_totals, micro_os_plus::micro_test_plus::detail::anonymous{reporter.cpp}::format_skipped, micro_os_plus::micro_test_plus::detail::reporter::format_suite_totals, micro_os_plus::micro_test_plus::detail::reporter::format_test_case_totals, micro_os_plus::micro_test_plus::counters::operator+=, micro_os_plus::micro_test_plus::runner::run_suites, micro_os_plus::micro_test_plus::detail::reporter_tap::skip_suite and micro_os_plus::micro_test_plus::detail::reporter_tap::skip_test_case.
File Listing
The file content with the documentation metadata removed is:
Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.