test: don't set the abs value when initializing an uinput device
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 4 Jul 2013 23:00:24 +0000 (09:00 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 4 Jul 2013 23:11:34 +0000 (09:11 +1000)
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>
test/test-common.c

index 608853e..3cf771c 100644 (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);
        }