test: add two more checks for the current slot
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 27 Feb 2014 06:52:51 +0000 (16:52 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 5 Mar 2014 23:21:02 +0000 (09:21 +1000)
When syncing, we expect the slot to stay the same until the client has
processed the events. This already worked, just add a check to make sure.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
test/test-libevdev-events.c

index b9945b4..c9ceb33 100644 (file)
@@ -518,6 +518,7 @@ START_TEST(test_syn_delta_mt)
        rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_FORCE_SYNC, &ev);
        ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC);
 
+       ck_assert_int_eq(libevdev_get_current_slot(dev), 0);
        rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev);
        ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC);
        ck_assert_int_eq(ev.type, EV_ABS);
@@ -553,6 +554,8 @@ START_TEST(test_syn_delta_mt)
        ck_assert_int_eq(ev.type, EV_ABS);
        ck_assert_int_eq(ev.code, ABS_MT_SLOT);
        ck_assert_int_eq(ev.value, 1);
+       ck_assert_int_eq(libevdev_get_current_slot(dev), 1);
+
        rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev);
        ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC);
        ck_assert_int_eq(ev.type, EV_ABS);