From 825e521d9b4caf390df926eab6e56ef1853fc0ca Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 14 Oct 2024 15:20:21 +1000 Subject: [PATCH] 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: --- test/test-touch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test-touch.c b/test/test-touch.c index a1616408..d5d6fae8 100644 --- a/test/test-touch.c +++ b/test/test-touch.c @@ -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;