summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-09-21 09:08:12 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-10-04 10:49:44 +1000
commit77231f1aeafdeca14b139ded528b250b92a55726 (patch)
treef5229a2e2c73968b8c36b743b796a516ab5c9432
parent622e891354de6d8bdb46e2bff37471097c71be00 (diff)
test: fix the 'all codes' keyboard device
The ...create() method returned the wrong device, so this one was never actually used. Once we start using, we get test case failures related to the device having BTN_foo events as well. For now, just disable those codes so we have a keyboard with all keys and pass the tests. The rest needs better fixing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 4c4d400bcb7794ea7d1c57d02ae6b63ba5dbf406)
-rw-r--r--test/litest-device-keyboard-all-codes.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/litest-device-keyboard-all-codes.c b/test/litest-device-keyboard-all-codes.c
index a3ad468c..a0f3aa40 100644
--- a/test/litest-device-keyboard-all-codes.c
+++ b/test/litest-device-keyboard-all-codes.c
@@ -25,12 +25,13 @@
#include "litest.h"
#include "litest-int.h"
+#include "libinput-util.h"
static void all_codes_create(struct litest_device *d);
static void litest_keyboard_all_codes_setup(void)
{
- struct litest_device *d = litest_create_device(LITEST_KEYBOARD);
+ struct litest_device *d = litest_create_device(LITEST_KEYBOARD_ALL_CODES);
litest_set_current_device(d);
}
@@ -61,6 +62,11 @@ all_codes_create(struct litest_device *d)
int code, idx;
for (idx = 0, code = 0; code < KEY_MAX; code++) {
+ const char *name = libevdev_event_code_get_name(EV_KEY, code);
+
+ if (name && strneq(name, "BTN_", 4))
+ continue;
+
events[idx++] = EV_KEY;
events[idx++] = code;
}