micro-test-plus 3.2.2
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::detail Namespace Reference

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

Classes

struct  and_
 Logical AND comparator struct template. More...
struct  assertion
 Assertion struct template for parameter passing to the evaluator. More...
class  deferred_reporter
 Deferred reporter class template for a specific expression. More...
class  deferred_reporter_base
 Base class for a deferred reporter that collects messages into a string. More...
struct  eq_
 Equality comparator struct template. More...
struct  ge_
 Greater than or equal comparator struct template. More...
struct  gt_
 Greater than comparator struct template. More...
struct  le_
 Less than or equal comparator struct template. More...
struct  lt_
 Less than comparator struct template. More...
struct  ne_
 Non-equality comparator struct template. More...
struct  not_
 Logical NOT comparator struct template. More...
struct  nothrow_
 Operator struct template to check if an expression does not throw any exception. More...
struct  or_
 Logical OR comparator struct template. More...
struct  throws_
 Operator struct template to check if an expression throws a specific exception. More...
struct  throws_< Callable_T, void >
 Operator struct template to check if an expression throws any exception. More...

Functions

template<typename Lhs_T, typename Rhs_T>
 and_ (const Lhs_T &, const Rhs_T &) -> and_< Lhs_T, Rhs_T >
template<typename Lhs_T, typename Rhs_T>
 eq_ (const Lhs_T &, const Rhs_T &) -> eq_< Lhs_T, Rhs_T >
template<typename Lhs_T, typename Rhs_T>
 ge_ (const Lhs_T &, const Rhs_T &) -> ge_< Lhs_T, Rhs_T >
template<class T>
constexpr auto get (const T &t)
 Generic getter function template for value retrieval.
template<class T>
constexpr auto get_impl (const T &t, int) -> decltype(t.get())
 Generic getter function template for value retrieval.
template<class T>
constexpr auto get_impl (const T &t,...) -> decltype(auto)
 Fallback variadic getter function template.
template<typename Lhs_T, typename Rhs_T>
 gt_ (const Lhs_T &, const Rhs_T &) -> gt_< Lhs_T, Rhs_T >
template<typename Lhs_T, typename Rhs_T>
 le_ (const Lhs_T &, const Rhs_T &) -> le_< Lhs_T, Rhs_T >
template<typename Lhs_T, typename Rhs_T>
 lt_ (const Lhs_T &, const Rhs_T &) -> lt_< Lhs_T, Rhs_T >
template<typename Lhs_T, typename Rhs_T>
 ne_ (const Lhs_T &, const Rhs_T &) -> ne_< Lhs_T, Rhs_T >
template<typename T>
 not_ (const T &) -> not_< T >
template<typename Lhs_T, typename Rhs_T>
 or_ (const Lhs_T &, const Rhs_T &) -> or_< Lhs_T, Rhs_T >

Detailed Description

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 assertion handling, generic getter utilities, comparator structures for logical and relational operations, mechanisms for exception checking, and base classes for deferred reporting of test results.

All definitions within detail are intended exclusively for internal use, ensuring a clear distinction between user-facing and internal components. This approach enhances maintainability, mitigates the risk of naming conflicts, and keeps the public API succinct.

The relevant header files are organised within the include/micro-os-plus folder to maintain a structured and modular codebase.

Function Documentation

◆ and_()

template<typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::and_ ( const Lhs_T & ,
const Rhs_T &  ) -> and_< Lhs_T, Rhs_T >

◆ eq_()

template<typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::eq_ ( const Lhs_T & ,
const Rhs_T &  ) -> eq_< Lhs_T, Rhs_T >

◆ ge_()

template<typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::ge_ ( const Lhs_T & ,
const Rhs_T &  ) -> ge_< Lhs_T, Rhs_T >

◆ get()

template<class T>
auto micro_os_plus::micro_test_plus::detail::get ( const T & t)
nodiscardconstexpr
Template Parameters
TThe type from which the value is to be retrieved.
Parameters
tThe object or value to be accessed.
Returns
The value obtained via the relevant getter implementation.

The get function template invokes the appropriate getter implementation to retrieve the value from the provided object or type. This function ensures consistent access to values for both custom and standard types within the framework.

The primary implementation attempts to invoke a get() method if it exists, which is recommended for user-defined types to ensure consistent value access. If the type does not provide a get() method, the fallback variadic implementation simply returns the original argument.

The get function template delegates to these implementations, enabling seamless support for a wide range of types in test expressions and comparators.

All definitions are intended for internal use within the framework and are implemented in the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.

Definition at line 223 of file detail.h.

◆ get_impl() [1/2]

template<class T>
auto micro_os_plus::micro_test_plus::detail::get_impl ( const T & t,
int  ) -> decltype (t.get ())
nodiscardconstexpr
Template Parameters
TThe type from which the value is to be retrieved.
Parameters
tThe object or value to be accessed.
Returns
The value obtained via the relevant getter implementation.

The get function template invokes the appropriate getter implementation to retrieve the value from the provided object or type. This function ensures consistent access to values for both custom and standard types within the framework.

The primary implementation attempts to invoke a get() method if it exists, which is recommended for user-defined types to ensure consistent value access. If the type does not provide a get() method, the fallback variadic implementation simply returns the original argument.

The get function template delegates to these implementations, enabling seamless support for a wide range of types in test expressions and comparators.

All definitions are intended for internal use within the framework and are implemented in the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.

Definition at line 160 of file detail.h.

◆ get_impl() [2/2]

template<class T>
auto micro_os_plus::micro_test_plus::detail::get_impl ( const T & t,
... ) -> decltype (auto)
nodiscardconstexpr
Template Parameters
TThe type from which the value is to be retrieved.
Parameters
tThe object or value to be accessed.
Returns
The original argument t.

The get_impl function template serves as a fallback mechanism for value retrieval when the provided type does not implement a get() member function. It simply returns the first argument, discarding any additional parameters.

This approach ensures that both custom types (with a get() method) and standard types (without a get() method) are supported seamlessly within the framework's generic getter utilities.

All definitions are intended for internal use within the framework and are implemented in the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.

Definition at line 189 of file detail.h.

◆ gt_()

template<typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::gt_ ( const Lhs_T & ,
const Rhs_T &  ) -> gt_< Lhs_T, Rhs_T >

◆ le_()

template<typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::le_ ( const Lhs_T & ,
const Rhs_T &  ) -> le_< Lhs_T, Rhs_T >

◆ lt_()

template<typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::lt_ ( const Lhs_T & ,
const Rhs_T &  ) -> lt_< Lhs_T, Rhs_T >

◆ ne_()

template<typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::ne_ ( const Lhs_T & ,
const Rhs_T &  ) -> ne_< Lhs_T, Rhs_T >

◆ not_()

template<typename T>
micro_os_plus::micro_test_plus::detail::not_ ( const T & ) -> not_< T >

◆ or_()

template<typename Lhs_T, typename Rhs_T>
micro_os_plus::micro_test_plus::detail::or_ ( const Lhs_T & ,
const Rhs_T &  ) -> or_< Lhs_T, Rhs_T >