44#ifndef MICRO_TEST_PLUS_EXPRESSION_FORMATTER_INLINES_H_
45#define MICRO_TEST_PLUS_EXPRESSION_FORMATTER_INLINES_H_
60#pragma GCC diagnostic push
61#pragma GCC diagnostic ignored "-Waggregate-return"
63#pragma clang diagnostic ignored "-Wunknown-warning-option"
64#pragma clang diagnostic ignored "-Wc++98-compat"
65#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
104 inline const std::string&
168#pragma GCC diagnostic push
169#if defined(__clang__)
170#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
171#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
184 template <
typename T>
194#pragma GCC diagnostic push
195#if defined(__clang__)
196#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
200 snprintf (buff,
sizeof (buff),
"%p",
reinterpret_cast<void*
> (v));
203#pragma GCC diagnostic pop
246 expression_formatter::operator<< (
const T& t)
250 for (
const auto& arg : t)
252 *
this << (first ?
"" :
", ") << arg;
273 template <
class Lhs_T,
class Rhs_T>
277 return (*
this <<
colour_ (op) << op.
lhs () <<
" == " << op.
rhs ()
293 template <
class Lhs_T,
class Rhs_T>
297 return (*
this <<
colour_ (op) << op.
lhs () <<
" != " << op.
rhs ()
313 template <
class Lhs_T,
class Rhs_T>
317 return (*
this <<
colour_ (op) << op.
lhs () <<
" > " << op.
rhs ()
334 template <
class Lhs_T,
class Rhs_T>
338 return (*
this <<
colour_ (op) << op.
lhs () <<
" >= " << op.
rhs ()
353 template <
class Lhs_T,
class Rhs_T>
357 return (*
this <<
colour_ (op) << op.
lhs () <<
" < " << op.
rhs ()
374 template <
class Lhs_T,
class Rhs_T>
378 return (*
this <<
colour_ (op) << op.
lhs () <<
" <= " << op.
rhs ()
394 template <
class Lhs_T,
class Rhs_T>
398 return (*
this <<
'(' << op.
lhs () <<
colour_ (op) <<
" and "
414 template <
class Lhs_T,
class Rhs_T>
418 return (*
this <<
'(' << op.
lhs () <<
colour_ (op) <<
" or "
437#if defined(__cpp_exceptions)
450 template <
class Callable_T,
class Exception_T>
455 return (*
this <<
colour_ (op) <<
"throws<"
470 template <
class Callable_T>
488 template <
class Callable_T>
500#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.