From: Kristian Høgsberg Date: Wed, 12 Dec 2012 02:56:13 +0000 (-0500) Subject: button-test: Use wl_display_roundtrip instead of yield() X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f63fab724111af4927b9e36d0ffbbcf3e870f2d0;p=profile%2Fivi%2Fweston-ivi-shell.git 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. --- diff --git a/tests/button-test.c b/tests/button-test.c index 0f9367e..2bb2e7f 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); }