44#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_EXPRESSION_FORMATTER_INLINES_H_
45#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_EXPRESSION_FORMATTER_INLINES_H_
49#if defined(__cplusplus)
60#pragma GCC diagnostic push
62#pragma GCC diagnostic ignored "-Waggregate-return"
64#pragma clang diagnostic ignored "-Wunknown-warning-option"
65#pragma clang diagnostic ignored "-Wc++98-compat"
66#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
105 inline const std::string&
175 template <
typename T>
186#pragma GCC diagnostic push
188#if defined(__clang__)
189#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
194 snprintf (buff,
sizeof (buff),
"%p",
reinterpret_cast<void*
> (v));
198#pragma GCC diagnostic pop
242 expression_formatter::operator<< (
const T& t)
246 for (
const auto& arg : t)
248 *
this << (first ?
"" :
", ") << arg;
269 template <
class Lhs_T,
class Rhs_T>
273 return (*
this <<
colour_ (op) << op.
lhs () <<
" == " << op.
rhs ()
289 template <
class Lhs_T,
class Rhs_T>
293 return (*
this <<
colour_ (op) << op.
lhs () <<
" != " << op.
rhs ()
309 template <
class Lhs_T,
class Rhs_T>
313 return (*
this <<
colour_ (op) << op.
lhs () <<
" > " << op.
rhs ()
330 template <
class Lhs_T,
class Rhs_T>
334 return (*
this <<
colour_ (op) << op.
lhs () <<
" >= " << op.
rhs ()
349 template <
class Lhs_T,
class Rhs_T>
353 return (*
this <<
colour_ (op) << op.
lhs () <<
" < " << op.
rhs ()
370 template <
class Lhs_T,
class Rhs_T>
374 return (*
this <<
colour_ (op) << op.
lhs () <<
" <= " << op.
rhs ()
390 template <
class Lhs_T,
class Rhs_T>
394 return (*
this <<
'(' << op.
lhs () <<
colour_ (op) <<
" and "
410 template <
class Lhs_T,
class Rhs_T>
414 return (*
this <<
'(' << op.
lhs () <<
colour_ (op) <<
" or "
433#if defined(__cpp_exceptions)
446 template <
class Callable_T,
class Exception_T>
451 return (*
this <<
colour_ (op) <<
"throws<"
466 template <
class Callable_T>
484 template <
class Callable_T>
496#pragma GCC diagnostic pop
C++20 concept satisfied when T provides both begin() and end() member functions.
C++20 concept satisfied when T provides a npos member.
C++20 concept satisfied when a type derives from op.
Internal implementation details for the µTest++ framework.
void append_number_(std::string &buffer, T v)
Appends the string representation of a numeric value to a buffer, using std::to_chars for allocation-...
constexpr auto get(const T &t)
Generic getter function template for value retrieval.
constexpr auto type_name(void) -> std::string_view
Extract the type name from the __PRETTY_FUNCTION__ macro.
C++ header file with declarations for the µTest++ reflection utilities.
Logical AND comparator struct template.
constexpr auto lhs(void) const
Retrieves the left-hand operand.
constexpr auto rhs(void) const
Retrieves the right-hand operand.
Colours used to highlight pass and fail results in test reports.
Equality comparator struct template.
Greater than or equal comparator struct template.
Greater than comparator struct template.
Less than or equal comparator struct template.
Less than comparator struct template.
Non-equality comparator struct template.
Logical NOT comparator struct template.
Operator struct template to check if an expression does not throw any exception.
Logical OR comparator struct template.
Operator struct template to check if an expression throws a specific exception.
constexpr auto operand() const
Retrieves the wrapped operand expression.
Struct template representing a genuine integral value.
constexpr T get(void) const noexcept
Getter for the stored value.