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:
Peter Hutterer 2013-06-27 10:37:21 +10:00
parent 6b1440a58e
commit 598bebfd92

View file

@ -222,6 +222,26 @@ START_TEST(test_ev_rep_values)
}
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)
{
struct uinput_device* uidev;
@ -344,6 +364,10 @@ libevdev_has_event_test(void)
tcase_add_test(tc, test_ev_rep_values);
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");
tcase_add_test(tc, test_no_slots);
tcase_add_test(tc, test_slot_number);