weston-test-client-helper: Use the helper already avaible

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2025-05-02 10:57:36 +03:00
parent 3b7d29f871
commit 1296690ede
3 changed files with 6 additions and 17 deletions

View file

@ -119,20 +119,6 @@ static void assert_output_matches(struct wet_testsuite_data *suite_data,
test_assert_s32_eq(s->height, c->height);
}
static void *
get_server_res_from_proxy(struct wet_testsuite_data *suite_data,
void *p)
{
uint32_t id = wl_proxy_get_id((struct wl_proxy *) p);
struct wl_resource *res;
test_assert_ptr_not_null(p);
test_assert_u32_gt(id, 0);
res = wl_client_get_object(suite_data->wl_client, id);
test_assert_ptr_not_null(res);
return wl_resource_get_user_data(res);
}
static void
assert_surface_is_background(struct wet_testsuite_data *suite_data,
struct weston_surface *surface)
@ -445,8 +431,8 @@ TEST(test_surface_unmaps_on_null)
/* Check that kiosk-shell's view of our surface has been
* unmapped, and that there aren't any more views. */
surface = get_server_res_from_proxy(suite_data,
xdg_surface->surface->wl_surface);
surface = get_resource_data_from_proxy(suite_data,
(struct wl_proxy *) xdg_surface->surface->wl_surface);
test_assert_false(weston_surface_is_mapped(surface));
test_assert_ptr_null(surface->buffer_ref.buffer);
test_assert_ptr_null(surface->output);

View file

@ -2335,7 +2335,7 @@ client_wait_breakpoint(struct client *client,
return active_bp;
}
static void *
void *
get_resource_data_from_proxy(struct wet_testsuite_data *suite_data,
struct wl_proxy *proxy)
{

View file

@ -380,5 +380,8 @@ void
client_release_breakpoint(struct client *client,
struct wet_testsuite_data *suite_data,
struct wet_test_active_breakpoint *active_bp);
void *
get_resource_data_from_proxy(struct wet_testsuite_data *suite_data,
struct wl_proxy *proxy);
#endif