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 "-Wc++98-compat"
64#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
103 inline const std::string&
167#pragma GCC diagnostic push
168#if defined(__clang__)
169#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
170#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
183 template <
typename T>
193#pragma GCC diagnostic push
194#if defined(__clang__)
195#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
199 snprintf (buff,
sizeof (buff),
"%p",
reinterpret_cast<void*
> (v));
202#pragma GCC diagnostic pop
245 expression_formatter::operator<< (
const T& t)
249 for (
const auto& arg : t)
251 *
this << (first ?
"" :
", ") << arg;
272 template <
class Lhs_T,
class Rhs_T>
276 return (*
this <<
colour_ (op) << op.
lhs () <<
" == " << op.
rhs ()
292 template <
class Lhs_T,
class Rhs_T>
296 return (*
this <<
colour_ (op) << op.
lhs () <<
" != " << op.
rhs ()
312 template <
class Lhs_T,
class Rhs_T>
316 return (*
this <<
colour_ (op) << op.
lhs () <<
" > " << op.
rhs ()
333 template <
class Lhs_T,
class Rhs_T>
337 return (*
this <<
colour_ (op) << op.
lhs () <<
" >= " << op.
rhs ()
352 template <
class Lhs_T,
class Rhs_T>
356 return (*
this <<
colour_ (op) << op.
lhs () <<
" < " << op.
rhs ()
373 template <
class Lhs_T,
class Rhs_T>
377 return (*
this <<
colour_ (op) << op.
lhs () <<
" <= " << op.
rhs ()
393 template <
class Lhs_T,
class Rhs_T>
397 return (*
this <<
'(' << op.
lhs () <<
colour_ (op) <<
" and "
413 template <
class Lhs_T,
class Rhs_T>
417 return (*
this <<
'(' << op.
lhs () <<
colour_ (op) <<
" or "
436#if defined(__cpp_exceptions)
449 template <
class Callable_T,
class Exception_T>
454 return (*
this <<
colour_ (op) <<
"throws<"
469 template <
class Callable_T>
487 template <
class Callable_T>
499#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.