Skip to content

Commit

Permalink
test: when testing for a touch sequence, assert it's the same slot's …
Browse files Browse the repository at this point in the history
…sequence

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Aug 13, 2018
1 parent 1668cd5 commit fffae6f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/litest.c
Expand Up @@ -3367,9 +3367,12 @@ void
litest_assert_touch_sequence(struct libinput *li)
{
struct libinput_event *event;
struct libinput_event_touch *tev;
int slot;

event = libinput_get_event(li);
litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_DOWN);
tev = litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_DOWN);
slot = libinput_event_touch_get_slot(tev);
libinput_event_destroy(event);

event = libinput_get_event(li);
Expand All @@ -3378,7 +3381,8 @@ litest_assert_touch_sequence(struct libinput *li)

event = libinput_get_event(li);
do {
litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_MOTION);
tev = litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_MOTION);
litest_assert_int_eq(slot, libinput_event_touch_get_slot(tev));
libinput_event_destroy(event);

event = libinput_get_event(li);
Expand All @@ -3389,7 +3393,8 @@ litest_assert_touch_sequence(struct libinput *li)
litest_assert_notnull(event);
} while (libinput_event_get_type(event) != LIBINPUT_EVENT_TOUCH_UP);

litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_UP);
tev = litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_UP);
litest_assert_int_eq(slot, libinput_event_touch_get_slot(tev));
libinput_event_destroy(event);
event = libinput_get_event(li);
litest_is_touch_event(event, LIBINPUT_EVENT_TOUCH_FRAME);
Expand Down

0 comments on commit fffae6f

Please sign in to comment.