mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 16:20:29 +01:00
test: split a test up into events vs processing
Running under valgrind, this test often fails when the machine is under load. Split it up so the events are all processed in one go, reducing the chance of getting a timeout while processing a previous event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
0a4d59d88d
commit
64df646658
1 changed files with 13 additions and 3 deletions
|
|
@ -172,6 +172,7 @@ START_TEST(touchpad_2fg_scroll_initially_diagonal)
|
|||
struct libinput_event *event;
|
||||
struct libinput_event_pointer *ptrev;
|
||||
int i;
|
||||
int expected_nevents;
|
||||
|
||||
if (!litest_has_2fg_scroll(dev))
|
||||
return;
|
||||
|
|
@ -196,18 +197,27 @@ START_TEST(touchpad_2fg_scroll_initially_diagonal)
|
|||
litest_drain_events(li);
|
||||
|
||||
/* scroll vertical only and make sure the horiz axis is never set */
|
||||
expected_nevents = 0;
|
||||
for (i = 6; i < 10; i++) {
|
||||
litest_touch_move(dev, 0, 55, 41 + i);
|
||||
libinput_dispatch(li);
|
||||
expected_nevents++;
|
||||
}
|
||||
|
||||
event = libinput_get_event(li);
|
||||
libinput_dispatch(li);
|
||||
event = libinput_get_event(li);
|
||||
|
||||
do {
|
||||
ptrev = litest_is_axis_event(event,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
|
||||
LIBINPUT_POINTER_AXIS_SOURCE_FINGER);
|
||||
ck_assert(!libinput_event_pointer_has_axis(ptrev,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL));
|
||||
libinput_event_destroy(event);
|
||||
}
|
||||
event = libinput_get_event(li);
|
||||
expected_nevents--;
|
||||
} while (event);
|
||||
|
||||
ck_assert_int_eq(expected_nevents, 0);
|
||||
|
||||
litest_touch_up(dev, 1);
|
||||
litest_touch_up(dev, 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue