mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-05-05 08:48:00 +02:00
Blacklist REP_MAX so it doesn't shadow REP_PERIOD
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>
This commit is contained in:
parent
3799acd49e
commit
a67d1964ff
2 changed files with 12 additions and 1 deletions
|
|
@ -35,7 +35,8 @@ blacklist = [
|
||||||
"BTN_GAMEPAD",
|
"BTN_GAMEPAD",
|
||||||
"BTN_DIGI",
|
"BTN_DIGI",
|
||||||
"BTN_WHEEL",
|
"BTN_WHEEL",
|
||||||
"BTN_TRIGGER_HAPPY"
|
"BTN_TRIGGER_HAPPY",
|
||||||
|
"REP_MAX",
|
||||||
]
|
]
|
||||||
|
|
||||||
btn_additional = [
|
btn_additional = [
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,15 @@ START_TEST(test_code_snd_name)
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
START_TEST(test_code_rep_name)
|
||||||
|
{
|
||||||
|
ck_assert_str_eq(libevdev_event_code_get_name(EV_REP, REP_DELAY), "REP_DELAY");
|
||||||
|
ck_assert_str_eq(libevdev_event_code_get_name(EV_REP, REP_PERIOD), "REP_PERIOD");
|
||||||
|
ck_assert_str_eq(libevdev_event_code_get_name(EV_REP, REP_MAX), "REP_PERIOD");
|
||||||
|
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
START_TEST(test_code_msc_name)
|
START_TEST(test_code_msc_name)
|
||||||
{
|
{
|
||||||
/* pick out a few only */
|
/* pick out a few only */
|
||||||
|
|
@ -281,6 +290,7 @@ event_name_suite(void)
|
||||||
tcase_add_test(tc, test_code_key_name);
|
tcase_add_test(tc, test_code_key_name);
|
||||||
tcase_add_test(tc, test_code_led_name);
|
tcase_add_test(tc, test_code_led_name);
|
||||||
tcase_add_test(tc, test_code_snd_name);
|
tcase_add_test(tc, test_code_snd_name);
|
||||||
|
tcase_add_test(tc, test_code_rep_name);
|
||||||
tcase_add_test(tc, test_code_msc_name);
|
tcase_add_test(tc, test_code_msc_name);
|
||||||
tcase_add_test(tc, test_code_sw_name);
|
tcase_add_test(tc, test_code_sw_name);
|
||||||
tcase_add_test(tc, test_code_ff_name);
|
tcase_add_test(tc, test_code_ff_name);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue