micro-test-plus 6.0.1
µTest++ Testing Framework
Loading...
Searching...
No Matches
detail-inlines.h File Reference

C++ header file with inline implementations for the µTest++ internal detail namespace. More...

#include <algorithm>
#include <cerrno>
#include <cfloat>
#include <charconv>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <exception>
#include <limits>

Go to the source code of this file.

Classes

struct  micro_os_plus::micro_test_plus::detail::comparison_integer< T >
 The integer type used to compare a value of type T. More...
struct  micro_os_plus::micro_test_plus::detail::comparison_integer< T >
 The integer type used to compare a character type. More...

Namespaces

namespace  micro_os_plus
 The primary namespace for the µOS++ framework.
namespace  micro_os_plus::micro_test_plus
 Primary namespace for the µTest++ testing framework.
namespace  micro_os_plus::micro_test_plus::detail
 Internal implementation details for the µTest++ framework.
namespace  micro_os_plus::micro_test_plus::detail::comparison_lookup
 Names for the checks of the comparison operators, looked up as the apply() functions look them up.

Concepts

concept  micro_os_plus::micro_test_plus::detail::comparable
 Concept satisfied when two operands can be compared by the comparator selected by Op.
concept  micro_os_plus::micro_test_plus::detail::comparable_operands
 Concept satisfied when the operands of a comparator can be written and compared.
concept  micro_os_plus::micro_test_plus::detail::comparison_lookup::can_compare
 Satisfied if the comparison selected by Op of two const objects is well-formed.
concept  micro_os_plus::micro_test_plus::detail::function_pointer_pair
 Concept satisfied by two pointers, one of which points to a function.
concept  micro_os_plus::micro_test_plus::detail::sign_mixed_integers
 Concept satisfied by two integer types of different signedness.
concept  micro_os_plus::micro_test_plus::detail::tag_has_symbol
 Concept satisfied when the tag of a comparator or of a predicate has a symbol that can be written.

Typedefs

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.
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.

Enumerations

enum class  micro_os_plus::micro_test_plus::detail::comparison : unsigned char {
  micro_os_plus::micro_test_plus::detail::equal ,
  micro_os_plus::micro_test_plus::detail::not_equal ,
  micro_os_plus::micro_test_plus::detail::greater ,
  micro_os_plus::micro_test_plus::detail::greater_equal ,
  micro_os_plus::micro_test_plus::detail::less ,
  micro_os_plus::micro_test_plus::detail::less_equal
}
 The comparison operators, as the template argument of the comparable concept. More...

Functions

template<class T>
requires std::is_arithmetic_v<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<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.
template<class T>
constexpr comparison_integer_t< T > micro_os_plus::micro_test_plus::detail::as_comparison_integer (const T value) noexcept
 Converts an integer or a character to the type used to compare it.
template<class T>
constexpr auto micro_os_plus::micro_test_plus::detail::as_operand (T &&t) noexcept -> decltype(auto)
 Prepares an operand of a comparator.
template<class Lhs_T, class Rhs_T, class Epsilon_T>
constexpr bool micro_os_plus::micro_test_plus::detail::differ_by_at_most (Lhs_T lhs, Rhs_T rhs, Epsilon_T epsilon)
 Tells whether two numbers differ by at most a tolerance.
template<class T, class R>
requires (container_like<R> and std::three_way_comparable_with< T, typename range_element<R>::type>)
constexpr auto micro_os_plus::micro_test_plus::detail::operator<=> (const array_operand< T > &lhs, const R &rhs)
 Orders an array operand and a range lexicographically.
template<character Char_T>
constexpr 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) noexcept
 Orders two C string operands.
template<character Char_T>
constexpr 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) noexcept
 Orders a C string operand and a string.
template<class T, class R>
requires (container_like<R> and std::equality_comparable_with< T, typename range_element<R>::type>)
constexpr bool micro_os_plus::micro_test_plus::detail::operator== (const array_operand< T > &lhs, const R &rhs)
 Compares an array operand with a range for equality.
template<character Char_T>
constexpr bool micro_os_plus::micro_test_plus::detail::operator== (const basic_c_string< Char_T > &lhs, const basic_c_string< Char_T > &rhs) noexcept
 Compares two C string operands for equality.
template<character Char_T>
constexpr bool micro_os_plus::micro_test_plus::detail::operator== (const basic_c_string< Char_T > &lhs, std::nullptr_t) noexcept
 Checks whether a C string operand is a null pointer.
template<character Char_T>
constexpr 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) noexcept
 Compares a C string operand with a string.
template<class Tag_T>
constexpr void micro_os_plus::micro_test_plus::detail::reject_compare_tag (void) noexcept
 Stops the compilation of a compare_op whose tag is rejected, with a message that tells why.
template<comparison Op, class Lhs_T, class Rhs_T>
constexpr void micro_os_plus::micro_test_plus::detail::reject_comparison (void) noexcept
 Stops the compilation of a comparator whose operands are rejected, with a message that tells why.
template<class Tag_T>
constexpr void micro_os_plus::micro_test_plus::detail::reject_predicate_tag (void) noexcept
 Stops the compilation of a predicate_op whose tag is rejected, with a message that tells why.
template<class T>
constexpr decltype(auto) micro_os_plus::micro_test_plus::detail::unwrap (const T &t)
 Returns the value wrapped by a framework type, or the operand itself.
template<class Lhs_T, class Rhs_T>
requires (extension::has_epsilon<Lhs_T> or extension::has_epsilon<Rhs_T>)
constexpr bool micro_os_plus::micro_test_plus::detail::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.

Detailed Description

This header provides the out-of-line template and inline implementations for all types declared in detail.h. It defines the bodies of the unwrap() helper, the unary and binary operator base class templates, the comparison tags, all relational, approximate, and logical comparator constructors, the predicate constructor, the tolerance helpers (within_tolerance(), differ_by_at_most()), the callable operator types (throws_op, nothrow_op), the append_number() and append_pointer() formatting helpers, the basic_c_string operand and its operators, and as_operand().

Separating the implementations from the declarations keeps detail.h concise and focused on the interface, whilst grouping the complex lambda-based constructor bodies here for maintainability.

All definitions reside within the micro_os_plus::micro_test_plus::detail namespace.

This file is included by detail.h; the applications include micro-os-plus/micro-test-plus.h, not this file.

Definition in file detail-inlines.h.