summaryrefslogtreecommitdiff
path: root/test/test-pad.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-01-04 12:35:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-01-04 03:53:37 +0000
commit62bcac30fc99cde4e6e64112088c7c093341aa9d (patch)
treeab24243856609964ac657427492c938efdce344d /test/test-pad.c
parent6d683213dbbf17ee0e03138802bb071efb6944cd (diff)
test: add test devices for the Cintiq Pro 16
Reconstructed from the HID descriptors here: https://github.com/linuxwacom/wacom-hid-descriptors/tree/master/Wacom Cintiq Pro 16/ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test/test-pad.c')
-rw-r--r--test/test-pad.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/test-pad.c b/test/test-pad.c
index 04b00746..2965436c 100644
--- a/test/test-pad.c
+++ b/test/test-pad.c
@@ -66,13 +66,16 @@ START_TEST(pad_time)
struct libinput_event_tablet_pad *pev;
unsigned int code;
uint64_t time, time_usec, oldtime;
+ bool has_buttons = false;
litest_drain_events(li);
- for (code = BTN_0; code < KEY_MAX; code++) {
+ for (code = BTN_0; code < BTN_DIGI; code++) {
if (!libevdev_has_event_code(dev->evdev, EV_KEY, code))
continue;
+ has_buttons = true;
+
litest_button_click(dev, code, 1);
litest_button_click(dev, code, 0);
libinput_dispatch(li);
@@ -88,7 +91,11 @@ START_TEST(pad_time)
break;
}
+ if (!has_buttons)
+ return;
+
ev = libinput_get_event(li);
+ ck_assert_notnull(ev);
ck_assert_int_eq(libinput_event_get_type(ev),
LIBINPUT_EVENT_TABLET_PAD_BUTTON);
pev = libinput_event_get_tablet_pad_event(ev);
@@ -160,7 +167,7 @@ START_TEST(pad_num_buttons)
unsigned int code;
unsigned int nbuttons = 0;
- for (code = BTN_0; code < KEY_MAX; code++) {
+ for (code = BTN_0; code < KEY_OK; code++) {
/* BTN_STYLUS is set for compatibility reasons but not
* actually hooked up */
if (code == BTN_STYLUS)
@@ -338,7 +345,7 @@ START_TEST(pad_button_mode_groups)
litest_drain_events(li);
- for (code = BTN_0; code < KEY_MAX; code++) {
+ for (code = BTN_0; code < KEY_OK; code++) {
unsigned int mode, index;
struct libinput_tablet_pad_mode_group *group;