[PATCH v2 libevdev 3.5/4] test: send a button event in the event type disabling test
Peter Hutterer
peter.hutterer at who-t.net
Tue Apr 26 04:32:19 UTC 2016
When we switch to using EVIOCSMASK for event types, the event frame would be
empty and the kernel supresses the SYN_REPORT, causing the test to fail. So
send an extra button event to make sure we filter properly.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
New in this series, needed before 4/4
test/test-libevdev-events.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/test/test-libevdev-events.c b/test/test-libevdev-events.c
index dd2face..2007a3d 100644
--- a/test/test-libevdev-events.c
+++ b/test/test-libevdev-events.c
@@ -314,11 +314,16 @@ START_TEST(test_event_type_filtered)
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
ck_assert_int_eq(rc, -EAGAIN);
+ uinput_device_event(uidev, EV_KEY, BTN_LEFT, 1);
uinput_device_event(uidev, EV_REL, REL_X, 1);
uinput_device_event(uidev, EV_KEY, REL_Y, 1);
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
+ ck_assert_int_eq(ev.type, EV_KEY);
+ ck_assert_int_eq(ev.code, BTN_LEFT);
+ rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
+ ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SUCCESS);
ck_assert_int_eq(ev.type, EV_SYN);
ck_assert_int_eq(ev.code, SYN_REPORT);
--
2.7.4
More information about the Input-tools
mailing list