mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-03 20:30:27 +01:00
test: make the wheel tests stricter and always expect hires events
This would've caught #1156 Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1268>
This commit is contained in:
parent
c75d158bc0
commit
09acce4ce8
1 changed files with 7 additions and 0 deletions
|
|
@ -666,6 +666,8 @@ test_high_and_low_wheel_events_value(struct litest_device *dev,
|
|||
event = libinput_get_event(li);
|
||||
litest_assert_notnull(event);
|
||||
|
||||
bool have_lores = false, have_hires = false;
|
||||
|
||||
while (event) {
|
||||
ptrev = litest_is_axis_event(event,
|
||||
LIBINPUT_EVENT_POINTER_SCROLL_WHEEL,
|
||||
|
|
@ -673,11 +675,13 @@ test_high_and_low_wheel_events_value(struct litest_device *dev,
|
|||
source);
|
||||
|
||||
if (litest_is_high_res_axis_event(event)) {
|
||||
have_hires = true;
|
||||
litest_assert_double_eq(
|
||||
libinput_event_pointer_get_scroll_value_v120(ptrev,
|
||||
axis),
|
||||
v120);
|
||||
} else {
|
||||
have_lores = true;
|
||||
litest_assert_double_eq(
|
||||
libinput_event_pointer_get_axis_value(ptrev, axis),
|
||||
expected);
|
||||
|
|
@ -689,6 +693,9 @@ test_high_and_low_wheel_events_value(struct litest_device *dev,
|
|||
libinput_event_destroy(event);
|
||||
event = libinput_get_event(li);
|
||||
}
|
||||
|
||||
if (have_lores)
|
||||
litest_assert_msg(have_hires, "Missing high-res wheels events");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue