2015-03-23 14:55:06 +03:00
|
|
|
/*
|
|
|
|
* Copyright © 2015 Collabora, Ltd.
|
|
|
|
*
|
2015-06-12 01:39:40 +03:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
* a copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
2015-03-23 14:55:06 +03:00
|
|
|
*
|
2015-06-12 01:39:40 +03:00
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
* next paragraph) shall be included in all copies or substantial
|
|
|
|
* portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
|
|
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
2015-03-23 14:55:06 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "weston-test-client-helper.h"
|
|
|
|
#include "ivi-application-client-protocol.h"
|
|
|
|
|
|
|
|
static struct ivi_application *
|
|
|
|
get_ivi_application(struct client *client)
|
|
|
|
{
|
|
|
|
struct global *g;
|
|
|
|
struct global *global_iviapp = NULL;
|
2019-11-05 17:47:10 +03:00
|
|
|
struct ivi_application *iviapp;
|
2015-03-23 14:55:06 +03:00
|
|
|
|
|
|
|
wl_list_for_each(g, &client->global_list, link) {
|
|
|
|
if (strcmp(g->interface, "ivi_application"))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (global_iviapp)
|
|
|
|
assert(0 && "multiple ivi_application objects");
|
|
|
|
|
|
|
|
global_iviapp = g;
|
|
|
|
}
|
|
|
|
|
|
|
|
assert(global_iviapp && "no ivi_application found");
|
|
|
|
|
|
|
|
assert(global_iviapp->version == 1);
|
|
|
|
|
|
|
|
iviapp = wl_registry_bind(client->wl_registry, global_iviapp->name,
|
|
|
|
&ivi_application_interface, 1);
|
|
|
|
assert(iviapp);
|
|
|
|
|
|
|
|
return iviapp;
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(ivi_application_exists)
|
|
|
|
{
|
|
|
|
struct client *client;
|
|
|
|
struct ivi_application *iviapp;
|
|
|
|
|
|
|
|
client = create_client();
|
|
|
|
iviapp = get_ivi_application(client);
|
|
|
|
client_roundtrip(client);
|
|
|
|
|
2019-11-06 16:59:33 +03:00
|
|
|
testlog("Successful bind: %p\n", iviapp);
|
2015-03-23 14:55:06 +03:00
|
|
|
}
|