mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 11:40:30 +01:00
test: add litest_assert_tablet_button_event()
Does what it says on the box. or at least in the manual inside the box. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
This commit is contained in:
parent
c23fb36eb1
commit
3288349077
2 changed files with 24 additions and 0 deletions
|
|
@ -1404,6 +1404,27 @@ litest_assert_button_event(struct libinput *li, unsigned int button,
|
|||
libinput_event_destroy(event);
|
||||
}
|
||||
|
||||
void
|
||||
litest_assert_tablet_button_event(struct libinput *li, unsigned int button,
|
||||
enum libinput_button_state state)
|
||||
{
|
||||
struct libinput_event *event;
|
||||
struct libinput_event_tablet *tev;
|
||||
|
||||
litest_wait_for_event(li);
|
||||
event = libinput_get_event(li);
|
||||
|
||||
ck_assert(event != NULL);
|
||||
ck_assert_int_eq(libinput_event_get_type(event),
|
||||
LIBINPUT_EVENT_TABLET_BUTTON);
|
||||
tev = libinput_event_get_tablet_event(event);
|
||||
ck_assert_int_eq(libinput_event_tablet_get_button(tev),
|
||||
button);
|
||||
ck_assert_int_eq(libinput_event_tablet_get_button_state(tev),
|
||||
state);
|
||||
libinput_event_destroy(event);
|
||||
}
|
||||
|
||||
void
|
||||
litest_assert_scroll(struct libinput *li,
|
||||
enum libinput_pointer_axis axis,
|
||||
|
|
|
|||
|
|
@ -186,6 +186,9 @@ void litest_assert_scroll(struct libinput *li,
|
|||
int minimum_movement);
|
||||
void litest_assert_only_typed_events(struct libinput *li,
|
||||
enum libinput_event_type type);
|
||||
void litest_assert_tablet_button_event(struct libinput *li,
|
||||
unsigned int button,
|
||||
enum libinput_button_state state);
|
||||
|
||||
struct libevdev_uinput * litest_create_uinput_device(const char *name,
|
||||
struct input_id *id,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue