test: upgrade to the Microsoft Surface Type Cover
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 24 Apr 2015 05:27:34 +0000 (15:27 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 27 Apr 2015 21:45:39 +0000 (07:45 +1000)
Almost identical to the one we already had but this one also has ABS_X/Y to
mess things up. Update the existing one, no need to add a separate device here.

The fake MT touch test needs to be updated now though. A fake MT device may be
an absolute device too, so if we use the touch_down() handlers we may generate
abs pointer events. That's valid, we only check for no touch events here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
test/litest-ms-surface-cover.c
test/touch.c

index 633bb79..37fe850 100644 (file)
@@ -35,6 +35,8 @@ litest_ms_surface_cover_setup(void)
 }
 
 static struct input_event down[] = {
+       { .type = EV_ABS, .code = ABS_X, .value = LITEST_AUTO_ASSIGN },
+       { .type = EV_ABS, .code = ABS_Y, .value = LITEST_AUTO_ASSIGN },
        { .type = EV_ABS, .code = ABS_MT_SLOT, .value = LITEST_AUTO_ASSIGN },
        { .type = EV_ABS, .code = ABS_MT_TRACKING_ID, .value = LITEST_AUTO_ASSIGN },
        { .type = EV_ABS, .code = ABS_MT_POSITION_X, .value = LITEST_AUTO_ASSIGN },
@@ -59,6 +61,8 @@ static struct litest_device_interface interface = {
 };
 
 static struct input_absinfo absinfo[] = {
+       { ABS_X, 0, 1022, 0, 0, 12 },
+       { ABS_Y, 0, 487, 0, 0, 12 },
        { ABS_VOLUME, 0, 1023, 0, 0, 0 },
        { ABS_MISC, 0, 255, 0, 0, 0 },
        { 41, 0, 255, 0, 0, 0 },
@@ -90,7 +94,7 @@ static struct input_absinfo absinfo[] = {
 static struct input_id input_id = {
        .bustype = 0x3,
        .vendor = 0x45e,
-       .product = 0x7a9,
+       .product = 0x7dc,
 };
 
 static int events[] = {
@@ -373,12 +377,12 @@ static int events[] = {
 
 struct litest_test_device litest_ms_surface_cover_device = {
        .type = LITEST_MS_SURFACE_COVER,
-       .features = LITEST_KEYS | LITEST_RELATIVE | LITEST_FAKE_MT | LITEST_BUTTON | LITEST_WHEEL,
+       .features = LITEST_KEYS | LITEST_ABSOLUTE | LITEST_RELATIVE | LITEST_FAKE_MT | LITEST_BUTTON | LITEST_WHEEL,
        .shortname = "MS surface cover",
        .setup = litest_ms_surface_cover_setup,
        .interface = &interface,
 
-       .name = "MICROSOFT SAM",
+       .name = "Microsoft Surface Type Cover",
        .id = &input_id,
        .events = events,
        .absinfo = absinfo,
index 5c363f9..eb9f4cb 100644 (file)
@@ -462,7 +462,8 @@ START_TEST(fake_mt_no_touch_events)
        litest_touch_up(dev, 0);
        litest_touch_up(dev, 1);
 
-       litest_assert_empty_queue(li);
+       litest_assert_only_typed_events(li,
+                                       LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE);
 }
 END_TEST