summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2024-10-14 15:26:57 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2024-10-15 12:44:27 +1000
commit237b15b401ee8fa9908aef53135c2d8b71958f5d (patch)
tree559acb8c163a09ce2224a3c4420bd922aaa580a9 /test
parent825e521d9b4caf390df926eab6e56ef1853fc0ca (diff)
test: fix some checks using ints to compare doubles
Theoretically we should be using ck_assert_double_eq here for consistency but this patch is part of a series eventually replacing those calls, so let's jump to litest_assert_double directly to avoid further rebase conflicts. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Diffstat (limited to 'test')
-rw-r--r--test/test-pointer.c8
-rw-r--r--test/test-touch.c8
-rw-r--r--test/test-touchpad.c12
3 files changed, 14 insertions, 14 deletions
diff --git a/test/test-pointer.c b/test/test-pointer.c
index 4aeb8455..2d33e05f 100644
--- a/test/test-pointer.c
+++ b/test/test-pointer.c
@@ -304,10 +304,10 @@ START_TEST(pointer_absolute_initial_state)
p1 = libinput_event_get_pointer_event(ev1);
p2 = libinput_event_get_pointer_event(ev2);
- ck_assert_int_eq(libinput_event_pointer_get_absolute_x(p1),
- libinput_event_pointer_get_absolute_x(p2));
- ck_assert_int_eq(libinput_event_pointer_get_absolute_y(p1),
- libinput_event_pointer_get_absolute_y(p2));
+ litest_assert_double_eq(libinput_event_pointer_get_absolute_x(p1),
+ libinput_event_pointer_get_absolute_x(p2));
+ litest_assert_double_eq(libinput_event_pointer_get_absolute_y(p1),
+ libinput_event_pointer_get_absolute_y(p2));
libinput_event_destroy(ev1);
libinput_event_destroy(ev2);
diff --git a/test/test-touch.c b/test/test-touch.c
index d5d6fae8..c6802850 100644
--- a/test/test-touch.c
+++ b/test/test-touch.c
@@ -865,10 +865,10 @@ START_TEST(touch_initial_state)
libinput_event_get_type(ev1) == LIBINPUT_EVENT_TOUCH_FRAME)
break;
- ck_assert_int_eq(libinput_event_touch_get_x(t1),
- libinput_event_touch_get_x(t2));
- ck_assert_int_eq(libinput_event_touch_get_y(t1),
- libinput_event_touch_get_y(t2));
+ litest_assert_double_eq(libinput_event_touch_get_x(t1),
+ libinput_event_touch_get_x(t2));
+ litest_assert_double_eq(libinput_event_touch_get_y(t1),
+ libinput_event_touch_get_y(t2));
libinput_event_destroy(ev1);
libinput_event_destroy(ev2);
diff --git a/test/test-touchpad.c b/test/test-touchpad.c
index 27aa59b7..17a9d054 100644
--- a/test/test-touchpad.c
+++ b/test/test-touchpad.c
@@ -76,8 +76,8 @@ START_TEST(touchpad_1fg_motion)
struct libinput_event_pointer *ptrev;
ptrev = litest_is_motion_event(event);
- ck_assert_int_ge(libinput_event_pointer_get_dx(ptrev), 0);
- ck_assert_int_eq(libinput_event_pointer_get_dy(ptrev), 0);
+ litest_assert_double_ge(libinput_event_pointer_get_dx(ptrev), 0);
+ litest_assert_double_eq(libinput_event_pointer_get_dy(ptrev), 0);
libinput_event_destroy(event);
event = libinput_get_event(li);
}
@@ -3663,10 +3663,10 @@ START_TEST(touchpad_initial_state)
ck_assert_int_eq(libinput_event_get_type(ev1),
libinput_event_get_type(ev2));
- ck_assert_int_eq(libinput_event_pointer_get_dx(p1),
- libinput_event_pointer_get_dx(p2));
- ck_assert_int_eq(libinput_event_pointer_get_dy(p1),
- libinput_event_pointer_get_dy(p2));
+ litest_assert_double_eq(libinput_event_pointer_get_dx(p1),
+ libinput_event_pointer_get_dx(p2));
+ litest_assert_double_eq(libinput_event_pointer_get_dy(p1),
+ libinput_event_pointer_get_dy(p2));
libinput_event_destroy(ev1);
libinput_event_destroy(ev2);
}