The protocol specification says: - when a wl_buffer is attached, it becomes pending - when a pending wl_buffer is committed, it becomes current and stays as pending
Therefore, a wl_buffer becomes busy without an explicit attach, if it was already pending from a previous attach. Excercise this path in the test, too, although the release count can legally be 0, 1, or 2. Signed-off-by: Pekka Paalanen <ppaala...@gmail.com> --- tests/event-test.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/event-test.c b/tests/event-test.c index 980dfaa..3a706b3 100644 --- a/tests/event-test.c +++ b/tests/event-test.c @@ -354,7 +354,7 @@ buffer_release_handler(void *data, struct wl_buffer *buffer) { int *released = data; - *released = 1; + *released += 1; } static struct wl_buffer_listener buffer_listener = { @@ -408,11 +408,19 @@ TEST(buffer_release) assert(buf2_released == 1); /* buf3 may or may not be released */ + /* commit buf3 again, without explicitly attaching it */ + frame_callback_set(surface, &frame); + wl_surface_commit(surface); + frame_callback_wait(client, &frame); + assert(buf1_released == 0); + assert(buf2_released == 1); + /* buf3_released may be 0, 1, or 2. */ + wl_surface_attach(surface, client->surface->wl_buffer, 0, 0); frame_callback_set(surface, &frame); wl_surface_commit(surface); frame_callback_wait(client, &frame); assert(buf1_released == 0); assert(buf2_released == 1); - assert(buf3_released == 1); + assert(buf3_released >= 1); } -- 1.7.12.4 _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel