summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-11-02 15:49:48 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-11-02 15:56:38 +1000
commitbaf5c07243a83ef36d00e3dd3a29043496396f59 (patch)
tree3ae98d41ab181a05dad0f502f62ce420384a5412
parent4b4ff4e6b525666af7c91d3f3e7b34900073f296 (diff)
server/touch: fix button state checks on touch events
The protocol states that the button state on touch events must represent the state of physical buttons only. Thus, the state must always be 0 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--tests/server/touch.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/server/touch.cpp b/tests/server/touch.cpp
index 38cced5..2a6cb39 100644
--- a/tests/server/touch.cpp
+++ b/tests/server/touch.cpp
@@ -522,9 +522,7 @@ TEST_P(TouchTestXI2Version, TouchEventsButtonState)
{
XORG_TESTCASE("Select for touch events on the root window.\n"
"Create a pointer-emulating touch event.\n"
- "The button mask in the touch begin event must be 0.\n"
- "The button mask in the touch update events must be set for button 1.\n"
- "The button mask in the touch end event must be set for button 1.");
+ "The button mask in the touch begin, update, and end event must be 0.");
XIEventMask mask;
mask.deviceid = VIRTUAL_CORE_POINTER_ID;
@@ -573,12 +571,8 @@ TEST_P(TouchTestXI2Version, TouchEventsButtonState)
XIDeviceEvent *end = reinterpret_cast<XIDeviceEvent*>(ev.xcookie.data);
EXPECT_GT(end->buttons.mask_len, 0);
- EXPECT_TRUE(XIMaskIsSet(end->buttons.mask, 1)) << "ButtonRelease must have button 1 down";
- for (int i = 0; i < end->buttons.mask_len * 8; i++) {
- if (i == 1)
- continue;
+ for (int i = 0; i < end->buttons.mask_len * 8; i++)
EXPECT_FALSE(XIMaskIsSet(end->buttons.mask, i)) << "mask down for button " << i;
- }
XFreeEventData(Display(), &ev.xcookie);
}