|
micro-test-plus 4.1.0
µTest++ Testing Framework
|
Functions used to compose logical expressions in tests. More...
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. | |
The functions mt::_and(), mt::_or(), and mt::_not() combine multiple conditions, allowing expressive and concise test logic.
These function names are prefixed with an underscore to avoid clashes with language alternative tokens or related macros named and, or, and not. Using these logical functions allows developers to express compound conditions clearly and improve readability.
When operands are function comparators, use the overloaded logical operators &&, ||, and ! provided in the micro_test_plus::operators namespace for more natural logical expressions.
|
nodiscardconstexpr |
| Lhs_T | Type of the left hand side operand. |
| Rhs_T | Type of the right hand side operand. |
| [in] | lhs | Left hand side operand. |
| [in] | rhs | Right hand side operand. |
The _and function template provides a generic logical conjunction for any expression types. It constructs a logical conjunction object that can be used within the µTest++ framework to assert that both given conditions are true. This function is typically used in test expectations and assertions to combine logical expressions or custom comparators.
The underscore in the function name is intentional to differentiate it from the standard logical and operator.
Definition at line 289 of file function-comparators-inlines.h.
|
nodiscardconstexpr |
| Expr_T | Type of the operand. |
| [in] | expr | Logical expression to be negated. |
The _not function template provides a generic logical negation for any expression type. It constructs a logical negator object that can be used within the µTest++ framework to assert that a given condition is false. This function is typically used in test expectations and assertions to invert logical expressions or custom comparators.
The underscore in the function name is intentional to differentiate it from the standard logical not operator.
Definition at line 271 of file function-comparators-inlines.h.
|
nodiscardconstexpr |
| Lhs_T | Type of the left hand side operand. |
| Rhs_T | Type of the right hand side operand. |
| [in] | lhs | Left hand side operand. |
| [in] | rhs | Right hand side operand. |
The _or function template provides a generic logical disjunction for any expression types. It constructs a logical disjunction object that can be used within the µTest++ framework to assert that at least one of the given conditions is true. This function is typically used in test expectations and assertions to combine logical expressions or custom comparators.
The underscore in the function name is intentional to differentiate it from the standard logical or operator.
Definition at line 307 of file function-comparators-inlines.h.