From: Peter Hutterer Date: Mon, 14 Oct 2024 05:20:21 +0000 (+1000) Subject: test: fix a touch test comparing ints to doubles X-Git-Tag: 1.27.0~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=825e521d9b4caf390df926eab6e56ef1853fc0ca;p=platform%2Fupstream%2Flibinput.git 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: --- 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;