mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-05-08 04:18:03 +02:00
test: add incomplete test for input props
Can't set those via uinput, so we're limited to making sure nothing goes crazy. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6b1440a58e
commit
598bebfd92
1 changed files with 24 additions and 0 deletions
|
|
@ -222,6 +222,26 @@ START_TEST(test_ev_rep_values)
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
START_TEST(test_input_props)
|
||||||
|
{
|
||||||
|
struct uinput_device* uidev;
|
||||||
|
struct libevdev *dev;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = uinput_device_new_with_events(&uidev, "test device", DEFAULT_IDS,
|
||||||
|
EV_ABS, ABS_X,
|
||||||
|
-1);
|
||||||
|
ck_assert_msg(rc == 0, "Failed to create uinput device: %s", strerror(-rc));
|
||||||
|
rc = libevdev_new_from_fd(uinput_device_get_fd(uidev), &dev);
|
||||||
|
ck_assert_msg(rc == 0, "Failed to init device: %s", strerror(-rc));;
|
||||||
|
|
||||||
|
ck_assert_int_eq(libevdev_has_property(dev, INPUT_PROP_MAX + 1), 0);
|
||||||
|
ck_assert_int_eq(libevdev_has_property(dev, INPUT_PROP_MAX), 0);
|
||||||
|
ck_assert_int_eq(libevdev_has_property(dev, INPUT_PROP_BUTTONPAD), 0);
|
||||||
|
/* FIXME: no idea how to set props on uinput devices */
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
START_TEST(test_no_slots)
|
START_TEST(test_no_slots)
|
||||||
{
|
{
|
||||||
struct uinput_device* uidev;
|
struct uinput_device* uidev;
|
||||||
|
|
@ -344,6 +364,10 @@ libevdev_has_event_test(void)
|
||||||
tcase_add_test(tc, test_ev_rep_values);
|
tcase_add_test(tc, test_ev_rep_values);
|
||||||
suite_add_tcase(s, tc);
|
suite_add_tcase(s, tc);
|
||||||
|
|
||||||
|
tc = tcase_create("input properties");
|
||||||
|
tcase_add_test(tc, test_input_props);
|
||||||
|
suite_add_tcase(s, tc);
|
||||||
|
|
||||||
tc = tcase_create("multitouch info");
|
tc = tcase_create("multitouch info");
|
||||||
tcase_add_test(tc, test_no_slots);
|
tcase_add_test(tc, test_no_slots);
|
||||||
tcase_add_test(tc, test_slot_number);
|
tcase_add_test(tc, test_slot_number);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue