tests: test set for ivi-surface bad condition with helper client

These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- ivi_layout_runner with basic_test_names[]
 - surface with bad opacity
- destroy ivi/wl_surface and call get_surface
- commit_changes_after_properties_set_surface_destroy with
  surface_property_commit_changes_test_names[]
 - call set_visibility, destroy ivi-surface, and commit_changes
 - call set_opacity, destroy ivi-surface, and commit_changes
 - call set_orientation, destroy ivi-surface, and commit_changes
 - call set_dimension, destroy ivi-surface, and commit_changes
 - call set_position, destroy ivi-surface, and commit_changes
 - call set_source_rectangle, destroy ivi-surface, and commit_changes
 - call set_destination_rectangle, destroy ivi-surface, and
  commit_changes

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c
index 1d0ce02..fd57d06 100644
--- a/tests/ivi_layout-test-plugin.c
+++ b/tests/ivi_layout-test-plugin.c
@@ -563,3 +563,137 @@
 	runner_assert(prop->source_x == 20);
 	runner_assert(prop->source_y == 30);
 }
+
+RUNNER_TEST(surface_bad_opacity)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+	struct ivi_layout_surface *ivisurf;
+	wl_fixed_t opacity;
+
+	ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+	runner_assert(ivisurf != NULL);
+
+	runner_assert(ctl->surface_set_opacity(
+		      NULL, wl_fixed_from_double(0.3)) == IVI_FAILED);
+
+	runner_assert(ctl->surface_set_opacity(
+		      ivisurf, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED);
+
+	runner_assert(ctl->surface_set_opacity(
+		      ivisurf, wl_fixed_from_double(-1)) == IVI_FAILED);
+
+	ctl->commit_changes();
+
+	opacity = ctl->surface_get_opacity(ivisurf);
+	runner_assert(opacity == wl_fixed_from_double(0.3));
+
+	runner_assert(ctl->surface_set_opacity(
+		      ivisurf, wl_fixed_from_double(1.1)) == IVI_FAILED);
+
+	ctl->commit_changes();
+
+	opacity = ctl->surface_get_opacity(ivisurf);
+	runner_assert(opacity == wl_fixed_from_double(0.3));
+
+	runner_assert(ctl->surface_set_opacity(
+		      NULL, wl_fixed_from_double(0.5)) == IVI_FAILED);
+
+	ctl->commit_changes();
+
+	opacity = ctl->surface_get_opacity(NULL);
+	runner_assert(opacity == wl_fixed_from_double(0.0));
+}
+
+RUNNER_TEST(ivi_layout_commit_changes)
+{
+	const struct ivi_controller_interface *ctl = ctx->controller_interface;
+
+	ctl->commit_changes();
+}
+
+RUNNER_TEST(commit_changes_after_visibility_set_surface_destroy)
+{
+	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_set_visibility(
+		      ivisurf, true) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_opacity_set_surface_destroy)
+{
+	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_set_opacity(
+		      ivisurf, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_orientation_set_surface_destroy)
+{
+	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_set_orientation(
+		      ivisurf, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_dimension_set_surface_destroy)
+{
+	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_set_dimension(
+		      ivisurf, 200, 300) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_position_set_surface_destroy)
+{
+	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_set_position(
+		      ivisurf, 20, 30) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_source_rectangle_set_surface_destroy)
+{
+	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_set_source_rectangle(
+		      ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_destination_rectangle_set_surface_destroy)
+{
+	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_set_destination_rectangle(
+		      ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(get_surface_after_destroy_surface)
+{
+	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);
+}
+