summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2015-06-22 15:35:39 +0900
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-06-25 11:39:05 +0300
commit83c20bcbd5aaf579ee8d7d61cd090bcd0f9ecbc7 (patch)
tree422a88478c1a2402d64d0445370f66a0180f07f5 /tests
parente78a7afb6047eafaab737fa1ade85b4d3d4d92a7 (diff)
tests: test set for ivi-screen with bad condition in server side
These tests are implemented on test suite framework, which provides internal method validation, Following features are tested, - ivi-screen operation with bad parameter - render order with bad parameter - destroy ivi-layer in the ivi-screen and call commit_changes Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ivi_layout-internal-test.c102
1 files changed, 102 insertions, 0 deletions
diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
index 3e3ba7f4..b82e9cbb 100644
--- a/tests/ivi_layout-internal-test.c
+++ b/tests/ivi_layout-internal-test.c
@@ -800,6 +800,104 @@ test_screen_render_order(struct test_context *ctx)
#undef LAYER_NUM
}
+static void
+test_screen_bad_resolution(struct test_context *ctx)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_screen **iviscrns;
+ int32_t screen_length = 0;
+ struct ivi_layout_screen *iviscrn;
+ int32_t width;
+ int32_t height;
+
+ iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED);
+ iassert(screen_length > 0);
+
+ if (screen_length <= 0)
+ return;
+
+ iviscrn = iviscrns[0];
+ iassert(ctl->get_screen_resolution(NULL, &width, &height) == IVI_FAILED);
+ iassert(ctl->get_screen_resolution(iviscrn, NULL, &height) == IVI_FAILED);
+ iassert(ctl->get_screen_resolution(iviscrn, &width, NULL) == IVI_FAILED);
+ free(iviscrns);
+}
+
+static void
+test_screen_bad_render_order(struct test_context *ctx)
+{
+#define LAYER_NUM (3)
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_screen **iviscrns;
+ int32_t screen_length;
+ struct ivi_layout_screen *iviscrn;
+ struct ivi_layout_layer *ivilayers[LAYER_NUM] = {};
+ struct ivi_layout_layer **array;
+ int32_t length = 0;
+ uint32_t i;
+
+ iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED);
+ iassert(screen_length > 0);
+
+ if (screen_length <= 0)
+ return;
+
+ iviscrn = iviscrns[0];
+
+ for (i = 0; i < LAYER_NUM; i++)
+ ivilayers[i] = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(i), 200, 300);
+
+ iassert(ctl->screen_set_render_order(NULL, ivilayers, LAYER_NUM) == IVI_FAILED);
+
+ ctl->commit_changes();
+
+ iassert(ctl->get_layers_on_screen(NULL, &length, &array) == IVI_FAILED);
+ iassert(ctl->get_layers_on_screen(iviscrn, NULL, &array) == IVI_FAILED);
+ iassert(ctl->get_layers_on_screen(iviscrn, &length, NULL) == IVI_FAILED);
+
+ for (i = 0; i < LAYER_NUM; i++)
+ ctl->layer_destroy(ivilayers[i]);
+
+ free(iviscrns);
+#undef LAYER_NUM
+}
+
+static void
+test_commit_changes_after_render_order_set_layer_destroy(
+ struct test_context *ctx)
+{
+#define LAYER_NUM (3)
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_screen **iviscrns;
+ int32_t screen_length;
+ struct ivi_layout_screen *iviscrn;
+ struct ivi_layout_layer *ivilayers[LAYER_NUM] = {};
+ uint32_t i;
+
+ iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED);
+ iassert(screen_length > 0);
+
+ if (screen_length <= 0)
+ return;
+
+ iviscrn = iviscrns[0];
+
+ for (i = 0; i < LAYER_NUM; i++)
+ ivilayers[i] = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(i), 200, 300);
+
+ iassert(ctl->screen_set_render_order(iviscrn, ivilayers, LAYER_NUM) == IVI_SUCCEEDED);
+
+ ctl->layer_destroy(ivilayers[1]);
+
+ ctl->commit_changes();
+
+ ctl->layer_destroy(ivilayers[0]);
+ ctl->layer_destroy(ivilayers[2]);
+
+ free(iviscrns);
+#undef LAYER_NUM
+}
+
/************************ tests end ********************************/
static void
@@ -845,6 +943,10 @@ run_internal_tests(void *data)
test_screen_id(ctx);
test_screen_resolution(ctx);
test_screen_render_order(ctx);
+ test_screen_bad_resolution(ctx);
+ test_screen_bad_render_order(ctx);
+ test_commit_changes_after_render_order_set_layer_destroy(ctx);
+
weston_compositor_exit_with_code(ctx->compositor, EXIT_SUCCESS);
free(ctx);