test: fix a touch test comparing ints to doubles

We were checking doubles for integers but better to check that we're
close to the maximum range without actually being over.

This worked because check typecasts to uint_max_t but let's be explicit
here.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
This commit is contained in:
Peter Hutterer 2024-10-14 15:20:21 +10:00
parent 6e7dd8c111
commit 825e521d9b

View file

@ -118,9 +118,11 @@ START_TEST(touch_abs_transform)
tev = libinput_event_get_touch_event(ev);
fx = libinput_event_touch_get_x_transformed(tev, 1920);
ck_assert_int_eq(fx, 1919.0);
litest_assert_double_eq_epsilon(fx, 1920.0, 0.1);
litest_assert_double_lt(fx, 1920.0);
fy = libinput_event_touch_get_y_transformed(tev, 720);
ck_assert_int_eq(fy, 719.0);
litest_assert_double_eq_epsilon(fy, 720.0, 0.1);
litest_assert_double_lt(fy, 720.0);
tested = true;