summaryrefslogtreecommitdiff
path: root/test/test-event-names.c
Commit message (Collapse)AuthorAgeFilesLines
* config.h is a local include pathPeter Hutterer2020-02-141-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: split the tests into one test case eachPeter Hutterer2020-02-111-34/+21
| | | | | | | | | For debugging it's more important to be able to quickly run a single test rather than grouping them together, we don't have thousands of tests here anyway. So let's add a macro to put every test func into its own TCase, allowing for test selection via the environment variable CK_RUN_CASE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* include: sync event codes with kernel 4.19Peter Hutterer2018-10-221-2/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add libevdev_event_value_get_name() to resolve ABS_MT_TOOL_TYPE valuesPeter Hutterer2018-07-091-0/+34
| | | | | | | | | | ABS_MT_TOOL_TYPE values are an enum, not a numerical value like all other axes. So let's allow converting those values to string. Fixes https://gitlab.freedesktop.org/libevdev/libevdev/issues/1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* test: automate test suite handlingPeter Hutterer2018-06-151-2/+1
| | | | | | | | Move all tests to a special section, then loop through that section to fetch all test suite. The result is that new tests only need to add the source files without having to update everything else as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Blacklist SW_MAX so it doesn't shadow SW_PEN_INSERTEDPeter Hutterer2018-02-261-1/+2
| | | | | | | | | | | | | | | | | 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>
* Blacklist REP_MAX so it doesn't shadow REP_PERIODPeter Hutterer2018-02-261-0/+10
| | | | | | | | | | | | | | 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. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* cosmetic: fix a couple of duplicate/missing empty linesPeter Hutterer2015-03-041-1/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: remove NULL test for SW_MAX, 3.13 defines SW_MUTE_DEVICEPeter Hutterer2014-01-291-3/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* include: update linux/input.h for kernel 3.12Peter Hutterer2014-01-091-2/+1
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Add a copy of linux/input.hPeter Hutterer2013-10-231-2/+2
| | | | | | | This avoids a number of otherwise required ifdefs when building on older kernels Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Mark three deprecated functions as suchPeter Hutterer2013-10-041-17/+17
| | | | | | | These are deprecated, but were missing the deprecated attribute. And fix up the tests that were still using those deprecated calls. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Revamp the API once againPeter Hutterer2013-09-101-90/+90
| | | | | | | | | | | | | | | | | Another look at the current API showed some inconsistencies, rectified in this commit: libevdev_kernel_*: modify the underlying kernel device libevdev_event_type_*: something with an event type libevdev_event_code_*: something with an event code libevdev_event_*: struct input_event-related functions (i.e. not device-related) libevdev_property_*: something with a property libevdev_*: anything applying to a device Hopefully that's the last API change. Current symbols deprecated and aliased. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Match the kernel define for SYN_MAXPeter Hutterer2013-09-041-10/+0
| | | | | | | | | Will be defined as 0xf in 3.12, see http://git.kernel.org/cgit/linux/kernel/git/dtor/input.git/commit/?h=next&id=52764fed5049655926bcecaefd52f0a415ceb105 And add the required ifdef guards for kernels before that. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix off-by-one errors when dealing with *_MAX values.Peter Hutterer2013-08-301-2/+2
| | | | | | | LED_MAX, KEY_MAX, ABS_MT_MAX, etc. are all valid event codes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* test: add test for libevdev_is_event_code(EV_SYN...)Peter Hutterer2013-08-291-0/+5
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix build without MSC_TIMESTAMPMartin Minarik2013-08-261-0/+2
| | | | | | To build with older input.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Rename a few getters for consistencyPeter Hutterer2013-08-011-8/+8
| | | | | | | | | | | Deprecated: * libevdev_get_abs_min, libevdev_get_abs_max * libevdev_get_input_prop_name Will be removed in one or two versions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* test: add test for event values (type and code)Peter Hutterer2013-07-041-0/+45
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: unify test case creation in test-event-names.cPeter Hutterer2013-07-041-25/+25
| | | | | | Simple rename from custom test case variable names to tc Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: prepare a common header file for all testsPeter Hutterer2013-06-291-3/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: test some more event max and invalid event type pathsPeter Hutterer2013-06-271-0/+15
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Pull all tests together into one binaryPeter Hutterer2013-06-271-11/+0
| | | | | | Easier to monitor gcov coverage that way Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Set up a test harnessPeter Hutterer2013-06-041-0/+261
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>