micro-test-plus 6.0.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
detail.h
Go to the documentation of this file.
1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2021-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can be
9 * obtained from https://opensource.org/licenses/mit.
10 *
11 * Major parts of the code are inspired from v1.1.8 of the Boost UT project,
12 * released under the terms of the Boost Version 1.0 Software License,
13 * which can be obtained from https://www.boost.org/LICENSE_1_0.txt.
14 */
15
16// ----------------------------------------------------------------------------
17
36
37#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_DETAIL_H_
38#define MICRO_OS_PLUS_MICRO_TEST_PLUS_DETAIL_H_
39
40// ----------------------------------------------------------------------------
41
42#if defined(__cplusplus)
43
44// ----------------------------------------------------------------------------
45
46#if __has_include("micro-os-plus/project-config.h")
47#include "micro-os-plus/project-config.h"
48#endif // __has_include("micro-os-plus/project-config.h")
49
50#if __has_include("micro-os-plus/micro-test-plus-defines.h")
51#include "micro-os-plus/micro-test-plus-defines.h"
52#endif // __has_include("micro-os-plus/micro-test-plus-defines.h")
53
54#include "extension.h"
55#include "math.h"
56
57#include <algorithm>
58#include <compare>
59#include <concepts>
60#include <cstddef>
61#include <cstdio>
62#include <string>
63#include <string_view>
64#include <type_traits>
65#include <utility>
66
67// ----------------------------------------------------------------------------
68
93#if defined(_WIN32) && defined(__clang__) && !defined(__MINGW32__)
94#define MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE "Iu"
95#elif defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)
96#if defined(_WIN64)
97#define MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE "llu"
98#else
99#define MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE "u"
100#endif // defined(_WIN64)
101#else
102#define MICRO_OS_PLUS_MICRO_TEST_PLUS_PRI_SIZE "zu"
103#endif // defined(_WIN32) && defined(__clang__) && !defined(__MINGW32__)
104
105// ----------------------------------------------------------------------------
106
107#if defined(__GNUC__)
108#pragma GCC diagnostic push
109
110#pragma GCC diagnostic ignored "-Wpadded"
111#pragma GCC diagnostic ignored "-Waggregate-return"
112#if defined(__clang__)
113#pragma clang diagnostic ignored "-Wc++98-compat"
114#pragma clang diagnostic ignored "-Wdocumentation"
115#endif // defined(__clang__)
116#endif // defined(__GNUC__)
117
118// ============================================================================
119
121{
141 namespace detail
142 {
143 // ========================================================================
144
164 template <class T>
165 // The specifier order works around a Doxygen (1.17, 1.18) mismatch
166 // with the definition, reported as "no matching file member found".
167 [[nodiscard]] decltype (auto) constexpr unwrap (const T& t);
168
169#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
196 template <class Lhs_T, class Rhs_T>
197 requires (extension::has_epsilon<Lhs_T> or extension::has_epsilon<Rhs_T>)
198 [[nodiscard]] constexpr bool
199 within_tolerance (const Lhs_T& lhs, const Rhs_T& rhs);
200#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
201
202 // ========================================================================
203
233 template <class T>
234 using stored_operand_t = std::conditional_t<
235 std::is_lvalue_reference_v<T>
236 and not std::is_copy_constructible_v<std::remove_cvref_t<T>>,
237 const std::remove_reference_t<T>&, std::remove_cvref_t<T>>;
238
239 // ========================================================================
240
256 template <class T>
257 struct unary_op : op
258 {
272 template <class U>
273 constexpr unary_op (U&& t, bool value);
274
282 [[nodiscard]] constexpr
283 operator bool () const;
284
296 [[nodiscard]] constexpr decltype (auto)
297 operand (void) const;
298
299 private:
309 T t_;
310
317 const bool value_{};
318 };
319
320 // ========================================================================
321
341 template <class Lhs_T, class Rhs_T>
342 struct binary_op : op
343 {
359 template <class L, class R>
360 constexpr binary_op (L&& lhs, R&& rhs, bool value);
361
369 [[nodiscard]] constexpr
370 operator bool () const;
371
383 [[nodiscard]] constexpr decltype (auto)
384 lhs (void) const;
385
397 [[nodiscard]] constexpr decltype (auto)
398 rhs (void) const;
399
400 private:
410 Lhs_T lhs_;
411
418 Rhs_T rhs_;
419
426 const bool value_{};
427 };
428
429 // ========================================================================
430
441 struct equal_to
442 {
451 static constexpr const char* symbol = " == ";
452
453#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
468 static constexpr bool within_tolerance_result = true;
469#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
470
485 template <class Lhs_T, class Rhs_T>
486 [[nodiscard, gnu::always_inline]] static constexpr bool
487 apply (const Lhs_T& lhs, const Rhs_T& rhs);
488 };
489
501 {
510 static constexpr const char* symbol = " != ";
511
512#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
527 static constexpr bool within_tolerance_result = false;
528#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
529
544 template <class Lhs_T, class Rhs_T>
545 [[nodiscard, gnu::always_inline]] static constexpr bool
546 apply (const Lhs_T& lhs, const Rhs_T& rhs);
547 };
548
559 struct greater
560 {
569 static constexpr const char* symbol = " > ";
570
571#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
586 static constexpr bool within_tolerance_result = false;
587#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
588
603 template <class Lhs_T, class Rhs_T>
604 [[nodiscard, gnu::always_inline]] static constexpr bool
605 apply (const Lhs_T& lhs, const Rhs_T& rhs);
606 };
607
619 {
628 static constexpr const char* symbol = " >= ";
629
630#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
645 static constexpr bool within_tolerance_result = true;
646#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
647
662 template <class Lhs_T, class Rhs_T>
663 [[nodiscard, gnu::always_inline]] static constexpr bool
664 apply (const Lhs_T& lhs, const Rhs_T& rhs);
665 };
666
677 struct less
678 {
687 static constexpr const char* symbol = " < ";
688
689#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
704 static constexpr bool within_tolerance_result = false;
705#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
706
721 template <class Lhs_T, class Rhs_T>
722 [[nodiscard, gnu::always_inline]] static constexpr bool
723 apply (const Lhs_T& lhs, const Rhs_T& rhs);
724 };
725
737 {
746 static constexpr const char* symbol = " <= ";
747
748#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
763 static constexpr bool within_tolerance_result = true;
764#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
765
780 template <class Lhs_T, class Rhs_T>
781 [[nodiscard, gnu::always_inline]] static constexpr bool
782 apply (const Lhs_T& lhs, const Rhs_T& rhs);
783 };
784
785 // ========================================================================
786
811 template <class T>
812 [[nodiscard]] constexpr auto
813 as_operand (T&& t) noexcept -> decltype (auto);
814
827 template <class T>
828 using unwrapped_t = std::remove_cvref_t<decltype (detail::unwrap (
829 std::declval<const std::remove_cvref_t<T>&> ()))>;
830
831 // ========================================================================
832
885 template <class Lhs_T, class Rhs_T, class Compare_T>
886 struct compare_op : binary_op<Lhs_T, Rhs_T>
887 {
902 template <class L, class R>
905 constexpr compare_op (L&& lhs, R&& rhs, Compare_T);
906
907#if !defined(__DOXYGEN__)
923 template <class L, class R>
926 constexpr compare_op (L&& lhs, R&& rhs, Compare_T);
927#endif // !defined(__DOXYGEN__)
928 };
929
940 template <class Lhs_T, class Rhs_T, class Compare_T>
941 compare_op (Lhs_T&&, Rhs_T&&, Compare_T)
943 std::declval<Lhs_T> ()))>,
945 std::declval<Rhs_T> ()))>,
946 Compare_T>;
947
948 // ========================================================================
949
973 template <class Lhs_T, class Rhs_T, class Epsilon_T>
974 [[nodiscard]] constexpr bool
975 differ_by_at_most (Lhs_T lhs, Rhs_T rhs, Epsilon_T epsilon);
976
1001 template <class Lhs_T, class Rhs_T, class Epsilon_T>
1002 struct approx_op : binary_op<Lhs_T, Rhs_T>
1003 {
1019 template <class L, class R, class E>
1020 constexpr approx_op (L&& lhs, R&& rhs, E&& epsilon);
1021
1033 [[nodiscard]] constexpr decltype (auto)
1034 epsilon (void) const;
1035
1036 private:
1044 Epsilon_T epsilon_;
1045 };
1046
1054 template <class Lhs_T, class Rhs_T, class Epsilon_T>
1055 approx_op (Lhs_T&&, Rhs_T&&, Epsilon_T&&)
1058
1059 // ========================================================================
1060
1081 template <class Lhs_T, class Rhs_T>
1082 struct and_op : binary_op<Lhs_T, Rhs_T>
1083 {
1097 template <class L, class R>
1098 constexpr and_op (L&& lhs, R&& rhs);
1099 };
1100
1110 template <typename Lhs_T, typename Rhs_T>
1111 and_op (Lhs_T&&, Rhs_T&&)
1113
1114 // ========================================================================
1115
1136 template <class Lhs_T, class Rhs_T>
1137 struct or_op : binary_op<Lhs_T, Rhs_T>
1138 {
1152 template <class L, class R>
1153 constexpr or_op (L&& lhs, R&& rhs);
1154 };
1155
1165 template <typename Lhs_T, typename Rhs_T>
1166 or_op (Lhs_T&&, Rhs_T&&)
1168
1169 // ========================================================================
1170
1193 template <class T>
1194 struct not_op : unary_op<T>
1195 {
1208 template <class U>
1209 requires (not std::is_same_v<std::remove_cvref_t<U>, not_op<T>>)
1210 explicit constexpr not_op (U&& t);
1211 };
1212
1213 // ========================================================================
1214
1251 template <class T, class Predicate_T>
1253 {
1266 template <class U>
1268 constexpr predicate_op (U&& t, Predicate_T);
1269
1270#if !defined(__DOXYGEN__)
1285 template <class U>
1287 constexpr predicate_op (U&& t, Predicate_T);
1288#endif // !defined(__DOXYGEN__)
1289 };
1290
1300 template <class T, class Predicate_T>
1301 predicate_op (T&&, Predicate_T) -> predicate_op<
1303 Predicate_T>;
1304
1305 // ========================================================================
1306
1322 {
1323 };
1324
1325 // ========================================================================
1326
1327#if defined(__cpp_exceptions)
1328
1335 enum class throw_outcome : unsigned char
1336 {
1341
1347
1352 };
1353
1362 {
1370 bool value;
1371
1380
1387 std::string what;
1388 };
1389
1403 {
1410 explicit callable_op (callable_result&& result);
1411
1419 [[nodiscard]] constexpr
1420 operator bool () const;
1421
1431 [[nodiscard]] throw_outcome
1432 outcome (void) const noexcept;
1433
1442 [[nodiscard]] const std::string&
1443 what (void) const noexcept;
1444
1445 private:
1453 const bool value_{};
1454
1462
1471 std::string what_{};
1472 };
1473
1474 // ========================================================================
1475
1496 template <class Exception_T = void>
1498 {
1508 template <class Callable_T>
1509 requires std::invocable<Callable_T&>
1510 explicit throws_op (Callable_T&& func);
1511 };
1512
1513 // ========================================================================
1514
1528 template <>
1529 struct throws_op<void> : callable_op
1530 {
1540 template <class Callable_T>
1541 requires std::invocable<Callable_T&>
1542 explicit throws_op (Callable_T&& func);
1543 };
1544
1545 // ========================================================================
1546
1563 {
1573 template <class Callable_T>
1574 requires std::invocable<Callable_T&>
1575 explicit nothrow_op (Callable_T&& func);
1576 };
1577
1578#endif // defined(__cpp_exceptions)
1579
1580 // ========================================================================
1581
1592 template <class T>
1593 requires std::is_arithmetic_v<T>
1594 void
1595 append_number (std::string& buffer, T v);
1596
1612 template <class T>
1613 void
1614 append_pointer (std::string& buffer, T* v);
1615
1616 // ========================================================================
1617
1630 template <class T>
1631 concept character = std::is_same_v<std::remove_cv_t<T>, char>
1632 or std::is_same_v<std::remove_cv_t<T>, wchar_t>
1633 or std::is_same_v<std::remove_cv_t<T>, char8_t>
1634 or std::is_same_v<std::remove_cv_t<T>, char16_t>
1635 or std::is_same_v<std::remove_cv_t<T>, char32_t>;
1636
1649 template <class T>
1651 = std::is_pointer_v<T> and character<std::remove_pointer_t<T>>
1652 and not std::is_volatile_v<std::remove_pointer_t<T>>;
1653
1672 template <character Char_T>
1674 {
1681 constexpr explicit basic_c_string (const Char_T* str) noexcept;
1682
1694 constexpr basic_c_string (const Char_T* str,
1695 std::size_t capacity) noexcept;
1696
1705 [[nodiscard]] constexpr std::basic_string_view<Char_T>
1706 view (void) const noexcept;
1707
1716 [[nodiscard]] constexpr bool
1717 is_null (void) const noexcept;
1718
1719 private:
1726 const Char_T* str_;
1727
1734 std::size_t size_;
1735 };
1736
1747
1758 template <character Char_T>
1759 [[nodiscard]] constexpr bool
1761 const basic_c_string<Char_T>& rhs) noexcept;
1762
1777 template <character Char_T>
1778 [[nodiscard]] constexpr bool
1780 const basic_c_string<Char_T>& lhs,
1781 std::type_identity_t<std::basic_string_view<Char_T>> rhs) noexcept;
1782
1791 template <character Char_T>
1792 [[nodiscard]] constexpr bool
1793 operator== (const basic_c_string<Char_T>& lhs, std::nullptr_t) noexcept;
1794
1804 template <character Char_T>
1805 [[nodiscard]] constexpr std::strong_ordering
1807 const basic_c_string<Char_T>& rhs) noexcept;
1808
1818 template <character Char_T>
1819 [[nodiscard]] constexpr std::strong_ordering
1821 const basic_c_string<Char_T>& lhs,
1822 std::type_identity_t<std::basic_string_view<Char_T>> rhs) noexcept;
1823
1844 template <class T>
1846 {
1854 constexpr array_operand (const T* first, std::size_t count) noexcept;
1855
1863 [[nodiscard]] constexpr const T*
1864 begin (void) const noexcept;
1865
1873 [[nodiscard]] constexpr const T*
1874 end (void) const noexcept;
1875
1876 private:
1883 const T* first_;
1884
1891 std::size_t count_;
1892 };
1893
1905 template <class T, class R>
1906 requires (container_like<R>
1907 and std::equality_comparable_with<
1908 T, typename range_element<R>::type>)
1909 [[nodiscard]] constexpr bool
1910 operator== (const array_operand<T>& lhs, const R& rhs);
1911
1922 template <class T, class R>
1923 requires (container_like<R>
1924 and std::three_way_comparable_with<
1925 T, typename range_element<R>::type>)
1926 [[nodiscard]] constexpr auto
1927 operator<=> (const array_operand<T>& lhs, const R& rhs);
1928
1929 // ------------------------------------------------------------------------
1930 } // namespace detail
1931
1932 // --------------------------------------------------------------------------
1933
1934 namespace extension
1935 {
1936 // ------------------------------------------------------------------------
1937 // The expressions of the custom comparators, predicates, and operators.
1938
1939 // The definitions are in `detail`, with the built-in expressions that
1940 // share them; the using-declarations name the same templates, so the
1941 // class template argument deduction applies, and the formatter
1942 // reports them as the built-in ones.
1943
1944 using detail::compare_op;
1946
1947 // ------------------------------------------------------------------------
1948
1966 template <class T>
1968 = std::is_arithmetic_v<detail::unwrapped_t<T>>
1969 and not std::is_same_v<detail::unwrapped_t<T>, bool>
1970 and not std::is_same_v<detail::unwrapped_t<T>, char>
1971 and not std::is_same_v<detail::unwrapped_t<T>, wchar_t>
1972 and not std::is_same_v<detail::unwrapped_t<T>, char8_t>
1973 and not std::is_same_v<detail::unwrapped_t<T>, char16_t>
1974 and not std::is_same_v<detail::unwrapped_t<T>, char32_t>;
1975
1976 // ------------------------------------------------------------------------
1977 } // namespace extension
1978
1979 // --------------------------------------------------------------------------
1980} // namespace micro_os_plus::micro_test_plus
1981
1982#if defined(__GNUC__)
1983#pragma GCC diagnostic pop
1984#endif // defined(__GNUC__)
1985
1986// ----------------------------------------------------------------------------
1987
1988#endif // defined(__cplusplus)
1989
1990// ============================================================================
1991// Templates, inlines & constexpr implementations.
1992
1993#include "inlines/detail-inlines.h"
1994
1995// ----------------------------------------------------------------------------
1996
1997#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_DETAIL_H_
1998
1999// ----------------------------------------------------------------------------
Concept satisfied by the pointers to the character types.
Definition detail.h:1651
Concept satisfied by the character types.
Definition detail.h:1631
Concept satisfied when T provides both begin() and end() member functions returning an iterator and i...
Definition extension.h:532
Concept satisfied when T is a valid operand of the approximate comparator.
Definition detail.h:1968
Concept satisfied by a tag that defines a custom comparator.
Definition extension.h:456
Concept satisfied by a tag that defines a custom predicate.
Definition extension.h:477
C++ header file with inline implementations for the µTest++ internal detail namespace.
C++ header file with declarations for the µTest++ extension concepts.
static constexpr bool within_tolerance_result
Deprecated result when the operands are within the tolerance.
Definition detail.h:645
static constexpr bool within_tolerance_result
Deprecated result when the operands are within the tolerance.
Definition detail.h:586
constexpr bool within_tolerance(const Lhs_T &lhs, const Rhs_T &rhs)
Deprecated check whether two operands are equal within the tolerance of the floating-point wrappers.
static constexpr bool within_tolerance_result
Deprecated result when the operands are within the tolerance.
Definition detail.h:527
static constexpr bool within_tolerance_result
Deprecated result when the operands are within the tolerance.
Definition detail.h:468
static constexpr bool within_tolerance_result
Deprecated result when the operands are within the tolerance.
Definition detail.h:763
static constexpr bool within_tolerance_result
Deprecated result when the operands are within the tolerance.
Definition detail.h:704
C++ header file with declarations for the µTest++ mathematical utilities.
std::remove_cvref_t< decltype(detail::unwrap( std::declval< const std::remove_cvref_t< T > & >()))> unwrapped_t
The type of an operand, after the framework wrappers are removed by detail::unwrap().
Definition detail.h:828
void append_number(std::string &buffer, T v)
Appends the shortest decimal representation of a numeric value to a buffer.
constexpr bool operator==(const basic_c_string< Char_T > &lhs, const basic_c_string< Char_T > &rhs) noexcept
Compares two C string operands for equality.
constexpr auto as_operand(T &&t) noexcept -> decltype(auto)
Prepares an operand of a comparator.
decltype(auto) constexpr unwrap(const T &t)
Returns the value wrapped by a framework type, or the operand itself.
void append_pointer(std::string &buffer, T *v)
Appends the hexadecimal address of a pointer to a buffer.
throw_outcome
The kind of exception thrown by the callable of a check.
Definition detail.h:1336
@ std_exception
A std::exception that was not the expected one was thrown; its what() is kept.
Definition detail.h:1346
@ none
Nothing was thrown, or the expected exception was thrown.
Definition detail.h:1340
@ unknown_exception
Another exception was thrown.
Definition detail.h:1351
basic_c_string< char > c_string
The C string operand of char strings.
Definition detail.h:1746
constexpr bool differ_by_at_most(Lhs_T lhs, Rhs_T rhs, Epsilon_T epsilon)
Tells whether two numbers differ by at most a tolerance.
constexpr std::strong_ordering operator<=>(const basic_c_string< Char_T > &lhs, const basic_c_string< Char_T > &rhs) noexcept
Orders two C string operands.
std::conditional_t< std::is_lvalue_reference_v< T > and not std::is_copy_constructible_v< std::remove_cvref_t< T > >, const std::remove_reference_t< T > &, std::remove_cvref_t< T > > stored_operand_t
The type with which an expression stores an operand.
Definition detail.h:234
The templates and the concepts for extending the µTest++ testing framework.
Definition detail.h:1935
Primary namespace for the µTest++ testing framework.
Logical AND comparator struct template.
Definition detail.h:1083
constexpr and_op(L &&lhs, R &&rhs)
Constructs a logical AND comparator for the given operands.
Approximate comparator struct template.
Definition detail.h:1003
constexpr approx_op(L &&lhs, R &&rhs, E &&epsilon)
Constructs an approximate comparator for the given operands.
constexpr decltype(auto) epsilon(void) const
Retrieves the tolerance.
Epsilon_T epsilon_
The stored tolerance.
Definition detail.h:1044
An array operand of a comparator, other than a character array.
Definition detail.h:1846
std::size_t count_
The number of elements.
Definition detail.h:1891
constexpr const T * begin(void) const noexcept
Returns an iterator to the first element.
constexpr array_operand(const T *first, std::size_t count) noexcept
Constructs the operand from the first element and the size of an array.
constexpr const T * end(void) const noexcept
Returns an iterator past the last element.
A C string operand of a comparator.
Definition detail.h:1674
constexpr bool is_null(void) const noexcept
Returns whether the operand is a null pointer.
constexpr std::basic_string_view< Char_T > view(void) const noexcept
Returns the characters, as a string view.
constexpr basic_c_string(const Char_T *str) noexcept
Constructs the operand from a pointer to a null-terminated string.
constexpr basic_c_string(const Char_T *str, std::size_t capacity) noexcept
Constructs the operand from an array of characters.
constexpr decltype(auto) lhs(void) const
Retrieves the left-hand operand.
Rhs_T rhs_
Stores the right-hand operand.
Definition detail.h:418
constexpr binary_op(L &&lhs, R &&rhs, bool value)
Constructs a binary comparator with the given operands and pre-computed result.
const bool value_
Stores the result of the comparison.
Definition detail.h:426
Lhs_T lhs_
Stores the left-hand operand.
Definition detail.h:410
constexpr decltype(auto) rhs(void) const
Retrieves the right-hand operand.
callable_op(callable_result &&result)
Constructs a callable operator with the pre-computed result.
std::string what_
Stores the what() of the std::exception thrown, when the check failed.
Definition detail.h:1471
throw_outcome outcome_
Stores what the invocation threw, when the check failed.
Definition detail.h:1461
throw_outcome outcome(void) const noexcept
Retrieves what the invocation threw.
const std::string & what(void) const noexcept
Retrieves the what() of the std::exception thrown.
const bool value_
Stores the result of the callable invocation.
Definition detail.h:1453
The result of the invocation of the callable of a check.
Definition detail.h:1362
std::string what
The what() of the std::exception thrown, if any.
Definition detail.h:1387
throw_outcome outcome
What was thrown, when the check failed.
Definition detail.h:1379
Relational comparator struct template.
Definition detail.h:887
constexpr compare_op(L &&lhs, R &&rhs, Compare_T)
Constructs a comparator for the given operands.
static constexpr bool apply(const Lhs_T &lhs, const Rhs_T &rhs)
Compares the operands with ==.
static constexpr const char * symbol
The operator symbol, as displayed in the failure reports.
Definition detail.h:451
The exception thrown to stop a test case after a failed require().
Definition detail.h:1322
Greater than or equal tag for compare_op.
Definition detail.h:619
static constexpr const char * symbol
The operator symbol, as displayed in the failure reports.
Definition detail.h:628
static constexpr bool apply(const Lhs_T &lhs, const Rhs_T &rhs)
Compares the operands with >=.
Greater than tag for compare_op.
Definition detail.h:560
static constexpr bool apply(const Lhs_T &lhs, const Rhs_T &rhs)
Compares the operands with >.
static constexpr const char * symbol
The operator symbol, as displayed in the failure reports.
Definition detail.h:569
Less than or equal tag for compare_op.
Definition detail.h:737
static constexpr const char * symbol
The operator symbol, as displayed in the failure reports.
Definition detail.h:746
static constexpr bool apply(const Lhs_T &lhs, const Rhs_T &rhs)
Compares the operands with <=.
Less than tag for compare_op.
Definition detail.h:678
static constexpr const char * symbol
The operator symbol, as displayed in the failure reports.
Definition detail.h:687
static constexpr bool apply(const Lhs_T &lhs, const Rhs_T &rhs)
Compares the operands with <.
Non-equality tag for compare_op.
Definition detail.h:501
static constexpr bool apply(const Lhs_T &lhs, const Rhs_T &rhs)
Compares the operands with !=.
static constexpr const char * symbol
The operator symbol, as displayed in the failure reports.
Definition detail.h:510
constexpr not_op(U &&t)
Constructs a logical NOT comparator for the given operand.
nothrow_op(Callable_T &&func)
Constructs a nothrow checking operator for the given callable.
Empty base struct for the framework expression types.
Definition extension.h:120
Logical OR comparator struct template.
Definition detail.h:1138
constexpr or_op(L &&lhs, R &&rhs)
Constructs a logical OR comparator for the given operands.
constexpr predicate_op(U &&t, Predicate_T)
Constructs a predicate for the given operand.
The type of the elements of a range, as iterated by a range-based for statement.
Definition extension.h:592
throws_op(Callable_T &&func)
Constructs an exception checking operator for the given callable.
throws_op(Callable_T &&func)
Constructs an exception checking operator for the given callable.
constexpr decltype(auto) operand(void) const
Retrieves the wrapped operand expression.
constexpr unary_op(U &&t, bool value)
Constructs a unary comparator with the given operand and pre-computed result.
const bool value_
Stores the result of the operation.
Definition detail.h:317
Struct template representing a generic value, accessible via a getter.
Definition deprecated.h:629
constexpr compare_op(L &&lhs, R &&rhs, Compare_T)
Constructs a comparator for the given operands.
constexpr predicate_op(U &&t, Predicate_T)
Constructs a predicate for the given operand.