Skip to main content

detail Namespace

Internal implementation details for the µTest++ framework. More...

Definition​

namespace micro_os_plus::micro_test_plus::detail { ... }

Namespaces Index​

namespaceanonymous{expression-formatter.cpp}

Local helpers of the expression formatter. More...

namespaceanonymous{reporter-tap.cpp}

Local helpers of the TAP reporter. More...

namespaceanonymous{reporter.cpp}

Local helpers of the reporter base class. More...

namespacecomparison_lookup

Names for the checks of the comparison operators, looked up as the apply() functions look them up. More...

namespacemath

Internal mathematical utilities for the µTest++ testing framework. More...

Classes Index​

structand_op<Lhs_T, Rhs_T>

Logical AND comparator struct template. More...

structapprox_op<Lhs_T, Rhs_T, Epsilon_T>

Approximate comparator struct template. More...

structarray_operand<T>

An array operand of a comparator, other than a character array. More...

structbasic_c_string<Char_T>

A C string operand of a comparator. More...

structbinary_op<Lhs_T, Rhs_T>

Common base struct template for binary comparators. More...

classbound_callable<Self_T, Callable_T, Args_T>

Function object that holds a callable and the additional arguments it is invoked with. More...

structcallable_op

Common base struct for callable-wrapping operators. More...

classcallable_ref<Self_T>

Non-owning reference to a callable invoked with a Self_T& argument. More...

structcallable_result

The result of the invocation of the callable of a check. More...

classcheck_result

The result of one check, reported when destroyed. More...

structcolours

Colours used to highlight pass and fail results in test reports. More...

structcompare_op<Lhs_T, Rhs_T, Compare_T>

Relational comparator struct template. More...

structcomparison_integer<T>

The integer type used to compare a value of type T. More...

structcomparison_integer<T>

The integer type used to compare a character type. More...

structequal_to

Equality tag for compare_op. More...

classexpression_formatter

Formats values and expressions into an owned string buffer. More...

structfailed_requirement

The exception thrown to stop a test case after a failed require(). More...

structfailure_info

The details of a check, displayed when it fails. More...

structfloating_point_constant<T, N, D, Size, P>

Struct template representing a generic floating-point constant with custom size and precision. More...

structgreater

Greater than tag for compare_op. More...

structgreater_equal

Greater than or equal tag for compare_op. More...

structindentation

Parameterised stream manipulator for outputting indentation. More...

structintegral_constant<N>

Struct template representing a generic integral constant. More...

structintegral_min_magnitude<T>

Struct template representing the absolute value of the minimum of a signed integral type, as written in a literal. More...

structis_bool_wrapper<T>

Trait marking the wrappers of a bool, whose condition is ambiguous. More...

structless

Less than tag for compare_op. More...

structless_equal

Less than or equal tag for compare_op. More...

structnamed_bool

Struct representing a named boolean constant, created by the _b literal. More...

structnot_equal_to

Non-equality tag for compare_op. More...

structnot_op<T>

Logical NOT comparator struct template. More...

structnothrow_op

Operator struct to check if an expression does not throw any exception. More...

structop

Empty base struct for the framework expression types. More...

structor_op<Lhs_T, Rhs_T>

Logical OR comparator struct template. More...

structoutput_route

The destinations of a record. More...

structplain_text

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

structpredicate_op<T, Predicate_T>

Unary predicate struct template. More...

structrange_element<T>

The type of the elements of a range, as iterated by a range-based for statement. More...

structrange_element<T>

The type of the elements of a range with begin() and end() members. More...

classreporter

Abstract base class for the reporters that display test results, including operand values for failures. More...

classreporter_human

Human (standard output) implementation of reporter. More...

classreporter_tap

TAP (Test Anything Protocol) implementation of reporter. More...

classrunnable_base

Non-template base for all runnable objects (suites and test cases). More...

classstopwatch

Measures the elapsed time of an operation. More...

structthrows_op<Exception_T>

Operator struct template to check if an expression throws a specific exception. More...

structthrows_op<void>

Operator struct to check if an expression throws any exception. More...

classtimestamp

Deprecated clock reading. More...

structunary_op<T>

Common base struct template for unary comparators. More...

structvalue<T>

Struct template representing a generic value, accessible via a getter. More...

structvalue<T>

Struct template representing a floating-point value with precision control. More...

structvalue_base<T>

Base struct template providing common storage and accessors for run-time value-wrapper types. More...

Concepts Index​

conceptambiguous_condition

Concept satisfied by the wrappers of a bool, whose condition is ambiguous. More...

conceptcharacter

Concept satisfied by the character types. More...

conceptcharacter_pointer

Concept satisfied by the pointers to the character types. More...

conceptcomparable

Concept satisfied when two operands can be compared by the comparator selected by Op. More...

conceptcomparable_operands

Concept satisfied when the operands of a comparator can be written and compared. More...

conceptcontainer_like

Concept satisfied when T provides both begin() and end() member functions returning an iterator and its sentinel. More...

conceptformattable_range

Concept satisfied when T is a range that the formatter writes element by element. More...

conceptfree_printable

Concept satisfied by the types that have a free operator<< for the formatter. More...

conceptfree_range

Concept satisfied when T provides begin() and end() only as functions found by argument-dependent lookup. More...

conceptfunction_pointer_pair

Concept satisfied by two pointers, one of which points to a function. More...

conceptgeneric_callable

Concept satisfied by a callable object whose call operator is not a single non-template member function. More...

concepthas_value

Concept satisfied when T is a framework compile-time constant. More...

conceptlazy_message

Concept satisfied when T is a callable object that returns a printable message. More...

conceptlegacy_checkable

Concept satisfied when a type was accepted by expect() and require() before the exclusion of the suspicious conditions. More...

conceptmember_printable

Concept satisfied by the types that the formatter writes with one of its own member functions operator<<. More...

conceptmessage_argument

Concept satisfied when T can be appended to the message of a check. More...

conceptsign_mixed_integers

Concept satisfied by two integer types of different signedness. More...

conceptstatic_suite_body

The body of a static suite written for v5.0.1, whose first parameter is a static_suite& reference. More...

conceptstring_like

Concept satisfied when T is a string, convertible to a std::basic_string_view of a character type. More...

conceptsuite_body

Concept satisfied by a callable object that can be the body of a suite. More...

conceptsuspicious_condition

Concept satisfied when a type is contextually convertible to bool, but is most likely not a condition. More...

concepttag_has_symbol

Concept satisfied when the tag of a comparator or of a predicate has a symbol that can be written. More...

concepttest_body

Concept satisfied by a callable object that can be the body of a test case. More...

concepttest_values_range

Concept satisfied when T is a range of values for test_each(). More...

concepttest_values_tuple

Concept satisfied when T is a tuple of values for test_each(). More...

conceptunsupported_condition

Concept satisfied by a value that expect() and require() do not accept. More...

Typedefs Index​

usingc_string = basic_c_string< char >

The C string operand of char strings. More...

template <class T>
usingcomparison_integer_t = typename comparison_integer< T >::type

Alias of the integer type used to compare the type T. More...

template <class T>
usingcomparison_operand_t = unwrapped_t< decltype(detail::as_operand(std::declval< T >()))>

The type with which an operand of a comparator is compared. More...

template <class T>
usingstored_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>
usingunwrapped_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...

usingrunner_totals = counters

Deprecated name of counters. More...

usingtimestamps = stopwatch

Deprecated name of stopwatch. More...

Enumerations Index​

enum classcheck_kind { ... }

The kind of a check, which determines what happens when it fails. More...

enum classcomparison : unsigned char { ... }

The comparison operators, as the template argument of the comparable concept. More...

enum classrecord_kind : uint8_t { ... }

The kinds of records written by the reporters. More...

enum classthrow_outcome : unsigned char { ... }

The kind of exception thrown by the callable of a check. More...

Operators Index​

template <class T, class R>
constexpr autooperator<=> (const array_operand< T > &lhs, const R &rhs)

Orders an array operand and a range lexicographically. More...

template <character Char_T>
constexpr std::strong_orderingoperator<=> (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_orderingoperator<=> (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 booloperator== (const array_operand< T > &lhs, const R &rhs)

Compares an array operand with a range for equality. More...

template <character Char_T>
constexpr booloperator== (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 booloperator== (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 booloperator== (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...

voidappend_control_escape (std::string &text, char c)

Appends the escape sequence of a control character. More...

template <class T>
voidappend_number (std::string &buffer, T v)

Appends the shortest decimal representation of a numeric value to a buffer. More...

template <class T>
voidappend_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_comparison_integer (const T value) noexcept -> comparison_integer_t< T >

Converts an integer or a character to the type used to compare it. More...

template <class T>
constexpr auto as_operand (T &&t) noexcept -> decltype(auto)

Prepares an operand of a comparator. More...

template <typename Self_T, typename Callable_T, typename... Args_T>
autobind_callable (Callable_T &&callable, Args_T &&... arguments)

Creates the function object that holds the body of a test case or suite. 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 booldiffer_by_at_most (Lhs_T lhs, Rhs_T rhs, Epsilon_T epsilon)

Tells whether two numbers differ by at most a tolerance. More...

reporter &endl (reporter &stream)

Output stream manipulator for ending a line in test reports. More...

voidescape_control_characters (std::string &name)

Escapes the control characters of a name. More...

indentationindent (size_t level)

Factory function that creates an indentation manipulator. More...

template <class T, char... Cs>
constexpr autointegral_literal (void)

Creates the compile-time constant of an integer literal. 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...

voidread_clock (timespec &ts) noexcept

Reads the system clock. More...

template <class Tag_T>
constexpr voidreject_compare_tag (void) noexcept

Stops the compilation of a compare_op whose tag is rejected, with a message that tells why. More...

template <comparison Op, class Lhs_T, class Rhs_T>
constexpr voidreject_comparison (void) noexcept

Stops the compilation of a comparator whose operands are rejected, with a message that tells why. More...

template <class Tag_T>
constexpr voidreject_predicate_tag (void) noexcept

Stops the compilation of a predicate_op whose tag is rejected, with a message that tells why. More...

template <typename Callable_T, typename... Args_T>
constexpr voidreject_suite_body (void) noexcept

Stops the compilation with a message that tells what the body of a suite takes. More...

template <typename Callable_T, typename... Args_T>
constexpr voidreject_test_body (void) noexcept

Stops the compilation with a message that tells what the body of a test case takes. More...

template <class Self_T, class Values_T, class Callable_T>
voidtest_each_value (Self_T &self, const located_name &name, Values_T &&values, Callable_T &callable)

Adds and runs a test case for each value. 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 T>
constexpr auto unwrap (const T &t) -> decltype(auto)

Returns the value wrapped by a framework type, or the operand itself. More...

template <class Lhs_T, class Rhs_T>
constexpr boolwithin_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...

Variables Index​

constexpr colourscolours_none {}

Predefined colour set, without escape sequences. More...

constexpr colourscolours_red_green = ...

Predefined colour set, with green for pass and red for fail. More...

template <typename... Ts>
constexpr booldependent_false_v = false

A value that is always false, but depends on the template arguments. More...

Description​

Internal implementation details for the µTest++ framework.

The detail namespace encapsulates the internal mechanisms, helper structures, and implementation utilities employed by the µTest++ testing framework. These components do not form part of the public API and may be modified without prior notice.

Within this namespace, one will find the deprecated value wrappers (declared in deprecated.h), the value unwrapping helper, comparator structures for logical and relational operations, mechanisms for exception checking, the reporters, the check result, and the expression formatter.

All definitions within detail are intended exclusively for internal use; the applications do not need to name them.

Typedefs​

c_string​

using micro_os_plus::micro_test_plus::detail::c_string = basic_c_string<char>

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.

comparison_integer_t​

template <class T>
using micro_os_plus::micro_test_plus::detail::comparison_integer_t = typename comparison_integer<T>::type

Alias of the integer type used to compare the type T.

Used by sign_mixed_integers, to tell the signedness, and by as_comparison_integer(), to convert the operands.

Template Parameters
T

The type of the operand.

Definition at line 326 of file detail-inlines.h.

comparison_operand_t​

template <class T>
using micro_os_plus::micro_test_plus::detail::comparison_operand_t = unwrapped_t<decltype (detail::as_operand (std::declval<T> ()))>

The type with which an operand of a comparator is compared.

The type of the operand after as_operand() and unwrap(), without references and qualifiers; for example detail::basic_c_string<char> for a string literal.

Template Parameters
T

The type deduced for the operand, possibly a reference.

Definition at line 386 of file detail-inlines.h.

stored_operand_t​

template <class T>
using micro_os_plus::micro_test_plus::detail::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.

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.

234 using stored_operand_t = std::conditional_t<

unwrapped_t​

template <class T>
using micro_os_plus::micro_test_plus::detail::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().

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.

828 using unwrapped_t = std::remove_cvref_t<decltype (detail::unwrap (

Enumerations​

check_kind​

enum class micro_os_plus::micro_test_plus::detail::check_kind
strong

The kind of a check, which determines what happens when it fails.

Enumeration values
expectation A check created by expect()

A failure is reported and counted, and the test case continues.

requirement A check created by require()

A failure is reported and counted, and the test case is stopped, or, without exceptions, the test execution is aborted.

An enumeration rather than a Boolean flag, so that the call sites name the kind of the check.

Definition at line 93 of file check-result.h.

94 {
102
111 };

comparison​

enum class micro_os_plus::micro_test_plus::detail::comparison : unsigned char
strong

The comparison operators, as the template argument of the comparable concept.

Enumeration values
equalThe == operator, checked by eq()
not_equalThe != operator, checked by ne()
greaterThe > operator, checked by gt()
greater_equalThe >= operator, checked by ge()
lessThe < operator, checked by lt()
less_equalThe <= operator, checked by le()

A single concept, parametrised by the operator, checks the operands of all the comparators (eq(), ne(), gt(), ge(), lt(), and le()).

Definition at line 416 of file detail-inlines.h.

417 enum class comparison : unsigned char
418 {
420 equal,
424 greater,
428 less,

record_kind​

enum class micro_os_plus::micro_test_plus::detail::record_kind : uint8_t
strong

The kinds of records written by the reporters.

Enumeration values
infoThe informational lines written at the beginning of the session
suite_headingThe heading that marks the beginning of a suite
suite_resultThe result line of a suite
test_case_headingThe heading that marks the beginning of a test case
test_case_resultThe result line of a test case
skippedThe line of a suite or of a test case skipped by the filter
passed_checkThe line of a passed check
failed_checkThe lines of a failed check, or the failure of a suite
totalThe totals of the session
abortThe report of an aborted test execution

The output policy, which decides where each kind of record is written at each verbosity level, is in reporter::route(). The concrete reporters only format the records and ask where they go.

Definition at line 160 of file reporter.h.

throw_outcome​

enum class micro_os_plus::micro_test_plus::detail::throw_outcome : unsigned char
strong

The kind of exception thrown by the callable of a check.

Enumeration values
noneNothing was thrown, or the expected exception was thrown
std_exceptionA std::exception that was not the expected one was thrown; its what() is kept
unknown_exceptionAnother exception was thrown

Kept only when the check failed, to be written in the report.

Definition at line 1335 of file detail.h.

1336 {
1341
1347
1352 };

Operators​

operator<=>()​

template <class T, class R>
auto micro_os_plus::micro_test_plus::detail::operator<=> (const array_operand< T > & lhs, const R & rhs)
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.

1697 constexpr auto
1698 operator<=> (const array_operand<T>& lhs, const R& rhs)
1699 {
1700 return std::lexicographical_compare_three_way (lhs.begin (), lhs.end (),
1701 rhs.begin (), rhs.end ());

References micro_os_plus::micro_test_plus::detail::array_operand< T >::begin, micro_os_plus::micro_test_plus::detail::array_operand< T >::end and operator<=>.

operator<=>()​

template <character Char_T>
std::strong_ordering micro_os_plus::micro_test_plus::detail::operator<=> (const basic_c_string< Char_T > & lhs, const basic_c_string< Char_T > & rhs)
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.

1595 constexpr std::strong_ordering
1597 const basic_c_string<Char_T>& rhs) noexcept
1598 {
1599 if (lhs.is_null () || rhs.is_null ())
1600 {
1601 return !lhs.is_null () <=> !rhs.is_null ();
1602 }
1603 return lhs.view () <=> rhs.view ();

Referenced by operator<=>.

operator<=>()​

template <character Char_T>
std::strong_ordering micro_os_plus::micro_test_plus::detail::operator<=> (const basic_c_string< Char_T > & lhs, std::type_identity_t< std::basic_string_view< Char_T > > rhs)
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.

1611 constexpr std::strong_ordering
1613 const basic_c_string<Char_T>& lhs,
1614 std::type_identity_t<std::basic_string_view<Char_T>> rhs) noexcept
1615 {
1616 if (lhs.is_null ())
1617 {
1618 return std::strong_ordering::less;
1619 }
1620 return lhs.view () <=> rhs;

operator==()​

template <class T, class R>
bool micro_os_plus::micro_test_plus::detail::operator== (const array_operand< T > & lhs, const R & rhs)
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.

1681 constexpr bool
1682 operator== (const array_operand<T>& lhs, const R& rhs)
1683 {
1684 return std::equal (lhs.begin (), lhs.end (), rhs.begin (), rhs.end (),
1685 [] (const auto& l, const auto& r)
1686 { return equal_to::apply (l, r); });

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==()​

template <character Char_T>
bool micro_os_plus::micro_test_plus::detail::operator== (const basic_c_string< Char_T > & lhs, const basic_c_string< Char_T > & rhs)
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.

1555 constexpr bool
1557 const basic_c_string<Char_T>& rhs) noexcept
1558 {
1559 if (lhs.is_null () || rhs.is_null ())
1560 {
1561 return lhs.is_null () && rhs.is_null ();
1562 }
1563 return lhs.view () == rhs.view ();

operator==()​

template <character Char_T>
bool micro_os_plus::micro_test_plus::detail::operator== (const basic_c_string< Char_T > & lhs, std::nullptr_t)
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.

1584 constexpr bool
1585 operator==(const basic_c_string<Char_T>& lhs, std::nullptr_t) noexcept
1586 {
1587 return lhs.is_null ();

operator==()​

template <character Char_T>
bool micro_os_plus::micro_test_plus::detail::operator== (const basic_c_string< Char_T > & lhs, std::type_identity_t< std::basic_string_view< Char_T > > rhs)
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.

1571 constexpr bool
1573 const basic_c_string<Char_T>& lhs,
1574 std::type_identity_t<std::basic_string_view<Char_T>> rhs) noexcept
1575 {
1576 return !lhs.is_null () && lhs.view () == rhs;

Functions​

and_op()​

template <typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::and_op (Lhs_T &&, Rhs_T &&)

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.

Definition at line 1111 of file detail.h.

append_control_escape()​

void micro_os_plus::micro_test_plus::detail::append_control_escape (std::string & text, char c)

Appends the escape sequence of a control character.

Writes the usual escape of the character (\\0, \\a, \\b, \\t, \\n, \\v, \\f, or \\r), or \\xHH for the other ones. Used for the characters of the messages and of the names that would otherwise reach the console and the output files unchanged. Defined in src/expression-formatter.cpp.

Parameters
text

The text to append to.

c

The control character.

The usual escapes for the characters that have one; the other ones, including DEL, as \\xHH.

Definition at line 401 of file expression-formatter.cpp.

401 append_control_escape (std::string& text, char c)
402 {
403 switch (c)
404 {
405 case '\0':
406 text.append ("\\0");
407 break;
408 case '\a':
409 text.append ("\\a");
410 break;
411 case '\b':
412 text.append ("\\b");
413 break;
414 case '\t':
415 text.append ("\\t");
416 break;
417 case '\n':
418 text.append ("\\n");
419 break;
420 case '\v':
421 text.append ("\\v");
422 break;
423 case '\f':
424 text.append ("\\f");
425 break;
426 case '\r':
427 text.append ("\\r");
428 break;
429 default:
430 append_hex (text, static_cast<unsigned char> (c), "\\x", 2);
431 break;
432 }
433 }

Reference append_control_escape.

Referenced by append_control_escape, micro_os_plus::micro_test_plus::detail::anonymous{expression-formatter.cpp}::append_plain, escape_control_characters and micro_os_plus::micro_test_plus::detail::expression_formatter::operator<<.

append_number()​

template <class T>
void micro_os_plus::micro_test_plus::detail::append_number (std::string & buffer, T v)

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.

1348 void
1349 append_number (std::string& buffer, const T v)
1350 {
1351 if constexpr (std::is_same_v<T, long double>)
1352 {
1353#if defined(_WIN32) \
1354 || (defined(__SIZEOF_LONG_DOUBLE__) \
1355 && __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__)
1356 // On Windows (all toolchains: MinGW, Clang, MSVC), the C runtime
1357 // does not handle the %Lg printf specifier correctly for 80-bit
1358 // long double, producing garbage output. On platforms where long
1359 // double has the same width as double (e.g. 32-bit Arm), the cast
1360 // is lossless. In both cases, cast to double and use
1361 // std::to_chars.
1362 char buf[32];
1363 const auto [ptr, ec] = std::to_chars (buf, buf + sizeof (buf),
1364 static_cast<double> (v));
1365 if (ec == std::errc{})
1366 buffer.append (buf, ptr);
1367#else
1368 // On other platforms (80-bit extended precision on x86-64,
1369 // 128-bit quad precision on AArch64 and RISC-V), std::to_chars
1370 // for long double may be unavailable (e.g., with lld).
1371 // Use snprintf as a portable fallback; %Lg is supported by the C
1372 // libraries used on these platforms (e.g. glibc, the macOS libc,
1373 // and newlib, the latter with the precision of double on AArch64
1374 // and RISC-V). Use the smallest precision that reads back as the
1375 // same value; the buffer fits the 36 digits of the 128-bit
1376 // format, with the sign, the point, and the exponent.
1377 char buf[48];
1378 const int saved_errno = errno;
1379 // The subnormal values have fewer significant digits.
1380 const int min_precision
1381 = (v > -LDBL_MIN && v < LDBL_MIN) ? 1 : LDBL_DIG;
1382 bool is_exact = false;
1383 for (int precision = min_precision; precision <= LDBL_DECIMAL_DIG;
1384 ++precision)
1385 {
1386 // GCC 11 does not know the range of the precision, and
1387 // warns that the text may be truncated; it cannot be, since
1388 // the precision is at most LDBL_DECIMAL_DIG.
1389#if defined(__GNUC__) && !defined(__clang__)
1390#pragma GCC diagnostic push
1391#pragma GCC diagnostic ignored "-Wformat-truncation"
1392#endif // defined(__GNUC__) && !defined(__clang__)
1393 snprintf (buf, sizeof (buf), "%.*Lg", precision, v);
1394#if defined(__GNUC__) && !defined(__clang__)
1395#pragma GCC diagnostic pop
1396#endif // defined(__GNUC__) && !defined(__clang__)
1397 // A NaN is never equal to itself, and has no digits.
1398 if (v != v || strtold (buf, nullptr) == v)
1399 {
1400 is_exact = true;
1401 break;
1402 }
1403 }
1404 errno = saved_errno;
1405 if (is_exact)
1406 {
1407 buffer.append (buf);
1408 }
1409 else
1410 {
1411 // The C library formats or reads long double with the
1412 // precision of double (e.g. newlib on AArch64 and RISC-V),
1413 // and its long text would only show the error of the
1414 // conversion; use the shortest form of the double value,
1415 // as on the platforms above.
1416 const auto [ptr, ec] = std::to_chars (buf, buf + sizeof (buf),
1417 static_cast<double> (v));
1418 if (ec == std::errc{})
1419 buffer.append (buf, ptr);
1421#endif // long double formatting
1422 }
1423 else
1424 {
1425 char buf[32];
1426 const auto [ptr, ec] = std::to_chars (buf, buf + sizeof (buf), v);
1427 if (ec == std::errc{})
1428 buffer.append (buf, ptr);
1429 }

Reference append_number.

Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::append_first_difference, 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()​

template <class T>
void micro_os_plus::micro_test_plus::detail::append_pointer (std::string & buffer, T * v)

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.

1454 void
1455 append_pointer (std::string& buffer, T* v)
1456 {
1457 if (v == nullptr)
1458 {
1459 buffer.append ("0x0");
1460 return;
1461 }
1462
1463 void* p;
1464 if constexpr (std::is_function_v<T>)
1465 {
1466 p = reinterpret_cast<void*> (v);
1467 }
1468 else
1469 {
1470 const volatile void* cvp = v;
1471 p = const_cast<void*> (cvp);
1472 }
1473
1474#if defined(__GNUC__)
1475#pragma GCC diagnostic push
1476
1477#if defined(__clang__)
1478#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
1479#endif // defined(__clang__)
1480#endif // defined(__GNUC__)
1481
1482 char buf[20];
1483 snprintf (buf, sizeof (buf), "%p", p);
1484 buffer.append (buf);
1485
1486#if defined(__GNUC__)
1487#pragma GCC diagnostic pop
1488#endif // defined(__GNUC__)

Reference append_pointer.

Referenced by append_pointer, micro_os_plus::micro_test_plus::detail::expression_formatter::operator<< and micro_os_plus::micro_test_plus::detail::reporter::operator<<.

approx_op()​

template <class Lhs_T, class Rhs_T, class Epsilon_T>
micro_os_plus::micro_test_plus::detail::approx_op (Lhs_T &&, Rhs_T &&, Epsilon_T &&)

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.

Definition at line 1055 of file detail.h.

as_comparison_integer()​

template <class T>
comparison_integer_t< T > micro_os_plus::micro_test_plus::detail::as_comparison_integer (const T value)
nodiscard constexpr noexcept

Converts an integer or a character to the type used to compare it.

The conversion keeps the value, since the type has the same size and signedness. Applied to both operands of the std::cmp_*() functions, which do not accept the character types.

Template Parameters
T

The type of the operand.

Parameters
value

The operand.

Returns

The value, as comparison_integer_t<T>.

Definition at line 343 of file detail-inlines.h.

343 as_comparison_integer (const T value) noexcept
344 {
345 return static_cast<comparison_integer_t<T>> (value);
346 }

Reference as_comparison_integer.

Referenced by micro_os_plus::micro_test_plus::detail::equal_to::apply, micro_os_plus::micro_test_plus::detail::greater::apply, micro_os_plus::micro_test_plus::detail::greater_equal::apply, micro_os_plus::micro_test_plus::detail::less::apply, micro_os_plus::micro_test_plus::detail::less_equal::apply, micro_os_plus::micro_test_plus::detail::not_equal_to::apply and as_comparison_integer.

as_operand()​

template <class T>
decltype(auto) micro_os_plus::micro_test_plus::detail::as_operand (T && t)
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.

1725 constexpr auto
1726 as_operand (T&& t) noexcept -> decltype (auto)
1727 {
1728 using type = std::remove_cvref_t<T>;
1729 // The cv-qualifiers of an array are those of its elements, which
1730 // std::remove_cvref_t removes; keep volatile for the element type.
1731 using element_type = std::remove_const_t<
1732 std::remove_extent_t<std::remove_reference_t<T>>>;
1733
1734 if constexpr (std::is_array_v<type> && character<element_type>
1735 && not std::is_volatile_v<element_type>)
1736 {
1738 t, std::extent_v<type>
1739 };
1740 }
1741 else if constexpr (character_pointer<type>)
1742 {
1744 t
1745 };
1746 }
1747 else if constexpr (std::is_array_v<type>)
1748 {
1749 // Other arrays (e.g. byte buffers) are compared by content.
1751 static_cast<const element_type*> (t), std::extent_v<type>
1752 };
1753 }
1754 else if constexpr (std::is_function_v<type>)
1755 {
1756 // Functions are compared by address, as function pointers.
1757 return &t;
1758 }
1759 else
1760 {
1761 return std::forward<T> (t);
1762 }

Reference 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, as_operand, 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.

bind_callable()​

template <typename Self_T, typename Callable_T, typename... Args_T>
auto micro_os_plus::micro_test_plus::detail::bind_callable (Callable_T && callable, Args_T &&... arguments)
nodiscard

Creates the function object that holds the body of a test case or suite.

Without additional arguments, the callable already has the signature void (Self_T&), and a copy of it is returned, without a wrapper.

Otherwise, a bound_callable stores copies of the callable and of the arguments (decayed, as by auto), since a suite may run after the caller's temporaries are gone; the callable receives the copies as non-const lvalues. A reference parameter thus refers to the copy; to refer to the caller's object, pass a pointer, or std::ref(), which converts to a T& parameter (an auto& parameter receives the std::reference_wrapper itself).

The returned object holds a copy of the callable (decayed, as by auto) when there are no additional arguments; otherwise it is a bound_callable that holds copies of the callable and of the arguments, and passes the arguments after the leading reference, which is passed when the body is invoked. No memory is allocated, other than by the copies themselves.

A suite stores the object in a std::function, since it runs later; a test case, which runs immediately, refers to it with a callable_ref.

Template Parameters
Self_T

The type referred to by the first parameter of the callable (test_case or suite).

Callable_T

The type of the callable object.

Args_T

The types of the additional callable arguments.

Parameters
callable

A generic callable object, usually a lambda.

arguments

A possibly empty list of arguments forwarded to the callable after the leading Self_T& reference.

Returns

The function object, invocable with a Self_T& argument.

Definition at line 344 of file test-inlines.h.

344 bind_callable (Callable_T&& callable, Args_T&&... arguments)
345 {
346 if constexpr (sizeof...(arguments) == 0)
347 {
348 return std::forward<Callable_T> (callable);
349 }
350 else
351 {
353 std::decay_t<Args_T>...>{
354 std::forward<Callable_T> (callable),
355 std::forward<Args_T> (arguments)...
356 };
357 }
358 }

Reference bind_callable.

Referenced by bind_callable and micro_os_plus::micro_test_plus::detail::runnable_base::create_test_case.

compare_op()​

template <class Lhs_T, class Rhs_T, class Compare_T>
micro_os_plus::micro_test_plus::detail::compare_op (Lhs_T &&, Rhs_T &&, Compare_T)

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 as_operand and differ_by_at_most.

differ_by_at_most()​

template <class Lhs_T, class Rhs_T, class Epsilon_T>
bool micro_os_plus::micro_test_plus::detail::differ_by_at_most (Lhs_T lhs, Rhs_T rhs, Epsilon_T epsilon)
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.

940 constexpr bool
941 differ_by_at_most (Lhs_T lhs, Rhs_T rhs, Epsilon_T epsilon)
942 {
943 if constexpr (std::is_integral_v<Lhs_T> and std::is_integral_v<Rhs_T>
944 and std::is_integral_v<Epsilon_T>)
945 {
946 bool overflow = false;
947 const auto distance
948 = [&overflow] (auto larger,
949 auto smaller) constexpr -> std::uintmax_t
950 {
951 if constexpr (std::is_signed_v<decltype (smaller)>)
952 {
953 if (smaller < 0 and std::cmp_greater_equal (larger, 0))
954 {
955 // The magnitude of the negative value, without
956 // negating the minimum of its type.
957 const auto magnitude
958 = static_cast<std::uintmax_t> (-(smaller + 1)) + 1u;
959 const auto upper = static_cast<std::uintmax_t> (larger);
960 if (upper > std::numeric_limits<std::uintmax_t>::max ()
961 - magnitude)
962 {
963 overflow = true;
964 return std::numeric_limits<std::uintmax_t>::max ();
965 }
966 return upper + magnitude;
967 }
968 }
969 return static_cast<std::uintmax_t> (larger)
970 - static_cast<std::uintmax_t> (smaller);
971 };
972
973 const std::uintmax_t difference = std::cmp_less (lhs, rhs)
974 ? distance (rhs, lhs)
975 : distance (lhs, rhs);
976 return !overflow && std::cmp_less_equal (difference, epsilon);
977 }
978 else
979 {
980 using float_type = std::common_type_t<Lhs_T, Rhs_T, Epsilon_T>;
981 const auto left = static_cast<float_type> (lhs);
982 const auto right = static_cast<float_type> (rhs);
983
984#if defined(__GNUC__)
985#pragma GCC diagnostic push
986#pragma GCC diagnostic ignored "-Wfloat-equal"
987#endif // defined(__GNUC__)
988 // The exact comparison is deliberate, for the infinities.
989 const float_type distance
990 = (left == right) ? float_type{} : math::abs (left - right);
991#if defined(__GNUC__)
992#pragma GCC diagnostic pop
993#endif // defined(__GNUC__)
994
995 return distance <= static_cast<float_type> (epsilon);
996 }

References micro_os_plus::micro_test_plus::detail::math::abs and differ_by_at_most.

Referenced by micro_os_plus::micro_test_plus::detail::approx_op< Lhs_T, Rhs_T, Epsilon_T >::approx_op, compare_op and differ_by_at_most.

endl()​

reporter & micro_os_plus::micro_test_plus::detail::endl (reporter & stream)

Output stream manipulator for ending a line in test reports.

Calls reporter::end_line(), which appends a line ending to the internal buffer. Unlike std::endl, it does not flush; the buffer is written later, by the concrete reporters.

Parameters
stream

Reference to the reporter instance.

Returns

Reference to the same reporter instance, enabling chaining of output operations.

The endl function calls reporter::end_line(), which appends a newline character to the buffer of the specified reporter.

Definition at line 218 of file reporter.cpp.

218 endl (reporter& stream)
219 {
220 stream.end_line ();
221 return stream;
222 }

References micro_os_plus::micro_test_plus::detail::reporter::end_line and endl.

Referenced by endl, micro_os_plus::micro_test_plus::detail::reporter_human::fail_suite, micro_os_plus::micro_test_plus::detail::reporter_tap::fail_suite, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_prefix, micro_os_plus::micro_test_plus::detail::reporter_human::output_fail_suffix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_suffix, micro_os_plus::micro_test_plus::detail::reporter_human::output_pass_suffix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_pass_suffix and micro_os_plus::micro_test_plus::detail::reporter_tap::pass_without_text.

escape_control_characters()​

void micro_os_plus::micro_test_plus::detail::escape_control_characters (std::string & name)

Escapes the control characters of a name.

Replaces, in place, the control characters other than the tab, including the line feed and the NUL, with their escape sequences, so that the names reach the console and the output files as one line of visible text. Defined in src/test.cpp.

Parameters
name

The name to escape.

The text is scanned first, so that a name without control characters is not touched. The tab is kept; all the other control characters, including the line feed and the NUL, and DEL, are replaced.

Definition at line 80 of file test.cpp.

80 escape_control_characters (std::string& name)
81 {
82 const auto is_control = [] (char c)
83 {
84 const auto unit = static_cast<unsigned char> (c);
85 return (unit < 0x20 && c != '\t') || unit == 0x7F;
86 };
87
88 std::size_t first = 0;
89 while (first < name.size () && !is_control (name[first]))
90 {
91 ++first;
92 }
93 if (first == name.size ())
94 {
95 return;
96 }
97
98 std::string escaped (name, 0, first);
99 escaped.reserve (name.size () + 8);
100 for (std::size_t i = first; i < name.size (); ++i)
101 {
102 if (is_control (name[i]))
103 {
104 append_control_escape (escaped, name[i]);
105 }
106 else
107 {
108 escaped.push_back (name[i]);
109 }
110 }
111 name = std::move (escaped);
112 }

References append_control_escape and escape_control_characters.

Referenced by micro_os_plus::micro_test_plus::located_name::located_name, micro_os_plus::micro_test_plus::located_name::located_name, micro_os_plus::micro_test_plus::located_name::located_name, micro_os_plus::micro_test_plus::located_name::located_name and escape_control_characters.

indent()​

indentation micro_os_plus::micro_test_plus::detail::indent (size_t level)
inline nodiscard

Factory function that creates an indentation manipulator.

Returns an indentation aggregate initialised with level.

Allows writing reporter << indent(n) instead of constructing the manipulator explicitly.

Parameters
level

The number of four-space indentation levels.

Returns

An indentation value for use with operator<<.

Definition at line 64 of file reporter-inlines.h.

64 indent (size_t level)
65 {
66 return { level };
67 }

Reference indent.

Referenced by micro_os_plus::micro_test_plus::detail::reporter_human::begin_test_case, micro_os_plus::micro_test_plus::detail::reporter_tap::begin_test_case, micro_os_plus::micro_test_plus::detail::reporter_human::display_open_heading, micro_os_plus::micro_test_plus::detail::reporter_tap::display_open_heading, 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_human::fail_suite, micro_os_plus::micro_test_plus::detail::reporter_tap::fail_suite, indent, micro_os_plus::micro_test_plus::detail::reporter_human::output_fail_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_fail_suffix, micro_os_plus::micro_test_plus::detail::reporter_human::output_pass_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::output_pass_prefix, micro_os_plus::micro_test_plus::detail::reporter_tap::pass_without_text, micro_os_plus::micro_test_plus::detail::reporter_human::skip_test_case and micro_os_plus::micro_test_plus::detail::reporter_tap::skip_test_case.

integral_literal()​

template <class T, char... Cs>
auto micro_os_plus::micro_test_plus::detail::integral_literal (void)
nodiscard constexpr

Creates the compile-time constant of an integer literal.

Template Parameters
T

The integral type of the literal.

Cs

The characters of the literal, as received by a literal operator template.

Used by the integer literal operators (_i, _u8, etc.).

Parameters

None.

Returns

An integral_constant with the value of the literal, or, when the value is the absolute value of the minimum of a signed T, an integral_min_magnitude<T>, valid only when negated.

The value is checked by math::integer_magnitude(), which accepts, for the signed types, the absolute value of the minimum; this value does not fit in T, so it is represented by integral_min_magnitude<T>.

Definition at line 581 of file deprecated-inlines.h.

582 {
583 constexpr unsigned long long magnitude
584 = math::integer_magnitude<T, Cs...> ();
585
586 if constexpr (magnitude > static_cast<unsigned long long> (
587 std::numeric_limits<T>::max ()))
588 {
590 }
591 else
592 {
593 return integral_constant<static_cast<T> (magnitude)>{};
594 }
595 }

References micro_os_plus::micro_test_plus::detail::integral_constant< N >::integral_constant, micro_os_plus::micro_test_plus::detail::math::integer_magnitude and integral_literal.

Referenced by integral_literal, micro_os_plus::micro_test_plus::literals::operator""_c, micro_os_plus::micro_test_plus::literals::operator""_i, micro_os_plus::micro_test_plus::literals::operator""_i16, micro_os_plus::micro_test_plus::literals::operator""_i32, micro_os_plus::micro_test_plus::literals::operator""_i64, micro_os_plus::micro_test_plus::literals::operator""_i8, micro_os_plus::micro_test_plus::literals::operator""_l, micro_os_plus::micro_test_plus::literals::operator""_ll, micro_os_plus::micro_test_plus::literals::operator""_s, micro_os_plus::micro_test_plus::literals::operator""_sc, micro_os_plus::micro_test_plus::literals::operator""_u, micro_os_plus::micro_test_plus::literals::operator""_u16, micro_os_plus::micro_test_plus::literals::operator""_u32, micro_os_plus::micro_test_plus::literals::operator""_u64, micro_os_plus::micro_test_plus::literals::operator""_u8, micro_os_plus::micro_test_plus::literals::operator""_uc, micro_os_plus::micro_test_plus::literals::operator""_ul, micro_os_plus::micro_test_plus::literals::operator""_ull and micro_os_plus::micro_test_plus::literals::operator""_us.

or_op()​

template <typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::or_op (Lhs_T &&, Rhs_T &&)

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.

Definition at line 1166 of file detail.h.

predicate_op()​

template <class T, class Predicate_T>
micro_os_plus::micro_test_plus::detail::predicate_op (T &&, Predicate_T)

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.

Definition at line 1301 of file detail.h.

read_clock()​

void micro_os_plus::micro_test_plus::detail::read_clock (timespec & ts)
noexcept

Reads the system clock.

Isolates the platform-specific access to the system clock, used by stopwatch and by the deprecated timestamp class. The clock is monotonic on POSIX; without a clock, ts is left unchanged, so the callers clear it first when a zero value must mean that the clock was not read.

Parameters
[out] ts

The timespec where the reading is stored.

Returns

Nothing.

On Windows, the current time is captured via timespec_get() with TIME_UTC. On POSIX platforms with CLOCK_MONOTONIC defined, clock_gettime(CLOCK_MONOTONIC) is used to obtain a monotonic reading. On platforms where neither macro is defined, ts is left unchanged.

Definition at line 66 of file stopwatch.cpp.

66 read_clock (timespec& ts) noexcept
67 {
68#if defined(_WIN32)
69 timespec_get (&ts, TIME_UTC);
70#elif defined(CLOCK_MONOTONIC)
71 clock_gettime (CLOCK_MONOTONIC, &ts);
72#else
73 (void)ts;
74#endif // defined(_WIN32) || defined(CLOCK_MONOTONIC)
75 }

Reference read_clock.

Referenced by micro_os_plus::micro_test_plus::detail::timestamp::timestamp, read_clock, micro_os_plus::micro_test_plus::detail::stopwatch::start, micro_os_plus::micro_test_plus::detail::stopwatch::stop, micro_os_plus::micro_test_plus::detail::stopwatch::timestamp_begin and micro_os_plus::micro_test_plus::detail::stopwatch::timestamp_end.

reject_compare_tag()​

template <class Tag_T>
void micro_os_plus::micro_test_plus::detail::reject_compare_tag (void)
constexpr noexcept

Stops the compilation of a compare_op whose tag is rejected, with a message that tells why.

Always fails the static assertion that applies, since it is called only when extension::compare_tag is not satisfied: the missing or unprintable symbol is reported first, then the apply() that cannot be called with the operands, or whose result is not convertible to bool.

Template Parameters
Tag_T

The tag of the comparator.

Parameters

None.

Returns

Nothing.

Definition at line 778 of file detail-inlines.h.

778 constexpr void
779 reject_compare_tag (void) noexcept
780 {
781 if constexpr (not tag_has_symbol<Tag_T>)
782 {
783 static_assert (not std::is_same_v<Tag_T, Tag_T>,
784 "the tag of a comparator needs a static member "
785 "symbol that can be written, such as a const "
786 "char*");
787 }
788 else
789 {
790 static_assert (not std::is_same_v<Tag_T, Tag_T>,
791 "the tag of a comparator needs a static member "
792 "function apply (lhs, rhs) that can be called with "
793 "the operands and returns a value convertible to "
794 "bool");
795 }

Reference reject_compare_tag.

Referenced by reject_compare_tag.

reject_comparison()​

template <comparison Op, class Lhs_T, class Rhs_T>
void micro_os_plus::micro_test_plus::detail::reject_comparison (void)
constexpr noexcept

Stops the compilation of a comparator whose operands are rejected, with a message that tells why.

Always fails the static assertion that applies, since it is called only when comparable_operands is not satisfied: an operand that cannot be written is reported first, then the operator that the operands do not support. Called by the overloads of the comparators that accept the rejected operands, so that the compiler shows this message instead of a list of the unsatisfied constraints.

Template Parameters
Op

The comparison of the comparator.

Lhs_T

The type of the left operand.

Rhs_T

The type of the right operand.

Parameters

None.

Returns

Nothing.

Definition at line 557 of file detail-inlines.h.

557 constexpr void
558 reject_comparison (void) noexcept
559 {
560 if constexpr (not extension::printable<Lhs_T>
562 {
563 static_assert (not std::is_same_v<Lhs_T, Lhs_T>,
564 "an operand of the comparator cannot be written in "
565 "the report; define an operator<< (mt::"
566 "expression_formatter&, const T&) in the namespace "
567 "of its type");
568 }
569 else if constexpr (Op == comparison::equal)
570 {
571 static_assert (not std::is_same_v<Lhs_T, Lhs_T>,
572 "the operands of eq () cannot be compared with ==");
573 }
574 else if constexpr (Op == comparison::not_equal)
575 {
576 static_assert (not std::is_same_v<Lhs_T, Lhs_T>,
577 "the operands of ne () cannot be compared with !=");
578 }
579 else if constexpr (Op == comparison::greater)
580 {
581 static_assert (not std::is_same_v<Lhs_T, Lhs_T>,
582 "the operands of gt () cannot be compared with >");
583 }
584 else if constexpr (Op == comparison::greater_equal)
585 {
586 static_assert (not std::is_same_v<Lhs_T, Lhs_T>,
587 "the operands of ge () cannot be compared with >=");
588 }
589 else if constexpr (Op == comparison::less)
590 {
591 static_assert (not std::is_same_v<Lhs_T, Lhs_T>,
592 "the operands of lt () cannot be compared with <");
593 }
594 else
595 {
596 static_assert (not std::is_same_v<Lhs_T, Lhs_T>,
597 "the operands of le () cannot be compared with <=");
598 }

References equal, greater, greater_equal, less, not_equal and reject_comparison.

Referenced by reject_comparison.

reject_predicate_tag()​

template <class Tag_T>
void micro_os_plus::micro_test_plus::detail::reject_predicate_tag (void)
constexpr noexcept

Stops the compilation of a predicate_op whose tag is rejected, with a message that tells why.

As reject_compare_tag(), for the tag of a predicate, whose apply() takes one operand; called only when extension::predicate_tag is not satisfied.

Template Parameters
Tag_T

The tag of the predicate.

Parameters

None.

Returns

Nothing.

Definition at line 815 of file detail-inlines.h.

815 constexpr void
816 reject_predicate_tag (void) noexcept
817 {
818 if constexpr (not tag_has_symbol<Tag_T>)
819 {
820 static_assert (not std::is_same_v<Tag_T, Tag_T>,
821 "the tag of a predicate needs a static member "
822 "symbol that can be written, such as a const "
823 "char*");
824 }
825 else
826 {
827 static_assert (not std::is_same_v<Tag_T, Tag_T>,
828 "the tag of a predicate needs a static member "
829 "function apply (operand) that can be called with "
830 "the operand and returns a value convertible to "
831 "bool");
832 }

Reference reject_predicate_tag.

Referenced by reject_predicate_tag.

reject_suite_body()​

template <typename Callable_T, typename... Args_T>
void micro_os_plus::micro_test_plus::detail::reject_suite_body (void)
constexpr noexcept

Stops the compilation with a message that tells what the body of a suite takes.

Always fails the static assertion that applies, since it is called only when suite_body is not satisfied. A body that cannot be copied, or a body written for a test case, is recognised, to say so.

Called by the overloads of runner::add_suite() and of the static_suite constructor that are selected when the callable is not a valid body, as reject_test_body() is for the test cases.

Template Parameters
Callable_T

The type of the callable.

Args_T

The types of the additional arguments.

Parameters

None.

Returns

Nothing.

Definition at line 448 of file test-inlines.h.

448 reject_suite_body (void) noexcept
449 {
450 if constexpr (not std::is_copy_constructible_v<std::decay_t<Callable_T>>
451 or not(std::is_copy_constructible_v<std::decay_t<Args_T>>
452 and ...))
453 {
454 static_assert (dependent_false_v<Callable_T, Args_T...>,
455 "the body of a suite and its additional arguments "
456 "must be copyable, since the suite runs later");
457 }
458 else if constexpr (std::is_invocable_v<std::decay_t<Callable_T>&,
459 test_case&,
460 std::decay_t<Args_T>&...>)
461 {
462 static_assert (dependent_false_v<Callable_T, Args_T...>,
463 "the body of a suite takes a suite& as its first "
464 "parameter, not a test_case&");
465 }
466 else
467 {
468 static_assert (dependent_false_v<Callable_T, Args_T...>,
469 "the body of a suite takes a suite& as its first "
470 "parameter, followed by the additional arguments");
471 }
472 }

References dependent_false_v and reject_suite_body.

Referenced by micro_os_plus::micro_test_plus::runner::add_suite and reject_suite_body.

reject_test_body()​

template <typename Callable_T, typename... Args_T>
void micro_os_plus::micro_test_plus::detail::reject_test_body (void)
constexpr noexcept

Stops the compilation with a message that tells what the body of a test case takes.

Always fails the static assertion that applies, since it is called only when test_body is not satisfied. A body written for a suite is recognised, to say so.

Called by the overloads of test_case::test() and suite::test() that are selected when the callable is not a valid body, so that the diagnostic names the mistake in the terms of the application, instead of the concepts and the instantiation stack. Never called at run time.

Template Parameters
Callable_T

The type of the callable.

Args_T

The types of the additional arguments.

Parameters

None.

Returns

Nothing.

Definition at line 422 of file test-inlines.h.

422 reject_test_body (void) noexcept
423 {
424 if constexpr (std::is_invocable_v<std::decay_t<Callable_T>&, suite&,
425 std::decay_t<Args_T>&...>)
426 {
427 static_assert (dependent_false_v<Callable_T, Args_T...>,
428 "the body of a test case takes a test_case& as its "
429 "first parameter, not a suite&");
430 }
431 else
432 {
433 static_assert (dependent_false_v<Callable_T, Args_T...>,
434 "the body of a test case takes a test_case& as its "
435 "first parameter, followed by the additional "
436 "arguments passed to test ()");
437 }
438 }

References dependent_false_v and reject_test_body.

Referenced by reject_test_body.

test_each_value()​

template <class Self_T, class Values_T, class Callable_T>
void micro_os_plus::micro_test_plus::detail::test_each_value (Self_T & self, const located_name & name, Values_T && values, Callable_T & callable)

Adds and runs a test case for each value.

For each value, the name is built in a local string, which lives while the test case runs, since a test case runs within the call to test(), and the test case is added with test(), with the location of the call to test_each(). The callable receives each value as a const lvalue, referring to the element itself; neither the values nor the callable are copied. The values of a range are iterated by a range-based for statement, and those of a tuple are expanded by std::apply(), in order.

The common implementation of test_case::test_each() and suite::test_each().

Template Parameters
Self_T

The type of the test case or suite.

Values_T

The type of the range or tuple of values.

Callable_T

The type of the callable object.

Parameters
self

The test case or suite to which the test cases are added.

name

The common name of the test cases.

values

The range or tuple of values.

callable

The callable object, invoked with the test case and each value.

Returns

Nothing.

Definition at line 1029 of file test-inlines.h.

1029 test_each_value (Self_T& self, const located_name& name, Values_T&& values,
1030 Callable_T& callable)
1031 {
1032 std::size_t position = 0;
1033
1034 const auto run_one
1035 = [&self, &name, &callable, &position] (const auto& value)
1036 {
1037 ++position;
1038
1039 std::string text{ name.name () };
1040 text += " (";
1041 if constexpr (extension::printable<
1042 std::remove_cvref_t<decltype (value)>>)
1043 {
1045 }
1046 else
1047 {
1048 text += '#';
1049 plain_text::append (text, position);
1050 }
1051 text += ')';
1052
1053 // The test case runs within this call, so the value and the
1054 // callable are captured by reference, not copied.
1055 self.test (located_name{ std::move (text), name.location () },
1056 [&callable, &value] (auto& test_self)
1057 {
1058 if constexpr (std::is_member_pointer_v<
1059 std::remove_cvref_t<Callable_T>>)
1060 {
1061 std::invoke (callable, test_self, value);
1062 }
1063 else
1064 {
1065 callable (test_self, value);
1066 }
1067 });
1068 };
1069
1070 if constexpr (test_values_range<Values_T>)
1071 {
1072 for (const auto& value : values)
1073 {
1074 run_one (value);
1075 }
1076 }
1077 else
1078 {
1079 std::apply ([&run_one] (const auto&... elements)
1080 { (run_one (elements), ...); }, values);
1081 }
1082 }

References micro_os_plus::micro_test_plus::detail::plain_text::append, micro_os_plus::micro_test_plus::located_name::location, micro_os_plus::micro_test_plus::located_name::name and test_each_value.

Referenced by micro_os_plus::micro_test_plus::suite::test_each, micro_os_plus::micro_test_plus::suite::test_each, micro_os_plus::micro_test_plus::test_case::test_each, micro_os_plus::micro_test_plus::test_case::test_each and test_each_value.

unwrap()​

template <class T>
decltype(auto) constexpr micro_os_plus::micro_test_plus::detail::unwrap (const T & t)
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.

98 unwrap (const T& t)
99 {
100#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
101 if constexpr (extension::is_op<T> && requires { t.get (); })
102 return t.get ();
103 else
104#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
105 return t;
106 }

Reference 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, unwrap and within_tolerance.

unwrap()​

template <class T>
decltype(auto) micro_os_plus::micro_test_plus::detail::unwrap (const T & t)
nodiscard constexpr

Returns the value wrapped by a framework type, or the operand itself.

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.

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.

Definition at line 98 of file detail-inlines.h.

98 unwrap (const T& t)
99 {
100#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
101 if constexpr (extension::is_op<T> && requires { t.get (); })
102 return t.get ();
103 else
104#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
105 return t;
106 }

Reference 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, unwrap and within_tolerance.

Variables​

colours_none​

colours micro_os_plus::micro_test_plus::detail::colours_none {}
constexpr

Predefined colour set, without escape sequences.

Used by the formatters that write the messages of the checks, which are never coloured; all members are empty strings.

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

184 inline constexpr colours colours_none{};

Referenced by micro_os_plus::micro_test_plus::detail::expression_formatter::expression_formatter and micro_os_plus::micro_test_plus::detail::expression_formatter::expression_formatter.

colours_red_green​

colours micro_os_plus::micro_test_plus::detail::colours_red_green
constexpr

Predefined colour set, with green for pass and red for fail.

Initialiser
                                           = {   "\033[0m",   "\033[32m",   "\033[31m" }

Assigned by reporters that output to a colour-capable terminal; the members are, in order, the reset, pass, and fail ANSI escape sequences.

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

171 inline constexpr colours colours_red_green = {
172 "\033[0m",
173 "\033[32m",
174 "\033[31m"
175 };

Referenced by micro_os_plus::micro_test_plus::detail::reporter_human::reporter_human.

dependent_false_v​

template <typename... Ts>
bool micro_os_plus::micro_test_plus::detail::dependent_false_v = false
constexpr

A value that is always false, but depends on the template arguments.

Used as the condition of the static_assert of the functions that reject an argument, so that they fail only when instantiated, and their diagnostic has the message, not the concepts that were not satisfied.

Template Parameters
Ts

The template arguments to depend on.

Definition at line 1258 of file test.h.

1258 inline constexpr bool dependent_false_v = false;

Referenced by reject_suite_body and reject_test_body.


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


Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.