[14/14] tests: test set for ivi-shell notification with bad condition in server side

Submitted by Nobuhiko Tanibata on June 22, 2015, 6:37 a.m.

Details

Message ID 1434955061-27689-1-git-send-email-nobuhiko_tanibata@xddp.denso.co.jp
State Accepted
Commit ffcc45276785dcb5aaad6febf7331fde2cbcda78
Headers show

Not browsing as part of any series.

Commit Message

Nobuhiko Tanibata June 22, 2015, 6:37 a.m.
From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>

These tests are implemented on test suite framework, which provides
internal method validation,
Following features are tested,
- add notification of ivi-layer with bad parameter
- add notification of ivi-surface configure with bad parameter
- add notification of creating ivi-layer with bad parameter
- add notification of creating ivi-surface with bad parameter
- add notification of removing ivi-layer with bad parameter
- add notification of removing ivi-surface with bad parameter

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
---
 tests/ivi_layout-internal-test.c | 69 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
index d13c915..bb9cce9 100644
--- a/tests/ivi_layout-internal-test.c
+++ b/tests/ivi_layout-internal-test.c
@@ -1047,6 +1047,69 @@  test_layer_remove_notification(struct test_context *ctx)
 #undef LAYER_NUM
 }
 
+static void
+test_layer_bad_properties_changed_notification_callback(struct ivi_layout_layer *ivilayer,
+							const struct ivi_layout_layer_properties *prop,
+							enum ivi_layout_notification_mask mask,
+							void *userdata)
+{
+}
+
+static void
+test_layer_bad_properties_changed_notification(struct test_context *ctx)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+	struct ivi_layout_layer *ivilayer;
+
+	ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
+
+	iassert(ctl->layer_add_notification(
+		    NULL, test_layer_bad_properties_changed_notification_callback, NULL) == IVI_FAILED);
+	iassert(ctl->layer_add_notification(ivilayer, NULL, NULL) == IVI_FAILED);
+
+	ctl->layer_destroy(ivilayer);
+}
+
+static void
+test_surface_bad_configure_notification(struct test_context *ctx)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+
+	iassert(ctl->add_notification_configure_surface(NULL, NULL) == IVI_FAILED);
+}
+
+static void
+test_layer_bad_create_notification(struct test_context *ctx)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+
+	iassert(ctl->add_notification_create_layer(NULL, NULL) == IVI_FAILED);
+}
+
+static void
+test_surface_bad_create_notification(struct test_context *ctx)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+
+	iassert(ctl->add_notification_create_surface(NULL, NULL) == IVI_FAILED);
+}
+
+static void
+test_layer_bad_remove_notification(struct test_context *ctx)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+
+	iassert(ctl->add_notification_remove_layer(NULL, NULL) == IVI_FAILED);
+}
+
+static void
+test_surface_bad_remove_notification(struct test_context *ctx)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+
+	iassert(ctl->add_notification_remove_surface(NULL, NULL) == IVI_FAILED);
+}
+
 /************************ tests end ********************************/
 
 static void
@@ -1099,6 +1162,12 @@  run_internal_tests(void *data)
 	test_layer_properties_changed_notification(ctx);
 	test_layer_create_notification(ctx);
 	test_layer_remove_notification(ctx);
+	test_layer_bad_properties_changed_notification(ctx);
+	test_surface_bad_configure_notification(ctx);
+	test_layer_bad_create_notification(ctx);
+	test_surface_bad_create_notification(ctx);
+	test_layer_bad_remove_notification(ctx);
+	test_surface_bad_remove_notification(ctx);
 
 	weston_compositor_exit_with_code(ctx->compositor, EXIT_SUCCESS);
 	free(ctx);

Comments

On 06/21/2015 11:37 PM, Nobuhiko Tanibata wrote:
> From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
> 
> These tests are implemented on test suite framework, which provides
> internal method validation,
> Following features are tested,
> - add notification of ivi-layer with bad parameter
> - add notification of ivi-surface configure with bad parameter
> - add notification of creating ivi-layer with bad parameter
> - add notification of creating ivi-surface with bad parameter
> - add notification of removing ivi-layer with bad parameter
> - add notification of removing ivi-surface with bad parameter
> 
> Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

Looks good.

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

> ---
>  tests/ivi_layout-internal-test.c | 69 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 69 insertions(+)
> 
> diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
> index d13c915..bb9cce9 100644
> --- a/tests/ivi_layout-internal-test.c
> +++ b/tests/ivi_layout-internal-test.c
> @@ -1047,6 +1047,69 @@ test_layer_remove_notification(struct test_context *ctx)
>  #undef LAYER_NUM
>  }
>  
> +static void
> +test_layer_bad_properties_changed_notification_callback(struct ivi_layout_layer *ivilayer,
> +							const struct ivi_layout_layer_properties *prop,
> +							enum ivi_layout_notification_mask mask,
> +							void *userdata)
> +{
> +}
> +
> +static void
> +test_layer_bad_properties_changed_notification(struct test_context *ctx)
> +{
> +	const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +	struct ivi_layout_layer *ivilayer;
> +
> +	ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
> +
> +	iassert(ctl->layer_add_notification(
> +		    NULL, test_layer_bad_properties_changed_notification_callback, NULL) == IVI_FAILED);
> +	iassert(ctl->layer_add_notification(ivilayer, NULL, NULL) == IVI_FAILED);
> +
> +	ctl->layer_destroy(ivilayer);
> +}
> +
> +static void
> +test_surface_bad_configure_notification(struct test_context *ctx)
> +{
> +	const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> +	iassert(ctl->add_notification_configure_surface(NULL, NULL) == IVI_FAILED);
> +}
> +
> +static void
> +test_layer_bad_create_notification(struct test_context *ctx)
> +{
> +	const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> +	iassert(ctl->add_notification_create_layer(NULL, NULL) == IVI_FAILED);
> +}
> +
> +static void
> +test_surface_bad_create_notification(struct test_context *ctx)
> +{
> +	const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> +	iassert(ctl->add_notification_create_surface(NULL, NULL) == IVI_FAILED);
> +}
> +
> +static void
> +test_layer_bad_remove_notification(struct test_context *ctx)
> +{
> +	const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> +	iassert(ctl->add_notification_remove_layer(NULL, NULL) == IVI_FAILED);
> +}
> +
> +static void
> +test_surface_bad_remove_notification(struct test_context *ctx)
> +{
> +	const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +
> +	iassert(ctl->add_notification_remove_surface(NULL, NULL) == IVI_FAILED);
> +}
> +
>  /************************ tests end ********************************/
>  
>  static void
> @@ -1099,6 +1162,12 @@ run_internal_tests(void *data)
>  	test_layer_properties_changed_notification(ctx);
>  	test_layer_create_notification(ctx);
>  	test_layer_remove_notification(ctx);
> +	test_layer_bad_properties_changed_notification(ctx);
> +	test_surface_bad_configure_notification(ctx);
> +	test_layer_bad_create_notification(ctx);
> +	test_surface_bad_create_notification(ctx);
> +	test_layer_bad_remove_notification(ctx);
> +	test_surface_bad_remove_notification(ctx);
>  
>  	weston_compositor_exit_with_code(ctx->compositor, EXIT_SUCCESS);
>  	free(ctx);
>
Hi Jon,

Thank you for your effort to review them!

Best regards,
Nobuhiko Tanibata

> -----Original Message-----

> From: wayland-devel

> [mailto:wayland-devel-bounces@lists.freedesktop.org] On Behalf Of Jon

> A. Cruz

> Sent: Thursday, June 25, 2015 2:05 AM

> To: Nobuhiko Tanibata; wayland-devel@lists.freedesktop.org

> Cc: securitycheck@denso.co.jp

> Subject: Re: [PATCH 14/14] tests: test set for ivi-shell notification

> with bad condition in server side

> 

> On 06/21/2015 11:37 PM, Nobuhiko Tanibata wrote:

> > From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>

> >

> > These tests are implemented on test suite framework, which provides

> > internal method validation, Following features are tested,

> > - add notification of ivi-layer with bad parameter

> > - add notification of ivi-surface configure with bad parameter

> > - add notification of creating ivi-layer with bad parameter

> > - add notification of creating ivi-surface with bad parameter

> > - add notification of removing ivi-layer with bad parameter

> > - add notification of removing ivi-surface with bad parameter

> >

> > Signed-off-by: Nobuhiko Tanibata

> <NOBUHIKO_TANIBATA@xddp.denso.co.jp>

> > Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

> 

> Looks good.

> 

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

> 

> > ---

> >  tests/ivi_layout-internal-test.c | 69

> > ++++++++++++++++++++++++++++++++++++++++

> >  1 file changed, 69 insertions(+)

> >

> > diff --git a/tests/ivi_layout-internal-test.c

> > b/tests/ivi_layout-internal-test.c

> > index d13c915..bb9cce9 100644

> > --- a/tests/ivi_layout-internal-test.c

> > +++ b/tests/ivi_layout-internal-test.c

> > @@ -1047,6 +1047,69 @@ test_layer_remove_notification(struct

> > test_context *ctx)  #undef LAYER_NUM  }

> >

> > +static void

> > +test_layer_bad_properties_changed_notification_callback(struct

> ivi_layout_layer *ivilayer,

> > +							const struct

> ivi_layout_layer_properties *prop,

> > +							enum

> ivi_layout_notification_mask mask,

> > +							void

> *userdata)

> > +{

> > +}

> > +

> > +static void

> > +test_layer_bad_properties_changed_notification(struct test_context

> > +*ctx) {

> > +	const struct ivi_controller_interface *ctl =

> ctx->controller_interface;

> > +	struct ivi_layout_layer *ivilayer;

> > +

> > +	ivilayer =

> ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0),

> > +200, 300);

> > +

> > +	iassert(ctl->layer_add_notification(

> > +		    NULL,

> test_layer_bad_properties_changed_notification_callback, NULL) ==

> IVI_FAILED);

> > +	iassert(ctl->layer_add_notification(ivilayer, NULL, NULL) ==

> > +IVI_FAILED);

> > +

> > +	ctl->layer_destroy(ivilayer);

> > +}

> > +

> > +static void

> > +test_surface_bad_configure_notification(struct test_context *ctx) {

> > +	const struct ivi_controller_interface *ctl =

> > +ctx->controller_interface;

> > +

> > +	iassert(ctl->add_notification_configure_surface(NULL, NULL)

> ==

> > +IVI_FAILED); }

> > +

> > +static void

> > +test_layer_bad_create_notification(struct test_context *ctx) {

> > +	const struct ivi_controller_interface *ctl =

> > +ctx->controller_interface;

> > +

> > +	iassert(ctl->add_notification_create_layer(NULL, NULL) ==

> > +IVI_FAILED); }

> > +

> > +static void

> > +test_surface_bad_create_notification(struct test_context *ctx) {

> > +	const struct ivi_controller_interface *ctl =

> > +ctx->controller_interface;

> > +

> > +	iassert(ctl->add_notification_create_surface(NULL, NULL) ==

> > +IVI_FAILED); }

> > +

> > +static void

> > +test_layer_bad_remove_notification(struct test_context *ctx) {

> > +	const struct ivi_controller_interface *ctl =

> > +ctx->controller_interface;

> > +

> > +	iassert(ctl->add_notification_remove_layer(NULL, NULL) ==

> > +IVI_FAILED); }

> > +

> > +static void

> > +test_surface_bad_remove_notification(struct test_context *ctx) {

> > +	const struct ivi_controller_interface *ctl =

> > +ctx->controller_interface;

> > +

> > +	iassert(ctl->add_notification_remove_surface(NULL, NULL) ==

> > +IVI_FAILED); }

> > +

> >  /************************ tests end

> ********************************/

> >

> >  static void

> > @@ -1099,6 +1162,12 @@ run_internal_tests(void *data)

> >  	test_layer_properties_changed_notification(ctx);

> >  	test_layer_create_notification(ctx);

> >  	test_layer_remove_notification(ctx);

> > +	test_layer_bad_properties_changed_notification(ctx);

> > +	test_surface_bad_configure_notification(ctx);

> > +	test_layer_bad_create_notification(ctx);

> > +	test_surface_bad_create_notification(ctx);

> > +	test_layer_bad_remove_notification(ctx);

> > +	test_surface_bad_remove_notification(ctx);

> >

> >  	weston_compositor_exit_with_code(ctx->compositor,

> EXIT_SUCCESS);

> >  	free(ctx);

> >

> 

> --

> Jon A. Cruz - Senior Open Source Developer Samsung Open Source Group

> jonc@osg.samsung.com _______________________________________________

> wayland-devel mailing list

> wayland-devel@lists.freedesktop.org

> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
On Wed, 24 Jun 2015 23:26:38 +0000
"Tanibata, Nobuhiko (ADITJ/SWG)" <ntanibata@jp.adit-jv.com> wrote:

> Hi Jon,
> 
> Thank you for your effort to review them!
> 
> Best regards,
> Nobuhiko Tanibata
> 
> > -----Original Message-----
> > From: wayland-devel
> > [mailto:wayland-devel-bounces@lists.freedesktop.org] On Behalf Of Jon
> > A. Cruz
> > Sent: Thursday, June 25, 2015 2:05 AM
> > To: Nobuhiko Tanibata; wayland-devel@lists.freedesktop.org
> > Cc: securitycheck@denso.co.jp
> > Subject: Re: [PATCH 14/14] tests: test set for ivi-shell notification
> > with bad condition in server side
> > 
> > On 06/21/2015 11:37 PM, Nobuhiko Tanibata wrote:
> > > From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
> > >
> > > These tests are implemented on test suite framework, which provides
> > > internal method validation, Following features are tested,
> > > - add notification of ivi-layer with bad parameter
> > > - add notification of ivi-surface configure with bad parameter
> > > - add notification of creating ivi-layer with bad parameter
> > > - add notification of creating ivi-surface with bad parameter
> > > - add notification of removing ivi-layer with bad parameter
> > > - add notification of removing ivi-surface with bad parameter
> > >
> > > Signed-off-by: Nobuhiko Tanibata
> > <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
> > > Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
> > 
> > Looks good.
> > 
> > Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>

Hi,

thanks Jon.

These 14 patches are pushed:
   3aa8aed..ffcc452  master -> master


Thanks,
pq