check-result-inlines.h File
C++ header file with inline implementations for the µTest++ check result. More...
#include <concepts>
#include <cstdio>
#include <functional>
#include <utility>
Namespaces Index
Description
C++ header file with inline implementations for the µTest++ check result.
This header provides the inline and template implementations for the check result: the template function init(), the result accessor, and the operator<< that accumulates the messages of the checks (written by the expression formatter, in its plain mode). The default constructor, the non-template function start(), and the destructor are defined in src/check-result.cpp.
All definitions reside within the micro_os_plus::micro_test_plus::detail namespace.
This file is included by check-result.h; the applications include micro-os-plus/micro-test-plus.h, not this file.
File Listing
The file content with the documentation metadata removed is:
34#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_CHECK_RESULT_INLINES_H_
35#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_CHECK_RESULT_INLINES_H_
39#if defined(__cplusplus)
43#if __has_include("micro-os-plus/diag/trace.h")
44#include "micro-os-plus/diag/trace.h"
55#pragma GCC diagnostic push
57#pragma GCC diagnostic ignored "-Waggregate-return"
59#pragma clang diagnostic ignored "-Wc++98-compat"
60#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
100 template <class Expr_T>
110#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_TRACE_CONSTRUCTORS_ENABLED)
111 trace::printf ("%s\n", __PRETTY_FUNCTION__);
121 or std::convertible_to<Expr_T, bool>)
127 expression << static_cast<bool> (expr);
184 return std::move (*this);
191 return std::move (*this);
198 formatter << std::invoke (msg);
205 return std::move (*this);
208#if !defined(__DOXYGEN__)
217 check_result::operator<< ([[maybe_unused]] const T& msg) &&
219 if constexpr (std::is_class_v<T> and std::invocable<const T&>)
222 not std::is_same_v<T, T>,
223 "a message that is a callable object must be callable "
224 "without arguments and return a value that can be "
225 "written, not void");
229 static_assert (not std::is_same_v<T, T>,
230 "a message argument must be a value that can be "
231 "written: define an operator<< (mt::"
232 "expression_formatter&, const T&) in the namespace "
233 "of the type, or pass a callable object that returns "
236 return std::move (*this);
247#pragma GCC diagnostic pop
Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.