21template<
typename T,
typename U>
28 auto lhs_context = TargetContext {};
29 auto const* lhs_data_pointer =
static_cast<char const*
>(
nullptr);
34 lhs_data_pointer =
reinterpret_cast<char const*
>(lhs_context.output().span().
data());
36 auto rhs_context = TargetContext {};
37 auto const* rhs_data_pointer =
static_cast<char const*
>(
nullptr);
42 rhs_data_pointer =
reinterpret_cast<char const*
>(rhs_context.output().span().
data());
44 assert_fail(expression, lhs_data_pointer, rhs_data_pointer, loc);
47template<
typename F,
typename T,
typename U>
59#define DI_ASSERT_EQ(a, b) \
60 ::di::assert::detail::binary_assert(::di::function::equal, "" #a " == " #b, (a), (b), \
61 ::di::util::SourceLocation::current())
63#define DI_ASSERT_APPROX_EQ(a, b) \
64 ::di::assert::detail::binary_assert(::di::approximately_equal, "" #a " ~= " #b, (a), (b), \
65 ::di::util::SourceLocation::current())
67#define DI_ASSERT_NOT_EQ(a, b) \
68 ::di::assert::detail::binary_assert(::di::function::not_equal, "" #a " != " #b, (a), (b), \
69 ::di::util::SourceLocation::current())
70#define DI_ASSERT_LT(a, b) \
71 ::di::assert::detail::binary_assert(::di::function::less, "" #a " < " #b, (a), (b), \
72 ::di::util::SourceLocation::current())
73#define DI_ASSERT_LT_EQ(a, b) \
74 ::di::assert::detail::binary_assert(::di::function::equal_or_less, "" #a " <= " #b, (a), (b), \
75 ::di::util::SourceLocation::current())
76#define DI_ASSERT_GT(a, b) \
77 ::di::assert::detail::binary_assert(::di::function::greater, "" #a " > " #b, (a), (b), \
78 ::di::util::SourceLocation::current())
79#define DI_ASSERT_GT_EQ(a, b) \
80 ::di::assert::detail::binary_assert(::di::function::equal_or_greater, "" #a " >= " #b, (a), (b), \
81 ::di::util::SourceLocation::current())
83#if !defined(DI_NO_GLOBALS) && !defined(DI_NO_GLOBAL_ASSERT)
84#define ASSERT_EQ DI_ASSERT_EQ
85#define ASSERT_APPROX_EQ DI_ASSERT_APPROX_EQ
86#define ASSERT_NOT_EQ DI_ASSERT_NOT_EQ
87#define ASSERT_LT DI_ASSERT_LT
88#define ASSERT_LT_EQ DI_ASSERT_LT_EQ
89#define ASSERT_GT DI_ASSERT_GT
90#define ASSERT_GT_EQ DI_ASSERT_GT_EQ
Definition string_view_impl_forward_declaration.h:7
Definition utf8_encoding.h:107
Definition bounded_format_context.h:9
Definition source_location.h:10
Definition assert_binary.h:20
constexpr void binary_assert(F op, char const *expression, T &&a, U &&b, util::SourceLocation loc)
Definition assert_binary.h:48
void assert_fail(char const *source_text, char const *lhs_message, char const *rhs_message, util::SourceLocation loc)
Definition assert_interface.h:13
void binary_assert_fail(char const *expression, T &&a, U &&b, util::SourceLocation loc)
Definition assert_binary.h:22
__UINT8_TYPE__ u8
Definition integers.h:9
void compile_time_fail()
Definition compile_time_fail.h:7
constexpr auto data
Definition data.h:51