[PATCH libinput 1/2] test: don't use litest_is_pad_button_event for a few tests
Peter Hutterer
peter.hutterer at who-t.net
Thu Oct 26 05:24:06 UTC 2017
That function requires us to know which button we're testing for. Because of
the upcoming libwacom changes, we don't know which button we're about to get,
especially on the bamboos. Use the standard libinput functions to get to the
libinput event instead, we don't care about the button numbers here anyway.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
test/test-pad.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/test/test-pad.c b/test/test-pad.c
index 5e4a66f5..085d6c58 100644
--- a/test/test-pad.c
+++ b/test/test-pad.c
@@ -84,9 +84,9 @@ START_TEST(pad_time)
}
ev = libinput_get_event(li);
- pev = litest_is_pad_button_event(ev,
- 0,
- LIBINPUT_BUTTON_STATE_PRESSED);
+ ck_assert_int_eq(libinput_event_get_type(ev),
+ LIBINPUT_EVENT_TABLET_PAD_BUTTON);
+ pev = libinput_event_get_tablet_pad_event(ev);
time = libinput_event_tablet_pad_get_time(pev);
time_usec = libinput_event_tablet_pad_get_time_usec(pev);
@@ -103,9 +103,9 @@ START_TEST(pad_time)
libinput_dispatch(li);
ev = libinput_get_event(li);
- pev = litest_is_pad_button_event(ev,
- 0,
- LIBINPUT_BUTTON_STATE_PRESSED);
+ ck_assert_int_eq(libinput_event_get_type(ev),
+ LIBINPUT_EVENT_TABLET_PAD_BUTTON);
+ pev = libinput_event_get_tablet_pad_event(ev);
oldtime = time;
time = libinput_event_tablet_pad_get_time(pev);
@@ -220,9 +220,9 @@ START_TEST(pad_button_mode_groups)
}
ev = libinput_get_event(li);
- pev = litest_is_pad_button_event(ev,
- expected_number,
- LIBINPUT_BUTTON_STATE_PRESSED);
+ ck_assert_int_eq(libinput_event_get_type(ev),
+ LIBINPUT_EVENT_TABLET_PAD_BUTTON);
+ pev = libinput_event_get_tablet_pad_event(ev);
/* litest virtual devices don't have modes */
mode = libinput_event_tablet_pad_get_mode(pev);
@@ -234,9 +234,10 @@ START_TEST(pad_button_mode_groups)
libinput_event_destroy(ev);
ev = libinput_get_event(li);
- pev = litest_is_pad_button_event(ev,
- expected_number,
- LIBINPUT_BUTTON_STATE_RELEASED);
+ ck_assert_int_eq(libinput_event_get_type(ev),
+ LIBINPUT_EVENT_TABLET_PAD_BUTTON);
+ pev = libinput_event_get_tablet_pad_event(ev);
+
mode = libinput_event_tablet_pad_get_mode(pev);
ck_assert_int_eq(mode, 0);
group = libinput_event_tablet_pad_get_mode_group(pev);
--
2.13.6
More information about the wayland-devel
mailing list