test: skip manually setting uinput resolution if it's already set

If we have libevdev 1.5 or later, the resolution is already set, no need to
change it again. Let's rely on libevdev to do the right thing and simply skip
the rest if we have one correct nonzero resolution already set on the device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Peter Hutterer 2016-05-18 11:52:12 +10:00
parent 5f4f211d6d
commit 41b9078eec

View file

@ -2293,6 +2293,10 @@ litest_create_uinput(const char *name,
abs = abs_info;
while (abs && abs->value != -1) {
if (abs->resolution != 0) {
if (libevdev_get_abs_resolution(dev, abs->value) ==
abs->resolution)
break;
rc = libevdev_kernel_set_abs_info(dev,
abs->value,
abs);