ivi-shell: add layer_add_surfaces test

Test adds 3 surfaces in a layer's render order list.
First, it adds in the order which surfaces are created.
Later, test cleans the render order list, and adds surfaces in reverse
order.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Ucan, Emre (ADITG/SW1) 8 years ago committed by Pekka Paalanen
parent 847c32d34b
commit 5d6aa9ba30
  1. 49
      tests/ivi_layout-test-plugin.c
  2. 1
      tests/ivi_layout-test.c

@ -835,6 +835,55 @@ RUNNER_TEST(layer_bad_render_order)
lyt->layer_destroy(ivilayer); lyt->layer_destroy(ivilayer);
} }
RUNNER_TEST(layer_add_surfaces)
{
const struct ivi_layout_interface *lyt = ctx->layout_interface;
struct ivi_layout_layer *ivilayer;
struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
struct ivi_layout_surface **array;
int32_t length = 0;
uint32_t i;
ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++) {
ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
runner_assert(lyt->layer_add_surface(
ivilayer, ivisurfs[i]) == IVI_SUCCEEDED);
}
lyt->commit_changes();
runner_assert(lyt->get_surfaces_on_layer(
ivilayer, &length, &array) == IVI_SUCCEEDED);
runner_assert(IVI_TEST_SURFACE_COUNT == length);
for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
runner_assert(array[i] == ivisurfs[i]);
if (length > 0)
free(array);
runner_assert(lyt->layer_set_render_order(
ivilayer, NULL, 0) == IVI_SUCCEEDED);
for (i = IVI_TEST_SURFACE_COUNT; i-- > 0;)
runner_assert(lyt->layer_add_surface(
ivilayer, ivisurfs[i]) == IVI_SUCCEEDED);
lyt->commit_changes();
runner_assert(lyt->get_surfaces_on_layer(
ivilayer, &length, &array) == IVI_SUCCEEDED);
runner_assert(IVI_TEST_SURFACE_COUNT == length);
for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
runner_assert(array[i] == ivisurfs[IVI_TEST_SURFACE_COUNT - (i + 1)]);
if (length > 0)
free(array);
lyt->layer_destroy(ivilayer);
}
RUNNER_TEST(commit_changes_after_render_order_set_surface_destroy) RUNNER_TEST(commit_changes_after_render_order_set_surface_destroy)
{ {
const struct ivi_layout_interface *lyt = ctx->layout_interface; const struct ivi_layout_interface *lyt = ctx->layout_interface;

@ -214,6 +214,7 @@ const char * const surface_property_commit_changes_test_names[] = {
const char * const render_order_test_names[] = { const char * const render_order_test_names[] = {
"layer_render_order", "layer_render_order",
"layer_bad_render_order", "layer_bad_render_order",
"layer_add_surfaces",
}; };
TEST_P(ivi_layout_runner, basic_test_names) TEST_P(ivi_layout_runner, basic_test_names)

Loading…
Cancel
Save