libevdev/test
Peter Hutterer 76662deeff Don't read events unless required
With the previous approach, every libevdev_next_event() invocation triggered a
read() on the device fd. This is not efficient, the kernel provides whole
event frames at a time so we're guaranteed to have more events waiting unless
the current event is a SYN_REPORT.

Assuming a fast-enough client and e.g. a touchpad device with multiple axes
per frame, we'd thus trigger several unnecessary read() calls per event frame.

Drop this behavior, instead only trigger the read when our internal queue is
empty and we need more events.

Fallout:
- we don't have any warning about a too-slow sync, i.e. if a SYN_DROPPED
  arrives while we're syncing, we don't get a warning in the log anymore.
  the test for this was removed.
- the tests that required the specific behavior were rewritten accordingly
- a revoke on a kernel device doesn't return ENODEV until already-received
  events have been processed

The above shouldn't be an issue for existing real-world clients.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-19 01:02:52 +00:00
..
.gitignore Add a test for EVIOCREVOKE 2014-02-26 07:22:04 +10:00
generate-gcov-report.sh configure.ac: enable subdir-objects 2017-01-09 09:40:28 +10:00
Makefile.am test: add a test timeout multiplier for valgrind 2018-07-09 11:57:57 +10:00
test-common-uinput.c test: ignore a failure to UI_DEV_DESTROY the device 2016-03-04 07:26:53 +10:00
test-common-uinput.h cosmetic: fix a couple of duplicate/missing empty lines 2015-03-04 08:41:33 +10:00
test-common.c test: drop unnecessary return value 2016-03-04 07:10:33 +10:00
test-common.h test: sort-of autodetect whether we need root privileges 2018-06-15 15:01:19 +10:00
test-compile-pedantic.c test: add a build test for -Wpedantic 2013-11-23 09:00:53 +10:00
test-event-codes.c Add libevdev_event_value_get_name() to resolve ABS_MT_TOOL_TYPE values 2018-07-09 11:57:57 +10:00
test-event-names.c include: sync event codes with kernel 4.19 2018-10-22 18:55:57 +10:00
test-int-queue.c test: automate test suite handling 2018-06-15 15:00:24 +10:00
test-kernel.c Don't read events unless required 2019-03-19 01:02:52 +00:00
test-libevdev-events.c Don't read events unless required 2019-03-19 01:02:52 +00:00
test-libevdev-has-event.c test: sort-of autodetect whether we need root privileges 2018-06-15 15:01:19 +10:00
test-libevdev-init.c test: sort-of autodetect whether we need root privileges 2018-06-15 15:01:19 +10:00
test-link.c test: add basic link test 2013-12-12 13:19:52 +10:00
test-main.c test: add LIBEVDEV_SKIP_ROOT_TESTS environment variable check 2018-06-29 11:15:41 +10:00
test-uinput.c test: sort-of autodetect whether we need root privileges 2018-06-15 15:01:19 +10:00
valgrind.suppressions test: ignore any timer_create errors in valgrind 2014-06-12 09:50:22 +10:00