tests: add frame_callback_wait_nofail
With expect_protocol_error, we need a possibility to wait for a frame without aborting the test when wl_display_dispatch returns -1; This patch adds function frame_callback_wait_nofail that only returns 1 or 0 (instead of aborting on error). Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
4d06d46ace
commit
1740aa8c85
|
@ -80,12 +80,15 @@ frame_callback_set(struct wl_surface *surface, int *done)
|
||||||
return callback;
|
return callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
frame_callback_wait(struct client *client, int *done)
|
frame_callback_wait_nofail(struct client *client, int *done)
|
||||||
{
|
{
|
||||||
while (!*done) {
|
while (!*done) {
|
||||||
assert(wl_display_dispatch(client->wl_display) >= 0);
|
if (wl_display_dispatch(client->wl_display) < 0)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -120,8 +120,10 @@ move_client(struct client *client, int x, int y);
|
||||||
struct wl_callback *
|
struct wl_callback *
|
||||||
frame_callback_set(struct wl_surface *surface, int *done);
|
frame_callback_set(struct wl_surface *surface, int *done);
|
||||||
|
|
||||||
void
|
int
|
||||||
frame_callback_wait(struct client *client, int *done);
|
frame_callback_wait_nofail(struct client *client, int *done);
|
||||||
|
|
||||||
|
#define frame_callback_wait(c, d) assert(frame_callback_wait_nofail((c), (d)))
|
||||||
|
|
||||||
int
|
int
|
||||||
get_n_egl_buffers(struct client *client);
|
get_n_egl_buffers(struct client *client);
|
||||||
|
|
Loading…
Reference in New Issue