test: don't set the abs value when initializing an uinput device

The helper function uses abs.value for the axis code (to save a parameter).
Reset that to 0 before we write to the device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2013-07-05 09:00:24 +10:00
parent 7645b083f4
commit 53abcb64d5

View file

@ -75,7 +75,14 @@ int test_create_abs_device(struct uinput_device **uidev_return,
va_end(args);
while (--nabs >= 0) {
rc = uinput_device_set_abs_bit(uidev, abs[nabs].value, &abs[nabs]);
int code;
struct input_absinfo a;
code = abs[nabs].value;
a = abs[nabs];
a.value = 0;
rc = uinput_device_set_abs_bit(uidev, code, &a);
ck_assert_msg(rc == 0, "for abs field %d\n", nabs);
}