tests: check wl_display_roundtrip() for errors
Add a macro that wraps wl_display_roundtrip() and check for errors. It
is a macro, so that the assert would show the relevant file and line
number.
This will also catch protocol errors, that would go unnoticed otherwise.
All roundtrips in tests are replaced with the check.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
diff --git a/tests/button-test.c b/tests/button-test.c
index ac75ee0..dc02fd4 100644
--- a/tests/button-test.c
+++ b/tests/button-test.c
@@ -37,19 +37,19 @@
assert(pointer->state == 0);
wl_test_move_pointer(client->test->wl_test, 150, 150);
- wl_display_roundtrip(client->wl_display);
+ client_roundtrip(client);
assert(pointer->x == 50);
assert(pointer->y == 50);
wl_test_send_button(client->test->wl_test, BTN_LEFT,
WL_POINTER_BUTTON_STATE_PRESSED);
- wl_display_roundtrip(client->wl_display);
+ client_roundtrip(client);
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);
- wl_display_roundtrip(client->wl_display);
+ client_roundtrip(client);
assert(pointer->button == BTN_LEFT);
assert(pointer->state == WL_POINTER_BUTTON_STATE_RELEASED);
}