[13/14] tests: test set for ivi-shell notification in bad condition with helper client

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

Details

Message ID 1434954981-27647-1-git-send-email-nobuhiko_tanibata@xddp.denso.co.jp
State Accepted
Commit 0af22d4d7752599c9559bc09e2a42c7d663ae496
Headers show

Not browsing as part of any series.

Commit Message

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

These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- add notfication of ivi-surface with bad condition

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

Patch hide | download patch | download mbox

diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c
index 28afac9..5ac0135 100644
--- a/tests/ivi_layout-test-plugin.c
+++ b/tests/ivi_layout-test-plugin.c
@@ -1049,3 +1049,25 @@  RUNNER_TEST(surface_remove_notification_p3)
 {
 	runner_assert(ctx->user_flags == 0);
 }
+
+static void
+test_surface_bad_properties_changed_notification_callback(struct ivi_layout_surface *ivisurf,
+							  const struct ivi_layout_surface_properties *prop,
+							  enum ivi_layout_notification_mask mask,
+							  void *userdata)
+{
+}
+
+RUNNER_TEST(surface_bad_properties_changed_notification)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+	struct ivi_layout_surface *ivisurf;
+
+	ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+	runner_assert(ivisurf != NULL);
+
+	runner_assert(ctl->surface_add_notification(
+		      NULL, test_surface_bad_properties_changed_notification_callback, NULL) == IVI_FAILED);
+	runner_assert(ctl->surface_add_notification(
+		      ivisurf, NULL, NULL) == IVI_FAILED);
+}
diff --git a/tests/ivi_layout-test.c b/tests/ivi_layout-test.c
index 7091c9f..6c739da 100644
--- a/tests/ivi_layout-test.c
+++ b/tests/ivi_layout-test.c
@@ -197,6 +197,7 @@  const char * const basic_test_names[] = {
 	"surface_source_rectangle",
 	"surface_bad_opacity",
 	"surface_properties_changed_notification",
+	"surface_bad_properties_changed_notification",
 };
 
 const char * const surface_property_commit_changes_test_names[] = {

Comments

On 06/21/2015 11:36 PM, Nobuhiko Tanibata wrote:
> From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
> 
> These tests are implemented on test suite framework, which provides
> helper client.
> Following features are tested,
> - add notfication of ivi-surface with bad condition
> 
> 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-test-plugin.c | 22 ++++++++++++++++++++++
>  tests/ivi_layout-test.c        |  1 +
>  2 files changed, 23 insertions(+)
> 
> diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c
> index 28afac9..5ac0135 100644
> --- a/tests/ivi_layout-test-plugin.c
> +++ b/tests/ivi_layout-test-plugin.c
> @@ -1049,3 +1049,25 @@ RUNNER_TEST(surface_remove_notification_p3)
>  {
>  	runner_assert(ctx->user_flags == 0);
>  }
> +
> +static void
> +test_surface_bad_properties_changed_notification_callback(struct ivi_layout_surface *ivisurf,
> +							  const struct ivi_layout_surface_properties *prop,
> +							  enum ivi_layout_notification_mask mask,
> +							  void *userdata)
> +{
> +}
> +
> +RUNNER_TEST(surface_bad_properties_changed_notification)
> +{
> +	const struct ivi_controller_interface *ctl = ctx->controller_interface;
> +	struct ivi_layout_surface *ivisurf;
> +
> +	ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
> +	runner_assert(ivisurf != NULL);
> +
> +	runner_assert(ctl->surface_add_notification(
> +		      NULL, test_surface_bad_properties_changed_notification_callback, NULL) == IVI_FAILED);
> +	runner_assert(ctl->surface_add_notification(
> +		      ivisurf, NULL, NULL) == IVI_FAILED);
> +}
> diff --git a/tests/ivi_layout-test.c b/tests/ivi_layout-test.c
> index 7091c9f..6c739da 100644
> --- a/tests/ivi_layout-test.c
> +++ b/tests/ivi_layout-test.c
> @@ -197,6 +197,7 @@ const char * const basic_test_names[] = {
>  	"surface_source_rectangle",
>  	"surface_bad_opacity",
>  	"surface_properties_changed_notification",
> +	"surface_bad_properties_changed_notification",
>  };
>  
>  const char * const surface_property_commit_changes_test_names[] = {
>