[PATCH 03/14] tests: test set for ivi-surface with bad condition in server side
Jon A. Cruz
jonc at osg.samsung.com
Wed Jun 24 10:01:24 PDT 2015
On 06/21/2015 11:33 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 for ivi-surface,
> - destination_rectangle with bad parameter
> - orientation with bad parameter
> - dimension with bad parameter
> - position with bad parameter
> - source_rectangle with bad parameter
> - properties with bad parameter
>
> 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 | 74 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 74 insertions(+)
>
> diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
> index 3fb5148..3b9d6b9 100644
> --- a/tests/ivi_layout-internal-test.c
> +++ b/tests/ivi_layout-internal-test.c
> @@ -76,6 +76,74 @@ test_surface_bad_visibility(struct test_context *ctx)
> iassert(visibility == false);
> }
>
> +static void
> +test_surface_bad_destination_rectangle(struct test_context *ctx)
> +{
> + const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> + iassert(ctl->surface_set_destination_rectangle(NULL, 20, 30, 200, 300) == IVI_FAILED);
> +}
> +
> +static void
> +test_surface_bad_orientation(struct test_context *ctx)
> +{
> + const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> + iassert(ctl->surface_set_orientation(NULL, WL_OUTPUT_TRANSFORM_90) == IVI_FAILED);
> +
> + iassert(ctl->surface_get_orientation(NULL) == WL_OUTPUT_TRANSFORM_NORMAL);
> +}
> +
> +static void
> +test_surface_bad_dimension(struct test_context *ctx)
> +{
> + const struct ivi_controller_interface *ctl = ctx->controller_interface;
> + struct ivi_layout_surface *ivisurf = NULL;
> + int32_t dest_width;
> + int32_t dest_height;
> +
> + iassert(ctl->surface_set_dimension(NULL, 200, 300) == IVI_FAILED);
> +
> + ctl->commit_changes();
> +
> + iassert(ctl->surface_get_dimension(NULL, &dest_width, &dest_height) == IVI_FAILED);
> + iassert(ctl->surface_get_dimension(ivisurf, NULL, &dest_height) == IVI_FAILED);
> + iassert(ctl->surface_get_dimension(ivisurf, &dest_width, NULL) == IVI_FAILED);
> +}
> +
> +static void
> +test_surface_bad_position(struct test_context *ctx)
> +{
> + const struct ivi_controller_interface *ctl = ctx->controller_interface;
> + struct ivi_layout_surface *ivisurf = NULL;
> + int32_t dest_x;
> + int32_t dest_y;
> +
> + iassert(ctl->surface_set_position(NULL, 20, 30) == IVI_FAILED);
> +
> + ctl->commit_changes();
> +
> + iassert(ctl->surface_get_position(NULL, &dest_x, &dest_y) == IVI_FAILED);
> + iassert(ctl->surface_get_position(ivisurf, NULL, &dest_y) == IVI_FAILED);
> + iassert(ctl->surface_get_position(ivisurf, &dest_x, NULL) == IVI_FAILED);
> +}
> +
> +static void
> +test_surface_bad_source_rectangle(struct test_context *ctx)
> +{
> + const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> + iassert(ctl->surface_set_source_rectangle(NULL, 20, 30, 200, 300) == IVI_FAILED);
> +}
> +
> +static void
> +test_surface_bad_properties(struct test_context *ctx)
> +{
> + const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> + iassert(ctl->get_properties_of_surface(NULL) == NULL);
> +}
> +
> /************************ tests end ********************************/
>
> static void
> @@ -84,6 +152,12 @@ run_internal_tests(void *data)
> struct test_context *ctx = data;
>
> test_surface_bad_visibility(ctx);
> + test_surface_bad_destination_rectangle(ctx);
> + test_surface_bad_orientation(ctx);
> + test_surface_bad_dimension(ctx);
> + test_surface_bad_position(ctx);
> + test_surface_bad_source_rectangle(ctx);
> + test_surface_bad_properties(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