mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-24 21:40:05 +01:00
test: fix macro grouping in the litest.h header
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1050>
This commit is contained in:
parent
25bdda0b8a
commit
e89bf25c10
1 changed files with 11 additions and 11 deletions
|
|
@ -210,17 +210,6 @@ litest_fail_comparison_ptr(const char *file,
|
|||
#a_ " " #op_ " " #b_); \
|
||||
} while(0)
|
||||
|
||||
#define litest_assert_comparison_double_(a_, op_, b_) \
|
||||
do { \
|
||||
const double EPSILON = 1.0/256; \
|
||||
__typeof__(a_) _a = a_; \
|
||||
__typeof__(b_) _b = b_; \
|
||||
if (!((_a) op_ (_b)) && fabs((_a) - (_b)) > EPSILON) \
|
||||
litest_fail_comparison_double(__FILE__, __LINE__, __func__,\
|
||||
#op_, _a, _b, \
|
||||
#a_, #b_); \
|
||||
} while(0)
|
||||
|
||||
#define litest_assert_ptr_eq(a_, b_) \
|
||||
litest_assert_comparison_ptr_(a_, ==, b_)
|
||||
|
||||
|
|
@ -233,6 +222,17 @@ litest_fail_comparison_ptr(const char *file,
|
|||
#define litest_assert_ptr_notnull(a_) \
|
||||
litest_assert_comparison_ptr_(a_, !=, NULL)
|
||||
|
||||
#define litest_assert_comparison_double_(a_, op_, b_) \
|
||||
do { \
|
||||
const double EPSILON = 1.0/256; \
|
||||
__typeof__(a_) _a = a_; \
|
||||
__typeof__(b_) _b = b_; \
|
||||
if (!((_a) op_ (_b)) && fabs((_a) - (_b)) > EPSILON) \
|
||||
litest_fail_comparison_double(__FILE__, __LINE__, __func__,\
|
||||
#op_, _a, _b, \
|
||||
#a_, #b_); \
|
||||
} while(0)
|
||||
|
||||
#define litest_assert_double_eq(a_, b_)\
|
||||
litest_assert_comparison_double_((a_), ==, (b_))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue