diff options
-rw-r--r-- | tests/server/input.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/server/input.cpp b/tests/server/input.cpp index 51f7fc8..678f734 100644 --- a/tests/server/input.cpp +++ b/tests/server/input.cpp @@ -772,6 +772,7 @@ TEST_F(DeviceChangedTest, DeviceChangedEvent) mask.deviceid = XIAllMasterDevices; mask.mask_len = XIMaskLen(XI_Motion); mask.mask = new unsigned char[mask.mask_len](); + XISetMask(mask.mask, XI_ButtonPress); XISetMask(mask.mask, XI_Motion); XISetMask(mask.mask, XI_DeviceChanged); XISelectEvents(dpy, DefaultRootWindow(dpy), &mask, 1); @@ -784,16 +785,18 @@ TEST_F(DeviceChangedTest, DeviceChangedEvent) TouchDev().TouchEnd(120, 120, 0); ASSERT_EVENT(XIDeviceChangedEvent, dce1, dpy, GenericEvent, xi2_opcode, XI_DeviceChanged); - ASSERT_EVENT(XIDeviceEvent, motion, dpy, GenericEvent, xi2_opcode, XI_Motion); + ASSERT_EVENT(XIDeviceEvent, motion1, dpy, GenericEvent, xi2_opcode, XI_Motion); + ASSERT_EVENT(XIDeviceEvent, press1, dpy, GenericEvent, xi2_opcode, XI_ButtonPress); ASSERT_EVENT(XIDeviceEvent, motion2, dpy, GenericEvent, xi2_opcode, XI_Motion); - ASSERT_GT(motion->valuators.mask_len, 0); - ASSERT_TRUE(XIMaskIsSet(motion->valuators.mask, vscroll_axis)); + ASSERT_EVENT(XIDeviceEvent, motion3, dpy, GenericEvent, xi2_opcode, XI_Motion); + ASSERT_GT(motion1->valuators.mask_len, 0); + ASSERT_TRUE(XIMaskIsSet(motion1->valuators.mask, vscroll_axis)); double last_value; - double *valuators = motion->valuators.values; + double *valuators = motion1->valuators.values; for (int i = 0; i < vscroll_axis; i++) { - if (XIMaskIsSet(motion->valuators.mask, i)) + if (XIMaskIsSet(motion1->valuators.mask, i)) valuators++; } @@ -803,7 +806,7 @@ TEST_F(DeviceChangedTest, DeviceChangedEvent) MouseDev().RelMotion(1, 0); ASSERT_EVENT(XIDeviceChangedEvent, dce2, dpy, GenericEvent, xi2_opcode, XI_DeviceChanged); - ASSERT_EVENT(XIDeviceEvent, motion3, dpy, GenericEvent, xi2_opcode, XI_Motion); + ASSERT_EVENT(XIDeviceEvent, motion4, dpy, GenericEvent, xi2_opcode, XI_Motion); TouchDev().TouchBegin(100, 100, 0, event_valuators); TouchDev().TouchUpdate(120, 120, 0); |