[PATCH wayland] resource-test: Use wl_seat instead of wl_display for testing

Marek Chalupa mchqwerty at gmail.com
Fri Feb 12 09:13:11 UTC 2016


Hi,

added reviewed-by to the whole series in some previous e-mail, so just 
adding it here again, so that it can be seen in the patchwork

Reviewed-by: Marek Chalupa <mchqwerty at gmail.com>

Cheers,
Marek

On 01/14/16 21:32, Derek Foreman wrote:
> We're creating resources with versions up to 4.  wl_display isn't version 4,
> so this is technically verifying that we can do something we shouldn't.
>
> wl_seat already has versions this high, so switch to that.
>
> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
> ---
>   tests/resources-test.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tests/resources-test.c b/tests/resources-test.c
> index ea88afb..337f9f9 100644
> --- a/tests/resources-test.c
> +++ b/tests/resources-test.c
> @@ -45,7 +45,7 @@ TEST(create_resource_tst)
>   	client = wl_client_create(display, s[0]);
>   	assert(client);
>
> -	res = wl_resource_create(client, &wl_display_interface, 4, 0);
> +	res = wl_resource_create(client, &wl_seat_interface, 4, 0);
>   	assert(res);
>
>   	/* setters/getters */
> @@ -105,7 +105,7 @@ TEST(destroy_res_tst)
>   	client = wl_client_create(display, s[0]);
>   	assert(client);
>
> -	res = wl_resource_create(client, &wl_display_interface, 4, 0);
> +	res = wl_resource_create(client, &wl_seat_interface, 4, 0);
>   	assert(res);
>   	wl_resource_set_implementation(res, NULL, &destroyed, res_destroy_func);
>   	wl_resource_add_destroy_listener(res, &destroy_listener);
> @@ -119,7 +119,7 @@ TEST(destroy_res_tst)
>   	assert(notify_called); /* check if signal was emitted */
>   	assert(wl_client_get_object(client, id) == NULL);
>
> -	res = wl_resource_create(client, &wl_display_interface, 2, 0);
> +	res = wl_resource_create(client, &wl_seat_interface, 2, 0);
>   	assert(res);
>   	destroyed = 0;
>   	notify_called = 0;
> @@ -149,13 +149,13 @@ TEST(create_resource_with_same_id)
>   	client = wl_client_create(display, s[0]);
>   	assert(client);
>
> -	res = wl_resource_create(client, &wl_display_interface, 2, 0);
> +	res = wl_resource_create(client, &wl_seat_interface, 2, 0);
>   	assert(res);
>   	id = wl_resource_get_id(res);
>   	assert(wl_client_get_object(client, id) == res);
>
>   	/* this one should replace the old one */
> -	res2 = wl_resource_create(client, &wl_display_interface, 1, id);
> +	res2 = wl_resource_create(client, &wl_seat_interface, 1, id);
>   	assert(res2 != NULL);
>   	assert(wl_client_get_object(client, id) == res2);
>
>


More information about the wayland-devel mailing list