blob: ef6903a4e869f76fbdf49d8b4418c22a902a2df4 [file] [log] [blame]
Pekka Paalanenf5b74f72015-03-25 12:50:31 +02001/*
2 * Copyright © 2012 Intel Corporation
3 * Copyright © 2013 DENSO CORPORATION
4 * Copyright © 2015 Collabora, Ltd.
5 *
Bryce Harrington2cc92972015-06-11 15:39:40 -07006 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020013 *
Bryce Harrington2cc92972015-06-11 15:39:40 -070014 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020026 */
27
28#include "config.h"
29
30#include <unistd.h>
31#include <signal.h>
32#include <string.h>
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090033#include <assert.h>
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020034
Pekka Paalanenb5e3ea22016-06-03 17:12:10 +030035#include "compositor.h"
Pekka Paalanen58f98c92016-06-03 16:45:21 +030036#include "compositor/weston.h"
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020037#include "weston-test-server-protocol.h"
38#include "ivi-test.h"
Jon Cruz4678bab2015-06-15 15:37:07 -070039#include "ivi-shell/ivi-layout-export.h"
Jon Cruz867d50e2015-06-15 15:37:10 -070040#include "shared/helpers.h"
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020041
42struct test_context;
43
44struct runner_test {
45 const char *name;
46 void (*run)(struct test_context *);
47} __attribute__ ((aligned (32)));
48
49#define RUNNER_TEST(name) \
50 static void runner_func_##name(struct test_context *); \
51 \
52 const struct runner_test runner_test_##name \
53 __attribute__ ((section ("test_section"))) = \
54 { \
55 #name, runner_func_##name \
56 }; \
57 \
58 static void runner_func_##name(struct test_context *ctx)
59
60extern const struct runner_test __start_test_section;
61extern const struct runner_test __stop_test_section;
62
63static const struct runner_test *
64find_runner_test(const char *name)
65{
66 const struct runner_test *t;
67
68 for (t = &__start_test_section; t < &__stop_test_section; t++) {
69 if (strcmp(t->name, name) == 0)
70 return t;
71 }
72
73 return NULL;
74}
75
76struct test_launcher {
77 struct weston_compositor *compositor;
78 char exe[2048];
79 struct weston_process process;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +000080 const struct ivi_layout_interface *layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020081};
82
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090083struct test_context {
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +000084 const struct ivi_layout_interface *layout_interface;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090085 struct wl_resource *runner_resource;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +090086 uint32_t user_flags;
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +000087
88 struct wl_listener surface_property_changed;
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +000089 struct wl_listener surface_created;
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +000090 struct wl_listener surface_removed;
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +000091 struct wl_listener surface_configured;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090092};
93
94static struct test_context static_context;
95
96static void
97destroy_runner(struct wl_resource *resource)
98{
99 assert(static_context.runner_resource == NULL ||
100 static_context.runner_resource == resource);
101
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000102 static_context.layout_interface = NULL;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900103 static_context.runner_resource = NULL;
104}
105
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200106static void
107runner_destroy_handler(struct wl_client *client, struct wl_resource *resource)
108{
109 wl_resource_destroy(resource);
110}
111
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200112static void
113runner_run_handler(struct wl_client *client, struct wl_resource *resource,
114 const char *test_name)
115{
116 struct test_launcher *launcher;
117 const struct runner_test *t;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900118
119 assert(static_context.runner_resource == NULL ||
120 static_context.runner_resource == resource);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200121
122 launcher = wl_resource_get_user_data(resource);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000123 static_context.layout_interface = launcher->layout_interface;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900124 static_context.runner_resource = resource;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200125
126 t = find_runner_test(test_name);
127 if (!t) {
128 weston_log("Error: runner test \"%s\" not found.\n",
129 test_name);
130 wl_resource_post_error(resource,
131 WESTON_TEST_RUNNER_ERROR_UNKNOWN_TEST,
132 "weston_test_runner: unknown: '%s'",
133 test_name);
134 return;
135 }
136
137 weston_log("weston_test_runner.run(\"%s\")\n", test_name);
138
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900139 t->run(&static_context);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200140
141 weston_test_runner_send_finished(resource);
142}
143
144static const struct weston_test_runner_interface runner_implementation = {
145 runner_destroy_handler,
146 runner_run_handler
147};
148
149static void
150bind_runner(struct wl_client *client, void *data,
151 uint32_t version, uint32_t id)
152{
153 struct test_launcher *launcher = data;
154 struct wl_resource *resource;
155
156 resource = wl_resource_create(client, &weston_test_runner_interface,
157 1, id);
158 if (!resource) {
159 wl_client_post_no_memory(client);
160 return;
161 }
162
163 wl_resource_set_implementation(resource, &runner_implementation,
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900164 launcher, destroy_runner);
165
166 if (static_context.runner_resource != NULL) {
167 weston_log("test FATAL: "
168 "attempting to run several tests in parallel.\n");
169 wl_resource_post_error(resource,
170 WESTON_TEST_RUNNER_ERROR_TEST_FAILED,
171 "attempt to run parallel tests");
172 }
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200173}
174
175static void
176test_client_sigchld(struct weston_process *process, int status)
177{
178 struct test_launcher *launcher =
179 container_of(process, struct test_launcher, process);
180 struct weston_compositor *c = launcher->compositor;
181
182 /* Chain up from weston-test-runner's exit code so that automake
183 * knows the exit status and can report e.g. skipped tests. */
184 if (WIFEXITED(status))
185 weston_compositor_exit_with_code(c, WEXITSTATUS(status));
186 else
187 weston_compositor_exit_with_code(c, EXIT_FAILURE);
188}
189
190static void
191idle_launch_client(void *data)
192{
193 struct test_launcher *launcher = data;
194 pid_t pid;
195 sigset_t allsigs;
196
197 pid = fork();
198 if (pid == -1) {
199 weston_log("fatal: failed to fork '%s': %m\n", launcher->exe);
200 weston_compositor_exit_with_code(launcher->compositor,
201 EXIT_FAILURE);
202 return;
203 }
204
205 if (pid == 0) {
206 sigfillset(&allsigs);
207 sigprocmask(SIG_UNBLOCK, &allsigs, NULL);
208 execl(launcher->exe, launcher->exe, NULL);
209 weston_log("compositor: executing '%s' failed: %m\n",
210 launcher->exe);
211 _exit(EXIT_FAILURE);
212 }
213
214 launcher->process.pid = pid;
215 launcher->process.cleanup = test_client_sigchld;
216 weston_watch_process(&launcher->process);
217}
218
219int
220controller_module_init(struct weston_compositor *compositor,
221 int *argc, char *argv[],
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000222 const struct ivi_layout_interface *iface,
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200223 size_t iface_version);
224
225WL_EXPORT int
226controller_module_init(struct weston_compositor *compositor,
227 int *argc, char *argv[],
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000228 const struct ivi_layout_interface *iface,
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200229 size_t iface_version)
230{
231 struct wl_event_loop *loop;
232 struct test_launcher *launcher;
233 const char *path;
234
235 /* strict check, since this is an internal test module */
236 if (iface_version != sizeof(*iface)) {
237 weston_log("fatal: controller interface mismatch\n");
238 return -1;
239 }
240
241 path = getenv("WESTON_BUILD_DIR");
242 if (!path) {
243 weston_log("test setup failure: WESTON_BUILD_DIR not set\n");
244 return -1;
245 }
246
247 launcher = zalloc(sizeof *launcher);
248 if (!launcher)
249 return -1;
250
251 launcher->compositor = compositor;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000252 launcher->layout_interface = iface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200253 snprintf(launcher->exe, sizeof launcher->exe,
254 "%s/ivi-layout.ivi", path);
255
256 if (wl_global_create(compositor->wl_display,
257 &weston_test_runner_interface, 1,
258 launcher, bind_runner) == NULL)
259 return -1;
260
261 loop = wl_display_get_event_loop(compositor->wl_display);
262 wl_event_loop_add_idle(loop, idle_launch_client, launcher);
263
264 return 0;
265}
266
267static void
268runner_assert_fail(const char *cond, const char *file, int line,
269 const char *func, struct test_context *ctx)
270{
271 weston_log("Assert failure in %s:%d, %s: '%s'\n",
272 file, line, func, cond);
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900273
274 assert(ctx->runner_resource);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200275 wl_resource_post_error(ctx->runner_resource,
276 WESTON_TEST_RUNNER_ERROR_TEST_FAILED,
277 "Assert failure in %s:%d, %s: '%s'\n",
278 file, line, func, cond);
279}
280
281#define runner_assert(cond) ({ \
282 bool b_ = (cond); \
283 if (!b_) \
284 runner_assert_fail(#cond, __FILE__, __LINE__, \
285 __func__, ctx); \
286 b_; \
287})
288
289#define runner_assert_or_return(cond) do { \
290 bool b_ = (cond); \
291 if (!b_) { \
292 runner_assert_fail(#cond, __FILE__, __LINE__, \
293 __func__, ctx); \
294 return; \
295 } \
296} while (0)
297
298
299/*************************** tests **********************************/
300
301/*
302 * This is a controller module: a plugin to ivi-shell.so, i.e. a sub-plugin.
303 * This module is specially written to execute tests that target the
304 * ivi_layout API.
305 *
306 * This module is listed in TESTS in Makefile.am. weston-tests-env handles
307 * this module specially by loading it in ivi-shell.
308 *
309 * Once Weston init completes, this module launches one test program:
310 * ivi-layout.ivi (ivi_layout-test.c). That program uses the weston-test-runner
311 * framework to fork and exec each TEST() in ivi_layout-test.c with a fresh
312 * connection to the single compositor instance.
313 *
314 * Each TEST() in ivi_layout-test.c will bind to weston_test_runner global
315 * interface. A TEST() will set up the client state, and issue
316 * weston_test_runner.run request to execute the compositor-side of the test.
317 *
318 * The compositor-side parts of the tests are in this file. They are specified
319 * by RUNNER_TEST() macro, where the name argument matches the name string
320 * passed to weston_test_runner.run.
321 *
322 * A RUNNER_TEST() function simply returns when it succeeds. If it fails,
323 * a fatal protocol error is sent to the client from runner_assert() or
324 * runner_assert_or_return(). This module catches the test program exit
325 * code and passes it out of Weston to the test harness.
326 *
327 * A single TEST() in ivi_layout-test.c may use multiple RUNNER_TEST()s to
328 * achieve multiple test points over a client action sequence.
329 */
330
331RUNNER_TEST(surface_create_p1)
332{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000333 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200334 struct ivi_layout_surface *ivisurf[2];
335 uint32_t ivi_id;
336
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000337 ivisurf[0] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900338 runner_assert(ivisurf[0]);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200339
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000340 ivisurf[1] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(1));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900341 runner_assert(ivisurf[1]);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200342
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000343 ivi_id = lyt->get_id_of_surface(ivisurf[0]);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900344 runner_assert(ivi_id == IVI_TEST_SURFACE_ID(0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200345
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000346 ivi_id = lyt->get_id_of_surface(ivisurf[1]);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900347 runner_assert(ivi_id == IVI_TEST_SURFACE_ID(1));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200348}
349
350RUNNER_TEST(surface_create_p2)
351{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000352 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200353 struct ivi_layout_surface *ivisurf;
354
355 /* the ivi_surface was destroyed by the client */
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000356 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900357 runner_assert(ivisurf == NULL);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200358}
359
360RUNNER_TEST(surface_visibility)
361{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000362 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200363 struct ivi_layout_surface *ivisurf;
364 int32_t ret;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200365 const struct ivi_layout_surface_properties *prop;
366
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000367 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900368 runner_assert(ivisurf);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200369
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000370 ret = lyt->surface_set_visibility(ivisurf, true);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900371 runner_assert(ret == IVI_SUCCEEDED);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200372
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000373 lyt->commit_changes();
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200374
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000375 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900376 runner_assert(prop->visibility == true);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200377}
378
379RUNNER_TEST(surface_opacity)
380{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000381 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200382 struct ivi_layout_surface *ivisurf;
383 int32_t ret;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200384 const struct ivi_layout_surface_properties *prop;
385
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000386 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900387 runner_assert(ivisurf);
388
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000389 prop = lyt->get_properties_of_surface(ivisurf);
390 runner_assert(prop->opacity == wl_fixed_from_double(1.0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200391
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000392 ret = lyt->surface_set_opacity(ivisurf, wl_fixed_from_double(0.5));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900393 runner_assert(ret == IVI_SUCCEEDED);
394
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000395 runner_assert(prop->opacity == wl_fixed_from_double(1.0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200396
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000397 lyt->commit_changes();
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200398
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900399 runner_assert(prop->opacity == wl_fixed_from_double(0.5));
400}
401
402RUNNER_TEST(surface_orientation)
403{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000404 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900405 struct ivi_layout_surface *ivisurf;
406 const struct ivi_layout_surface_properties *prop;
407
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000408 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900409 runner_assert(ivisurf != NULL);
410
Ucan, Emre \(ADITG/SW1\)4d9001b2016-03-04 12:50:35 +0000411 prop = lyt->get_properties_of_surface(ivisurf);
412 runner_assert_or_return(prop);
413 runner_assert(prop->orientation == WL_OUTPUT_TRANSFORM_NORMAL);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900414
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000415 runner_assert(lyt->surface_set_orientation(
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900416 ivisurf, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED);
417
Ucan, Emre \(ADITG/SW1\)4d9001b2016-03-04 12:50:35 +0000418 runner_assert(prop->orientation == WL_OUTPUT_TRANSFORM_NORMAL);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900419
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000420 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900421
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900422 runner_assert(prop->orientation == WL_OUTPUT_TRANSFORM_90);
423}
424
425RUNNER_TEST(surface_dimension)
426{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000427 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900428 struct ivi_layout_surface *ivisurf;
429 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900430
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000431 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900432 runner_assert(ivisurf != NULL);
433
Ucan, Emre \(ADITG/SW1\)c507f672016-03-04 12:50:28 +0000434 prop = lyt->get_properties_of_surface(ivisurf);
435 runner_assert_or_return(prop);
436 runner_assert(prop->dest_width == 1);
437 runner_assert(prop->dest_height == 1);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900438
439 runner_assert(IVI_SUCCEEDED ==
Ucan, Emre \(ADITG/SW1\)45d39422016-03-04 12:50:50 +0000440 lyt->surface_set_destination_rectangle(ivisurf, prop->dest_x,
441 prop->dest_y, 200, 300));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900442
Ucan, Emre \(ADITG/SW1\)c507f672016-03-04 12:50:28 +0000443 runner_assert(prop->dest_width == 1);
444 runner_assert(prop->dest_height == 1);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900445
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000446 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900447
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000448 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900449 runner_assert_or_return(prop);
450 runner_assert(prop->dest_width == 200);
451 runner_assert(prop->dest_height == 300);
452}
453
454RUNNER_TEST(surface_position)
455{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000456 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900457 struct ivi_layout_surface *ivisurf;
458 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900459
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000460 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900461 runner_assert(ivisurf != NULL);
462
Ucan, Emre \(ADITG/SW1\)b2ff2552016-03-04 12:50:20 +0000463 prop = lyt->get_properties_of_surface(ivisurf);
464 runner_assert_or_return(prop);
465 runner_assert(prop->dest_x == 0);
466 runner_assert(prop->dest_y == 0);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900467
Ucan, Emre \(ADITG/SW1\)161da402016-03-04 12:50:43 +0000468 runner_assert(lyt->surface_set_destination_rectangle(
469 ivisurf, 20, 30,
470 prop->dest_width, prop->dest_height) == IVI_SUCCEEDED);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900471
Ucan, Emre \(ADITG/SW1\)b2ff2552016-03-04 12:50:20 +0000472 runner_assert(prop->dest_x == 0);
473 runner_assert(prop->dest_y == 0);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900474
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000475 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900476
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000477 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900478 runner_assert_or_return(prop);
479 runner_assert(prop->dest_x == 20);
480 runner_assert(prop->dest_y == 30);
481}
482
483RUNNER_TEST(surface_destination_rectangle)
484{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000485 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900486 struct ivi_layout_surface *ivisurf;
487 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900488
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000489 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900490 runner_assert(ivisurf != NULL);
491
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000492 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900493 runner_assert_or_return(prop);
494 runner_assert(prop->dest_width == 1);
495 runner_assert(prop->dest_height == 1);
496 runner_assert(prop->dest_x == 0);
497 runner_assert(prop->dest_y == 0);
498
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000499 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900500 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
501
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000502 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900503 runner_assert_or_return(prop);
504 runner_assert(prop->dest_width == 1);
505 runner_assert(prop->dest_height == 1);
506 runner_assert(prop->dest_x == 0);
507 runner_assert(prop->dest_y == 0);
508
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000509 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900510
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000511 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900512 runner_assert_or_return(prop);
513 runner_assert(prop->dest_width == 200);
514 runner_assert(prop->dest_height == 300);
515 runner_assert(prop->dest_x == 20);
516 runner_assert(prop->dest_y == 30);
517}
518
519RUNNER_TEST(surface_source_rectangle)
520{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000521 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900522 struct ivi_layout_surface *ivisurf;
523 const struct ivi_layout_surface_properties *prop;
524
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000525 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900526 runner_assert(ivisurf != NULL);
527
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000528 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900529 runner_assert_or_return(prop);
530 runner_assert(prop->source_width == 0);
531 runner_assert(prop->source_height == 0);
532 runner_assert(prop->source_x == 0);
533 runner_assert(prop->source_y == 0);
534
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000535 runner_assert(lyt->surface_set_source_rectangle(
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900536 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
537
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000538 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900539 runner_assert_or_return(prop);
540 runner_assert(prop->source_width == 0);
541 runner_assert(prop->source_height == 0);
542 runner_assert(prop->source_x == 0);
543 runner_assert(prop->source_y == 0);
544
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000545 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900546
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000547 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900548 runner_assert_or_return(prop);
549 runner_assert(prop->source_width == 200);
550 runner_assert(prop->source_height == 300);
551 runner_assert(prop->source_x == 20);
552 runner_assert(prop->source_y == 30);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200553}
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900554
555RUNNER_TEST(surface_bad_opacity)
556{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000557 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900558 struct ivi_layout_surface *ivisurf;
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000559 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900560
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000561 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900562 runner_assert(ivisurf != NULL);
563
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000564 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900565 NULL, wl_fixed_from_double(0.3)) == IVI_FAILED);
566
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000567 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900568 ivisurf, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED);
569
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000570 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900571 ivisurf, wl_fixed_from_double(-1)) == IVI_FAILED);
572
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000573 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900574
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000575 prop = lyt->get_properties_of_surface(ivisurf);
576 runner_assert(prop->opacity == wl_fixed_from_double(0.3));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900577
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000578 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900579 ivisurf, wl_fixed_from_double(1.1)) == IVI_FAILED);
580
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000581 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900582
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000583 runner_assert(prop->opacity == wl_fixed_from_double(0.3));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900584
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000585 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900586 NULL, wl_fixed_from_double(0.5)) == IVI_FAILED);
587
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000588 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900589}
590
Ucan, Emre (ADITG/SW1)37d25bb2016-06-07 09:40:21 +0000591RUNNER_TEST(surface_on_many_layer)
592{
593 const struct ivi_layout_interface *lyt = ctx->layout_interface;
594 struct ivi_layout_surface *ivisurf;
595 struct ivi_layout_layer *ivilayers[IVI_TEST_LAYER_COUNT] = {};
596 struct ivi_layout_layer **array;
597 int32_t length = 0;
598 uint32_t i;
599
600 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
601 runner_assert(ivisurf != NULL);
602
603 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++) {
604 ivilayers[i] = lyt->layer_create_with_dimension(
605 IVI_TEST_LAYER_ID(i), 200, 300);
606 runner_assert(lyt->layer_add_surface(
607 ivilayers[i], ivisurf) == IVI_SUCCEEDED);
608 }
609
610 lyt->commit_changes();
611
612 runner_assert(lyt->get_layers_under_surface(
613 ivisurf, &length, &array) == IVI_SUCCEEDED);
614 runner_assert(IVI_TEST_LAYER_COUNT == length);
615 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
616 runner_assert(array[i] == ivilayers[i]);
617
618 if (length > 0)
619 free(array);
620
621 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
622 lyt->layer_remove_surface(ivilayers[i], ivisurf);
623
624 array = NULL;
625
626 lyt->commit_changes();
627
628 runner_assert(lyt->get_layers_under_surface(
629 ivisurf, &length, &array) == IVI_SUCCEEDED);
630 runner_assert(length == 0 && array == NULL);
631
632 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
633 lyt->layer_destroy(ivilayers[i]);
634}
635
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900636RUNNER_TEST(ivi_layout_commit_changes)
637{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000638 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900639
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000640 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900641}
642
643RUNNER_TEST(commit_changes_after_visibility_set_surface_destroy)
644{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000645 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900646 struct ivi_layout_surface *ivisurf;
647
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000648 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900649 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000650 runner_assert(lyt->surface_set_visibility(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900651 ivisurf, true) == IVI_SUCCEEDED);
652}
653
654RUNNER_TEST(commit_changes_after_opacity_set_surface_destroy)
655{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000656 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900657 struct ivi_layout_surface *ivisurf;
658
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000659 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900660 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000661 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900662 ivisurf, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED);
663}
664
665RUNNER_TEST(commit_changes_after_orientation_set_surface_destroy)
666{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000667 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900668 struct ivi_layout_surface *ivisurf;
669
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000670 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900671 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000672 runner_assert(lyt->surface_set_orientation(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900673 ivisurf, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED);
674}
675
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900676RUNNER_TEST(commit_changes_after_source_rectangle_set_surface_destroy)
677{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000678 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900679 struct ivi_layout_surface *ivisurf;
680
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000681 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900682 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000683 runner_assert(lyt->surface_set_source_rectangle(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900684 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
685}
686
687RUNNER_TEST(commit_changes_after_destination_rectangle_set_surface_destroy)
688{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000689 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900690 struct ivi_layout_surface *ivisurf;
691
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000692 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900693 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000694 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900695 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
696}
697
698RUNNER_TEST(get_surface_after_destroy_surface)
699{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000700 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900701 struct ivi_layout_surface *ivisurf;
702
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000703 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900704 runner_assert(ivisurf == NULL);
705}
706
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900707RUNNER_TEST(layer_render_order)
708{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000709 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900710 struct ivi_layout_layer *ivilayer;
711 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
712 struct ivi_layout_surface **array;
713 int32_t length = 0;
714 uint32_t i;
715
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000716 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900717
718 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000719 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900720
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000721 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900722 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
723
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000724 lyt->commit_changes();
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900725
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000726 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900727 ivilayer, &length, &array) == IVI_SUCCEEDED);
728 runner_assert(IVI_TEST_SURFACE_COUNT == length);
729 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
730 runner_assert(array[i] == ivisurfs[i]);
731
732 if (length > 0)
733 free(array);
734
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000735 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900736 ivilayer, NULL, 0) == IVI_SUCCEEDED);
737
738 array = NULL;
739
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000740 lyt->commit_changes();
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900741
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000742 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900743 ivilayer, &length, &array) == IVI_SUCCEEDED);
744 runner_assert(length == 0 && array == NULL);
745
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000746 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900747}
748
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900749RUNNER_TEST(test_layer_render_order_destroy_one_surface_p1)
750{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000751 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900752 struct ivi_layout_layer *ivilayer;
753 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
754 struct ivi_layout_surface **array;
755 int32_t length = 0;
756 int32_t i;
757
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000758 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900759
760 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000761 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900762
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000763 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900764 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
765
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000766 lyt->commit_changes();
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900767
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000768 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900769 ivilayer, &length, &array) == IVI_SUCCEEDED);
770 runner_assert(IVI_TEST_SURFACE_COUNT == length);
771 for (i = 0; i < length; i++)
772 runner_assert(array[i] == ivisurfs[i]);
773
774 if (length > 0)
775 free(array);
776}
777
778RUNNER_TEST(test_layer_render_order_destroy_one_surface_p2)
779{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000780 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900781 struct ivi_layout_layer *ivilayer;
782 struct ivi_layout_surface *ivisurfs[2] = {};
783 struct ivi_layout_surface **array;
784 int32_t length = 0;
785 int32_t i;
786
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000787 ivilayer = lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0));
788 ivisurfs[0] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
789 ivisurfs[1] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(2));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900790
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000791 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900792 ivilayer, &length, &array) == IVI_SUCCEEDED);
793 runner_assert(2 == length);
794 for (i = 0; i < length; i++)
795 runner_assert(array[i] == ivisurfs[i]);
796
797 if (length > 0)
798 free(array);
799
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000800 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900801}
802
803RUNNER_TEST(layer_bad_render_order)
804{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000805 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900806 struct ivi_layout_layer *ivilayer;
807 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
808 struct ivi_layout_surface **array = NULL;
809 int32_t length = 0;
810 uint32_t i;
811
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000812 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900813
814 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000815 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900816
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000817 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900818 NULL, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_FAILED);
819
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000820 lyt->commit_changes();
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900821
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000822 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900823 NULL, &length, &array) == IVI_FAILED);
824 runner_assert(length == 0 && array == NULL);
825
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000826 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900827 ivilayer, NULL, &array) == IVI_FAILED);
828 runner_assert(array == NULL);
829
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000830 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900831 ivilayer, &length, NULL) == IVI_FAILED);
832 runner_assert(length == 0);
833
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000834 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900835}
836
837RUNNER_TEST(commit_changes_after_render_order_set_surface_destroy)
838{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000839 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900840 struct ivi_layout_layer *ivilayer;
841 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
842 int i;
843
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000844 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900845
846 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000847 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900848
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000849 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900850 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
851}
852
853RUNNER_TEST(cleanup_layer)
854{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000855 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900856 struct ivi_layout_layer *ivilayer;
857
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000858 ivilayer = lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0));
859 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900860}
861
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900862static void
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000863test_surface_properties_changed_notification_callback(struct wl_listener *listener, void *data)
864
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900865{
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000866 struct test_context *ctx =
867 container_of(listener, struct test_context,
868 surface_property_changed);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000869 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000870 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900871
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000872 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900873
874 ctx->user_flags = 1;
875}
876
877RUNNER_TEST(surface_properties_changed_notification)
878{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000879 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900880 const uint32_t id_surface = IVI_TEST_SURFACE_ID(0);
881 struct ivi_layout_surface *ivisurf;
882
883 ctx->user_flags = 0;
884
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000885 ivisurf = lyt->get_surface_from_id(id_surface);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900886 runner_assert(ivisurf != NULL);
887
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000888 ctx->surface_property_changed.notify = test_surface_properties_changed_notification_callback;
889
890 runner_assert(lyt->surface_add_listener(
891 ivisurf, &ctx->surface_property_changed) == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900892
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000893 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900894
895 runner_assert(ctx->user_flags == 0);
896
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000897 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900898 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
899
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000900 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900901
902 runner_assert(ctx->user_flags == 1);
903
904 ctx->user_flags = 0;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000905 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900906 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
907
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000908 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900909
910 runner_assert(ctx->user_flags == 0);
911
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000912 // remove surface property changed listener.
913 wl_list_remove(&ctx->surface_property_changed.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900914 ctx->user_flags = 0;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000915 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900916 ivisurf, 40, 50, 400, 500) == IVI_SUCCEEDED);
917
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000918 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900919
920 runner_assert(ctx->user_flags == 0);
921}
922
923static void
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000924test_surface_configure_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900925{
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000926 struct test_context *ctx =
927 container_of(listener, struct test_context,
928 surface_configured);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000929 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000930 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900931
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000932 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900933
934 ctx->user_flags = 1;
935}
936
937RUNNER_TEST(surface_configure_notification_p1)
938{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000939 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900940
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000941 ctx->surface_configured.notify = test_surface_configure_notification_callback;
942 runner_assert(IVI_SUCCEEDED == lyt->add_listener_configure_surface(&ctx->surface_configured));
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000943 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900944
945 ctx->user_flags = 0;
946}
947
948RUNNER_TEST(surface_configure_notification_p2)
949{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900950 runner_assert(ctx->user_flags == 1);
951
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000952 // remove surface configured listener.
953 wl_list_remove(&ctx->surface_configured.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900954 ctx->user_flags = 0;
955}
956
957RUNNER_TEST(surface_configure_notification_p3)
958{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000959 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900960
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000961 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900962 runner_assert(ctx->user_flags == 0);
963}
964
965static void
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000966test_surface_create_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900967{
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000968 struct test_context *ctx =
969 container_of(listener, struct test_context,
970 surface_created);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000971 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000972 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900973
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000974 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900975
976 ctx->user_flags = 1;
977}
978
979RUNNER_TEST(surface_create_notification_p1)
980{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000981 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900982
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000983 ctx->surface_created.notify = test_surface_create_notification_callback;
984 runner_assert(lyt->add_listener_create_surface(
985 &ctx->surface_created) == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900986
987 ctx->user_flags = 0;
988}
989
990RUNNER_TEST(surface_create_notification_p2)
991{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900992 runner_assert(ctx->user_flags == 1);
993
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000994 // remove surface created listener.
995 wl_list_remove(&ctx->surface_created.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900996 ctx->user_flags = 0;
997}
998
999RUNNER_TEST(surface_create_notification_p3)
1000{
1001 runner_assert(ctx->user_flags == 0);
1002}
1003
1004static void
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001005test_surface_remove_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001006{
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001007 struct test_context *ctx =
1008 container_of(listener, struct test_context,
1009 surface_removed);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001010 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001011 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001012
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001013 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001014
1015 ctx->user_flags = 1;
1016}
1017
1018RUNNER_TEST(surface_remove_notification_p1)
1019{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001020 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001021
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001022 ctx->surface_removed.notify = test_surface_remove_notification_callback;
1023 runner_assert(lyt->add_listener_remove_surface(&ctx->surface_removed)
1024 == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001025
1026 ctx->user_flags = 0;
1027}
1028
1029RUNNER_TEST(surface_remove_notification_p2)
1030{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001031 runner_assert(ctx->user_flags == 1);
1032
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001033 // remove surface removed listener.
1034 wl_list_remove(&ctx->surface_removed.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001035 ctx->user_flags = 0;
1036}
1037
1038RUNNER_TEST(surface_remove_notification_p3)
1039{
1040 runner_assert(ctx->user_flags == 0);
1041}
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001042
1043static void
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +00001044test_surface_bad_properties_changed_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001045{
1046}
1047
1048RUNNER_TEST(surface_bad_properties_changed_notification)
1049{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001050 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001051 struct ivi_layout_surface *ivisurf;
1052
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001053 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001054 runner_assert(ivisurf != NULL);
1055
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +00001056 ctx->surface_property_changed.notify = test_surface_bad_properties_changed_notification_callback;
1057
1058 runner_assert(lyt->surface_add_listener(
1059 NULL, &ctx->surface_property_changed) == IVI_FAILED);
1060 runner_assert(lyt->surface_add_listener(
1061 ivisurf, NULL) == IVI_FAILED);
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001062}