summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-12-11 21:56:13 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-12-11 23:57:44 -0500
commita1ada26c2b9155c929a14435523ab35bab5010be (patch)
treeeb51bc53c3612a6500c22a4fc183176aff39f4dc /tests
parentcd7f09975a756050cd9e1f2ad70ec24297e45524 (diff)
downloadweston-a1ada26c2b9155c929a14435523ab35bab5010be.tar.gz
weston-a1ada26c2b9155c929a14435523ab35bab5010be.tar.bz2
weston-a1ada26c2b9155c929a14435523ab35bab5010be.zip
button-test: Use wl_display_roundtrip instead of yield()
A round trip is sufficient here. We need to make sure that the server has received the wl_test request and that we've received the event that the request triggers. The wl_display_roundtrip() helper does exactly that: it sends a wl_display.sync request, which will hit the server after the wl_test requests and thus the wl_callback.done event will come back after the server has seen all the previous requests and after we've handled all preceeding event.
Diffstat (limited to 'tests')
-rw-r--r--tests/button-test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/button-test.c b/tests/button-test.c
index 0f9367e6..2bb2e7f5 100644
--- a/tests/button-test.c
+++ b/tests/button-test.c
@@ -42,13 +42,13 @@ TEST(simple_button_test)
wl_test_send_button(client->test->wl_test, BTN_LEFT,
WL_POINTER_BUTTON_STATE_PRESSED);
- yield(client);
+ wl_display_roundtrip(client->wl_display);
assert(pointer->button == BTN_LEFT);
assert(pointer->state == WL_POINTER_BUTTON_STATE_PRESSED);
wl_test_send_button(client->test->wl_test, BTN_LEFT,
WL_POINTER_BUTTON_STATE_RELEASED);
- yield(client);
+ wl_display_roundtrip(client->wl_display);
assert(pointer->button == BTN_LEFT);
assert(pointer->state == WL_POINTER_BUTTON_STATE_RELEASED);
}