mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-04 05:00:14 +01:00
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:
parent
6e7dd8c111
commit
825e521d9b
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue