summaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-06 14:29:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-06 15:08:39 +1000
commitbb4db83a92fca706f12cda13d057cef9e3efb97c (patch)
tree1ef7e0b2fce5a91cacfa7d0bc78c0f8f45030924 /tests/server
parentd1928dc73e95b85d6a2b403ff2e08bc2c47eb095 (diff)
server/barrier: test for correct values in pointer barrier events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/barriers-notify.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/tests/server/barriers-notify.cpp b/tests/server/barriers-notify.cpp
index 0683d15..7b82a3e 100644
--- a/tests/server/barriers-notify.cpp
+++ b/tests/server/barriers-notify.cpp
@@ -327,7 +327,15 @@ TEST_F(BarrierNotify, EventsDuringActiveGrab)
XIGrabDevice(dpy, VIRTUAL_CORE_POINTER_ID, root, CurrentTime, None, GrabModeAsync, GrabModeAsync, True, &no_mask);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(dpy, GenericEvent, xi2_opcode, XI_BarrierHit, 500));
- XSync(dpy, True);
+ {
+ XITEvent<XIBarrierEvent> hit(dpy, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_TRUE(hit.ev);
+ ASSERT_EQ(hit.ev->window, root);
+ ASSERT_EQ(hit.ev->root, root);
+ ASSERT_EQ(hit.ev->barrier, barrier);
+ ASSERT_EQ(hit.ev->root_x, 20);
+ ASSERT_EQ(hit.ev->root_y, 30);
+ }
/* if OE is false and mask is not set, but set on window → no event */
XIWarpPointer(dpy, VIRTUAL_CORE_POINTER_ID, None, root, 0, 0, 0, 0, 30, 30);
@@ -335,7 +343,6 @@ TEST_F(BarrierNotify, EventsDuringActiveGrab)
XIGrabDevice(dpy, VIRTUAL_CORE_POINTER_ID, root, CurrentTime, None, GrabModeAsync, GrabModeAsync, False, &no_mask);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_FALSE(xorg::testing::XServer::WaitForEvent(dpy, 500));
- XSync(dpy, True);
/* if OE is true and mask is set → event */
XIWarpPointer(dpy, VIRTUAL_CORE_POINTER_ID, None, root, 0, 0, 0, 0, 30, 30);
@@ -343,7 +350,15 @@ TEST_F(BarrierNotify, EventsDuringActiveGrab)
XIGrabDevice(dpy, VIRTUAL_CORE_POINTER_ID, root, CurrentTime, None, GrabModeAsync, GrabModeAsync, True, &event_mask);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(dpy, GenericEvent, xi2_opcode, XI_BarrierHit, 500));
- XSync(dpy, True);
+ {
+ XITEvent<XIBarrierEvent> hit(dpy, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_TRUE(hit.ev);
+ ASSERT_EQ(hit.ev->window, root);
+ ASSERT_EQ(hit.ev->root, root);
+ ASSERT_EQ(hit.ev->barrier, barrier);
+ ASSERT_EQ(hit.ev->root_x, 20);
+ ASSERT_EQ(hit.ev->root_y, 30);
+ }
/* if OE is false and mask is set → event */
XIWarpPointer(dpy, VIRTUAL_CORE_POINTER_ID, None, root, 0, 0, 0, 0, 30, 30);
@@ -351,7 +366,15 @@ TEST_F(BarrierNotify, EventsDuringActiveGrab)
XIGrabDevice(dpy, VIRTUAL_CORE_POINTER_ID, root, CurrentTime, None, GrabModeAsync, GrabModeAsync, False, &event_mask);
dev->PlayOne(EV_REL, REL_X, -40, True);
ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(dpy, GenericEvent, xi2_opcode, XI_BarrierHit, 500));
- XSync(dpy, True);
+ {
+ XITEvent<XIBarrierEvent> hit(dpy, GenericEvent, xi2_opcode, XI_BarrierHit);
+ ASSERT_TRUE(hit.ev);
+ ASSERT_EQ(hit.ev->window, root);
+ ASSERT_EQ(hit.ev->root, root);
+ ASSERT_EQ(hit.ev->barrier, barrier);
+ ASSERT_EQ(hit.ev->root_x, 20);
+ ASSERT_EQ(hit.ev->root_y, 30);
+ }
XFixesDestroyPointerBarrier(dpy, barrier);
}