micro-test-plus 3.2.2
µTest++ Testing Framework
Loading...
Searching...
No Matches
function-comparators.h File Reference

C++ header file with declarations for the µTest++ function comparators. More...

Go to the source code of this file.

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.

Functions

template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::_and (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic logical and operation.
template<class Expr_T>
constexpr auto micro_os_plus::micro_test_plus::_not (const Expr_T &expr)
 Generic logical not operation.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::_or (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic logical or operation.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::eq (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic equality comparator for non-pointer types.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::eq (Lhs_T *lhs, Rhs_T *rhs)
 Pointer equality comparator for any pointer types.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::ge (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic greater than or equal comparator.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::ge (Lhs_T *lhs, Rhs_T *rhs)
 Pointer greater than or equal comparator.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::gt (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic greater than comparator.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::gt (Lhs_T *lhs, Rhs_T *rhs)
 Pointer greater than comparator.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::le (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic less than or equal comparator.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::le (Lhs_T *lhs, Rhs_T *rhs)
 Pointer less than or equal comparator.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::lt (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic less than comparator.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::lt (Lhs_T *lhs, Rhs_T *rhs)
 Pointer less than comparator.
template<class T>
constexpr auto micro_os_plus::micro_test_plus::mut (const T &t) noexcept -> T &
 Generic mutator to remove const qualification from any type.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::ne (const Lhs_T &lhs, const Rhs_T &rhs)
 Generic non-equality comparator.
template<class Lhs_T, class Rhs_T>
constexpr auto micro_os_plus::micro_test_plus::ne (Lhs_T *lhs, Rhs_T *rhs)
 Pointer non-equality comparator.

Detailed Description

This header provides the declarations for the function comparator templates and logical operators used within the µTest++ framework. It defines the interfaces for generic and pointer-based comparison functions, including equality, non-equality, greater than, less than, and their respective logical variants. Additionally, it declares logical combinators such as conjunction (_and), disjunction (_or), and negation (_not), as well as a utility for safely removing constness from objects.

These comparators and logical operators enable expressive and type-safe test expectations and assertions, supporting both value and pointer semantics. The underscore-prefixed logical operators are intentionally named to avoid conflicts with standard operators and provide clear, readable test expressions.

All definitions reside within the micro_os_plus::micro_test_plus namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.

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

This file is intended solely for internal use within the framework and should not be included directly by user code.

Definition in file function-comparators.h.