[PATCH 09/14] tests: test set for ivi-screen with bad condition in server side

Jon A. Cruz jonc at osg.samsung.com
Wed Jun 24 10:02:46 PDT 2015


On 06/21/2015 11:35 PM, Nobuhiko Tanibata wrote:
> From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>
> 
> 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 at xddp.denso.co.jp>
> Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Looks good.

Reviewed-by: Jon A. Cruz <jonc at osg.samsung.com>

> ---
>  tests/ivi_layout-internal-test.c | 102 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 102 insertions(+)
> 
> diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
> index 3e3ba7f..b82e9cb 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);
> 

-- 
Jon A. Cruz - Senior Open Source Developer
Samsung Open Source Group
jonc at osg.samsung.com


More information about the wayland-devel mailing list