ecore_wl2: add TC for ecore_wl2_subsurface_aux_hint_set 33/255633/3
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 22 Mar 2021 02:11:30 +0000 (11:11 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Mon, 22 Mar 2021 03:10:36 +0000 (12:10 +0900)
There is a requirement to flip subsurface which needs to set
axiliary hint on the subsurface.

Please refer to relevant patch of efl:
https://review.tizen.org/gerrit/#/c/platform/upstream/efl/+/255373/

Change-Id: I96f424569e8d5cba12f6047abd50d63e8a4a5b3f

TC/ecore/ecore_wl2/tslist
TC/ecore/ecore_wl2/tslist_fhub
TC/ecore/ecore_wl2/tslist_mobile
TC/ecore/ecore_wl2/tslist_tv
TC/ecore/ecore_wl2/tslist_wear
TC/ecore/ecore_wl2/utc_ecore_wl2_subsurface_aux_hint_set.c [new file with mode: 0644]

index 11b664694edca09fc2213ea8aac795dd932d431d..d5b1290d7b559411a79675f14f76ef731cac0d54 100644 (file)
@@ -48,3 +48,4 @@ utc_ecore_wl2_subsurface_place_surface_below.c
 utc_ecore_wl2_subsurface_sync_set.c
 utc_ecore_wl2_subsurface_video_surface_destination_set.c
 utc_ecore_wl2_subsurface_video_surface_prepare.c
+utc_ecore_wl2_subsurface_aux_hint_set.c
index b6693a66fa90414710abe37d4c990f42b4288d66..f450ad17b1fe6be8419de4cefc182540fd59c5b8 100644 (file)
@@ -48,3 +48,4 @@ utc_ecore_wl2_subsurface_place_surface_below.c
 utc_ecore_wl2_subsurface_sync_set.c
 utc_ecore_wl2_subsurface_video_surface_destination_set.c
 utc_ecore_wl2_subsurface_video_surface_prepare.c
+utc_ecore_wl2_subsurface_aux_hint_set.c
index 11b664694edca09fc2213ea8aac795dd932d431d..d5b1290d7b559411a79675f14f76ef731cac0d54 100644 (file)
@@ -48,3 +48,4 @@ utc_ecore_wl2_subsurface_place_surface_below.c
 utc_ecore_wl2_subsurface_sync_set.c
 utc_ecore_wl2_subsurface_video_surface_destination_set.c
 utc_ecore_wl2_subsurface_video_surface_prepare.c
+utc_ecore_wl2_subsurface_aux_hint_set.c
index 11b664694edca09fc2213ea8aac795dd932d431d..d5b1290d7b559411a79675f14f76ef731cac0d54 100644 (file)
@@ -48,3 +48,4 @@ utc_ecore_wl2_subsurface_place_surface_below.c
 utc_ecore_wl2_subsurface_sync_set.c
 utc_ecore_wl2_subsurface_video_surface_destination_set.c
 utc_ecore_wl2_subsurface_video_surface_prepare.c
+utc_ecore_wl2_subsurface_aux_hint_set.c
index 11b664694edca09fc2213ea8aac795dd932d431d..d5b1290d7b559411a79675f14f76ef731cac0d54 100644 (file)
@@ -48,3 +48,4 @@ utc_ecore_wl2_subsurface_place_surface_below.c
 utc_ecore_wl2_subsurface_sync_set.c
 utc_ecore_wl2_subsurface_video_surface_destination_set.c
 utc_ecore_wl2_subsurface_video_surface_prepare.c
+utc_ecore_wl2_subsurface_aux_hint_set.c
diff --git a/TC/ecore/ecore_wl2/utc_ecore_wl2_subsurface_aux_hint_set.c b/TC/ecore/ecore_wl2/utc_ecore_wl2_subsurface_aux_hint_set.c
new file mode 100644 (file)
index 0000000..7b23cf5
--- /dev/null
@@ -0,0 +1,147 @@
+#include <check.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <Ecore_Wl2.h>
+#include "utc_ecore_wl2_common.h"
+
+static Eina_Bool startup_status = EINA_FALSE;
+static Ecore_Timer *timer_exit = NULL;
+
+/**
+ * @addtogroup ecore_wl2
+ * @{
+ * @defgroup ecore_wl2_subsurface_aux_hint_set ecore_wl2_subsurface_aux_hint_set()
+ *
+ * @precondition
+ * @step 1 Initialize Ecore_Wl2 with ecore_wl2_init()
+ */
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   if (ecore_wl2_init())
+     {
+        startup_status = EINA_TRUE;
+     }
+}
+
+static void
+teardown(void)
+{
+   ecore_wl2_shutdown();
+   printf(" ============ Cleanup ============ \n");
+}
+
+static Eina_Bool _timer_cb(void *data)
+{
+   Ecore_Wl2_Subsurface *ss;
+   Ecore_Wl2_Display *ewd = NULL;
+   //Connect the display.
+   ewd  = ecore_wl2_display_connect(NULL);
+   if (!ewd)
+     {
+        ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+        goto quit_main_loop;
+     }
+
+   if (CHECK_TV_PROFILE()) ecore_wl2_display_sync(ewd);
+
+   Ecore_Wl2_Window *win = NULL;
+   win = ecore_wl2_window_new(ewd, NULL, 0, 0, 1, 1);
+   if (!win)
+     {
+        ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+        goto quit_main_loop;
+     }
+
+   ss = ecore_wl2_subsurface_new(win);
+   if (!ss)
+     {
+        ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+        goto quit_main_loop;
+     }
+
+   ecore_wl2_subsurface_aux_hint_set(ss, "wm.video.flip.mode", "1");
+
+   /* try to set with same aux hint */
+   ecore_wl2_subsurface_aux_hint_set(ss, "wm.video.flip.mode", "1");
+
+quit_main_loop:
+   ecore_main_loop_quit();
+
+   return ECORE_CALLBACK_DONE;
+}
+
+/**
+ * @addtogroup ecore_wl2_subsurface_aux_hint_set
+ * @{
+ * @objective Positive test case checks that the tested function calling without any errors.
+ * @n Input Data: none.
+ *
+ * @procedure
+ * @step 1 Call tested function.
+ *
+ * @passcondition
+ * There is no segmentation fault.
+ * @}
+ */
+START_TEST(utc_ecore_wl2_subsurface_aux_hint_set_p)
+{
+   if (startup_status != EINA_TRUE)
+     {
+        ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (startup was been executed unsuccessfully)..", __FILE__, __LINE__);
+        return;
+     }
+
+   timer_exit = ecore_timer_add(0.2, _timer_cb, NULL);
+   if (!timer_exit)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+
+   ecore_main_loop_begin();
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup ecore_wl2_subsurface_aux_hint_set
+ * @{
+ * @objective Negative test case checks if function call with invalid value works without segmentation fault
+ * @n Input Data: none.
+ *
+ * @procedure
+ * @step 1 Call ecore_wl2_subsurface_aux_hint_set with invalid value instead of the Ecore_Wl2_Subsurface object
+ *
+ * @passcondition
+ * There is no segmentation fault.
+ * @}
+ */
+START_TEST(utc_ecore_wl2_subsurface_aux_hint_set_n)
+{
+   if (startup_status != EINA_TRUE)
+     {
+        ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (startup was been executed unsuccessfully)..", __FILE__, __LINE__);
+        return;
+     }
+
+   ecore_wl2_subsurface_aux_hint_set(NULL, NULL, NULL);
+
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ *@}
+ */
+
+TCase * _utc_ecore_wl2_subsurface_aux_hint_set()
+{
+   TCase *tcase = tcase_create("utc_ecore_wl2_subsurface_aux_hint_set");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_ecore_wl2_subsurface_aux_hint_set_p);
+   tcase_add_test(tcase, utc_ecore_wl2_subsurface_aux_hint_set_n);
+   return tcase;
+}