mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-29 03:10:07 +01:00
test: when creating an abs test device, force the abs->value to the mimimum
Otherwise the abs->value could lie outside the [min, max] range of the axis.
This isn't much of an issue for actual axes but in the case of ABS_MT_SLOT
(value 47) it causes errors when libevdev sanitises the event into the allowed
slot range.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 5f55d71774)
This commit is contained in:
parent
8be6d697ac
commit
762ea1563c
1 changed files with 6 additions and 2 deletions
|
|
@ -2248,8 +2248,12 @@ litest_create_uinput(const char *name,
|
|||
|
||||
abs = abs_info;
|
||||
while (abs && abs->value != -1) {
|
||||
rc = libevdev_enable_event_code(dev, EV_ABS,
|
||||
abs->value, abs);
|
||||
struct input_absinfo a = *abs;
|
||||
|
||||
/* abs_info->value is used for the code and may be outside
|
||||
of [min, max] */
|
||||
a.value = abs->minimum;
|
||||
rc = libevdev_enable_event_code(dev, EV_ABS, abs->value, &a);
|
||||
litest_assert_int_eq(rc, 0);
|
||||
abs++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue