Commit graph

17 commits

Author SHA1 Message Date
Peter Hutterer
c97839a81e test: remove checks for test device creation failure
test_create_... fails on a non-zero return code anyway

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-02 11:35:56 +10:00
Peter Hutterer
b08ed615d3 test: whitespace fixes (newlines)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-05 19:16:08 +10:00
Peter Hutterer
50b82c19b5 Actually filter by log priority
If a message is higher than the current priority, filter it. And add a few
tests that the priority is handled the way it should.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2014-02-13 08:07:30 +10:00
Peter Hutterer
0c01886985 test: abort on unexpected log messages
Add two log functions, one that aborts on a received message. We know when we
expect to receive an error, so anytime this happens unexpectedly should
terminate the test.

And for those tests do issue a log message, let them ignore it and don't
print anything.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-22 09:14:40 +10:00
David Herrmann
639a5a9b56 Fix wrong libevdev clock test
We can rely on CLOCK_MONOTONIC and CLOCK_REALTIME to be different at any
time. However, this does not apply to the ms/us/ns parts of the current
time. Both may be in sync regarding the current micro-seconds state. So
remove the wrong clock us-comparison.

I was able to trigger this on my machine. Chances that both are in sync
are very low so I assume my RTC only provides low granularity and thus
both clocks are sync during boot for higher granularity.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-31 11:23:13 +10:00
Peter Hutterer
1e81ac1e28 wrap EVIOCSCLOCKID into an API call
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-13 09:28:00 +10:00
Peter Hutterer
b539cfd808 test: add a test for checking log data being passed around correctly
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-12 14:28:05 +10:00
Peter Hutterer
661602fe3b Name-space the read flags better
Rename from LIBEVDEV_READ_foo to LIBEVDEV_READ_FLAG_foo to differentiate
better from LIBEVDEV_READ_STATUS_foo.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-11 12:10:15 +10:00
Peter Hutterer
112ac0351f test: test for logging function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-10 09:54:29 +10:00
Peter Hutterer
55d67a340b Drop per-device logging function, use per-library one instead
There's no need to have separate logging function for each device created.
More likely, libevdev will be hooked up once into the logging system and
expected to deal with it.

Plus, this allows us to log from the uinput code where we don't
have the context anyway.

Requires a rename to libevdev_set_log_function to avoid ABI breaks, and
while we're breaking the ABI make the logging function more sophisticated
to log line, number, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-03 16:58:54 +10:00
Peter Hutterer
20f7cb8006 test: define a common device name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-05 09:11:34 +10:00
Peter Hutterer
f456a9dce4 test: use new convenience function for uinput device creation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-29 18:19:50 +10:00
Peter Hutterer
a30f4cfa8a test: prepare a common header file for all tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-29 18:00:42 +10:00
Peter Hutterer
e8f059f235 test: fix a bunch of memory leaks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-28 13:13:55 +10:00
Peter Hutterer
bacceb4c48 test: add test case for device grabbing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:55 +10:00
Peter Hutterer
9e81874c49 Pull all tests together into one binary
Easier to monitor gcov coverage that way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 10:41:54 +10:00
Peter Hutterer
645d5d3a64 test: add infrastructure for uinput device tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-26 17:47:24 +10:00