mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-04 19:00:14 +01:00
test: Add litest_assert_double_*() macros
Converts two doubles to 24.8 fixed-width integers so assertions can be made with
doubles in tests
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9d96286a44)
This commit is contained in:
parent
f5d0b9b99b
commit
33981394aa
1 changed files with 17 additions and 0 deletions
|
|
@ -404,6 +404,23 @@ struct libevdev_uinput * litest_create_uinput_abs_device(const char *name,
|
|||
struct input_id *id,
|
||||
const struct input_absinfo *abs,
|
||||
...);
|
||||
#define litest_assert_double_eq(a_, b_)\
|
||||
ck_assert_int_eq((int)(a_ * 256), (int)(b_ * 256))
|
||||
|
||||
#define litest_assert_double_ne(a_, b_)\
|
||||
ck_assert_int_ne((int)(a_ * 256), (int)(b_ * 256))
|
||||
|
||||
#define litest_assert_double_lt(a_, b_)\
|
||||
ck_assert_int_lt((int)(a_ * 256), (int)(b_ * 256))
|
||||
|
||||
#define litest_assert_double_le(a_, b_)\
|
||||
ck_assert_int_le((int)(a_ * 256), (int)(b_ * 256))
|
||||
|
||||
#define litest_assert_double_gt(a_, b_)\
|
||||
ck_assert_int_gt((int)(a_ * 256), (int)(b_ * 256))
|
||||
|
||||
#define litest_assert_double_ge(a_, b_)\
|
||||
ck_assert_int_ge((int)(a_ * 256), (int)(b_ * 256))
|
||||
|
||||
void litest_timeout_tap(void);
|
||||
void litest_timeout_tapndrag(void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue