Commit graph

6 commits

Author SHA1 Message Date
Peter Hutterer
6ff816163e Blacklist SW_MAX so it doesn't shadow SW_PEN_INSERTED
They have the same value, so the _MAX code would shadow the real code, causing
issues in any client that needs to get all event names from libevdev.
Specifically, the loop of:
  for each code in 0 to max-for-type:
      print(name)
would not show up the code (but the _MAX) code instead. This causes issues
with clients that rely on name resolution that works. And the _MAX values are
special values anyway.

Blacklist it in the script here, causing it to resolve from name to code, but
not from code to name (like other duplicated codes).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-02-26 17:12:08 +10:00
Peter Hutterer
8742e1e346 Add libevdev_property_from_name()
12717d79 "Add libevdev_event_type/code_from_name() resolvers" added the
lookup functions for types and codes, this commit adds the missing ones for
input properties.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2014-08-20 08:43:15 +10:00
Peter Hutterer
d856a85cda test: drop include of libevdev-int.h
Not needed, and shouldn't be used in a test anyway

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-18 10:36:08 +10:00
Peter Hutterer
c0248818e6 test: use ck_assert_int_eq() where comparing integers
A simple ck_assert() just fails, a ck_assert_int_eq() also shows the two
values. Makes failures a bit easier to debug.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-08-18 10:36:08 +10:00
Peter Hutterer
2aa3d3f1b0 Provide separate lookup functions for zero-terminated strings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-11-01 08:18:41 +10:00
David Herrmann
523f34b2d9 Add name-resolver unit tests
A bunch of tests for the new name resolver.

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:24:26 +10:00