micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
|
Overloaded operators. More...
Functions | |
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator and (const Lhs_T &lhs, const Rhs_T &rhs) |
Logical && (and) operator. It matches only if at least one operand is of local type (derived from local op ). | |
template<class T , type_traits::requires_t< type_traits::is_op_v< T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator not (const T &t) |
Logical ! (not) operator. It matches only if the operand is of local type (derived from local op ). | |
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator or (const Lhs_T &lhs, const Rhs_T &rhs) |
Logical || (or) operator. It matches only if at least one operand is of local type (derived from local op ). | |
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator!= (const Lhs_T &lhs, const Rhs_T &rhs) |
Non-equality operator. It matches only if at least one operand is of local type (derived from local op ). | |
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator< (const Lhs_T &lhs, const Rhs_T &rhs) |
Less than operator. It matches only if at least one operand is of local type (derived from local op ). | |
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator<= (const Lhs_T &lhs, const Rhs_T &rhs) |
Less than or equal operator. It matches only if at least one operand is of local type (derived from local op ). | |
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator== (const Lhs_T &lhs, const Rhs_T &rhs) |
Equality operator. It matches only if at least one operand is of local type (derived from local op ). | |
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator> (const Lhs_T &lhs, const Rhs_T &rhs) |
Greater than operator. It matches only if at least one operand is of local type (derived from local op ). | |
template<class Lhs_T , class Rhs_T , type_traits::requires_t< type_traits::is_op_v< Lhs_T > or type_traits::is_op_v< Rhs_T > > = 0> | |
constexpr auto | micro_os_plus::micro_test_plus::operators::operator>= (const Lhs_T &lhs, const Rhs_T &rhs) |
Greater than or equal operator. It matches only if at least one operand is of local type (derived from local op ). | |
Overloaded operators.
As in most other C++ test frameworks, it is also possible to overload the ==
, !=
, <
, >
, <=
, >=
operators.
To avoid possible interferences with other operators defined by the application, these operators match only for operands of specific types and are located in a separate namespace (micro_test_plus::operators
); when applied to regular values, the standard operands are used; the comparisons are performed properly, but in case of failures the actual values are not shown.
The operators match only operands derived from the local detail::op
type, which can be enforced for constant values by using the provided literals (like 1_i
) or, for dynamic values, by using the provided casts (like _i
{expression}, which are actually the constructors of the internal classes).
The logical operators can be used in exactly the same way as standard operators, but the additional functionality is enabled only when matching the typed operands.
|
constexpr |
Logical &&
(and) operator. It matches only if at least one operand is of local type (derived from local op
).
Definition at line 646 of file micro-test-plus.h.
|
constexpr |
Logical !
(not) operator. It matches only if the operand is of local type (derived from local op
).
Definition at line 673 of file micro-test-plus.h.
|
constexpr |
Logical ||
(or) operator. It matches only if at least one operand is of local type (derived from local op
).
Definition at line 661 of file micro-test-plus.h.
|
constexpr |
Non-equality operator. It matches only if at least one operand is of local type (derived from local op
).
Definition at line 571 of file micro-test-plus.h.
|
constexpr |
Less than operator. It matches only if at least one operand is of local type (derived from local op
).
Definition at line 615 of file micro-test-plus.h.
|
constexpr |
Less than or equal operator. It matches only if at least one operand is of local type (derived from local op
).
Definition at line 630 of file micro-test-plus.h.
|
constexpr |
Equality operator. It matches only if at least one operand is of local type (derived from local op
).
Definition at line 556 of file micro-test-plus.h.
|
constexpr |
Greater than operator. It matches only if at least one operand is of local type (derived from local op
).
Definition at line 586 of file micro-test-plus.h.
|
constexpr |
Greater than or equal operator. It matches only if at least one operand is of local type (derived from local op
).
Definition at line 601 of file micro-test-plus.h.