summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-11-22 10:20:00 +1000
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2013-11-27 13:11:23 -0500
commit27790bfbe6d227f6f7fb3560658da94258f44109 (patch)
tree8a3e5ab6ac3b00c7b2d46ea5ea44b2b34a41a19d /test
parentaa549c556ef750764a30090ef8fe9e4b2ea8a095 (diff)
test: only test for event code if we have the type
Fixed versions of libevdev won't enable event types that don't exist, so we can't expect them to be enabled. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/test-evemu-create.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test-evemu-create.c b/test/test-evemu-create.c
index 3df3194..27fb326 100644
--- a/test/test-evemu-create.c
+++ b/test/test-evemu-create.c
@@ -174,14 +174,20 @@ void check_evemu_read(int fd, const char *file, enum flags flags)
if (flags & BITS) {
int i, j;
- for (i = 0; i < EV_CNT; i++)
+ for (i = 1; i < EV_CNT; i++) {
+ if (!evemu_has_bit(dev, i))
+ continue;
+
for (j = 0; j < max[i]; j++)
assert(evemu_has_event(dev, i, j));
+ }
}
if (flags & ABSINFO) {
int i;
for (i = 0; i < ABS_CNT; i++) {
+ if (!evemu_has_event(dev, EV_ABS, i))
+ continue;
assert(evemu_get_abs_minimum(dev, i) == i + 1);
assert(evemu_get_abs_maximum(dev, i) == i + 2);
assert(evemu_get_abs_fuzz(dev, i) == i + 3);