utc_elm_plug_xxxx: Merge TCs to reduce duplicate test operations 81/189181/2
authorApurv Khatri <apurv.khatri@samsung.com>
Fri, 14 Sep 2018 05:21:44 +0000 (10:51 +0530)
committerHermet Park <chuneon.park@samsung.com>
Fri, 21 Sep 2018 07:37:36 +0000 (07:37 +0000)
Change-Id: Id61e0e4b13f21b979d63f9b50395a31d5d4e3a72

TC/elementary/plug/tslist
TC/elementary/plug/tslist_mobile
TC/elementary/plug/tslist_tv
TC/elementary/plug/tslist_wear
TC/elementary/plug/utc_elm_plug_add.c [deleted file]
TC/elementary/plug/utc_elm_plug_connect.c

index 9cca1e66b4c72d5294ea0a620ed2b122972d54ec..79d8c969129d590eb3572738caeec3f0e80ab060 100644 (file)
@@ -1,3 +1,2 @@
-utc_elm_plug_add.c
 utc_elm_plug_connect.c
 utc_elm_plug_image_object_get.c
index 9cca1e66b4c72d5294ea0a620ed2b122972d54ec..79d8c969129d590eb3572738caeec3f0e80ab060 100644 (file)
@@ -1,3 +1,2 @@
-utc_elm_plug_add.c
 utc_elm_plug_connect.c
 utc_elm_plug_image_object_get.c
index 9cca1e66b4c72d5294ea0a620ed2b122972d54ec..79d8c969129d590eb3572738caeec3f0e80ab060 100644 (file)
@@ -1,3 +1,2 @@
-utc_elm_plug_add.c
 utc_elm_plug_connect.c
 utc_elm_plug_image_object_get.c
index 9cca1e66b4c72d5294ea0a620ed2b122972d54ec..79d8c969129d590eb3572738caeec3f0e80ab060 100644 (file)
@@ -1,3 +1,2 @@
-utc_elm_plug_add.c
 utc_elm_plug_connect.c
 utc_elm_plug_image_object_get.c
diff --git a/TC/elementary/plug/utc_elm_plug_add.c b/TC/elementary/plug/utc_elm_plug_add.c
deleted file mode 100644 (file)
index 362f485..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#include <check.h>
-#include <Elementary.h>
-#include "../utc_elm_common.h"
-#include "../../utc_negative_unitest.h"
-static Evas_Object *main_win = NULL;
-
-/**
- * @addtogroup elm_plug
- * @{
- * @defgroup elm_plug_add elm_plug_add()
- *
- * @precondition
- * @step 1 Initialize Elementary
- * @step 2 Create and show main window
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   UTC_ELM_INIT();
-   main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
-   if (main_win == NULL)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a main window..", __FILE__, __LINE__);
-        return;
-     }
-   evas_object_show(main_win);
-}
-
-static void
-teardown(void)
-{
-   if (main_win != NULL)
-     {
-        evas_object_del(main_win);
-        main_win = NULL;
-     }
-   elm_shutdown();
-   printf(" ============ Cleanup ============ \n");
-}
-
-/**
- * @addtogroup elm_plug_add
- * @{
- * @objective Positive Test case 01 check if create a new plug widget
- * works properly and doesn't cause segmentation fault
- * @n Input Data: the parent window object
- *
- * @procedure
- * @step 1 Create a new plug widget
- *
- * @passcondition Returned value is not NULL and there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_plug_add_p_01)
-{
-   Evas_Object *plug = NULL;
-
-   if (main_win == NULL)
-     {
-        return;
-     }
-   plug = elm_plug_add(main_win);
-   if (plug == NULL)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup elm_plug_add
- * @{
- * @objective Negative Test case 01 checks if call test function with NULL instead of the parent object
- * works properly and doesn't cause segmentation fault
- * @n Input Data: NULL instead of the parent object
- *
- * @procedure
- * @step 1 Call test function with NULL instead of the parent object
- *
- * @passcondition Returned value is NULL and there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_plug_add_n_01)
-{
-   if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_plug_add, main_win))
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- *@}
- */
-
-TCase * _utc_elm_plug_add()
-{
-   TCase *tcase = tcase_create("utc_elm_plug_add");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_elm_plug_add_p_01);
-   tcase_add_test(tcase, utc_elm_plug_add_n_01);
-   return tcase;
-}
index 4457aa08a2b38627742d9d532c02cd106163b3e8..258b3430fe21bc1eb2ed772aa1c71df6719a8eb9 100644 (file)
@@ -22,7 +22,6 @@ setup(void)
    if (main_win == NULL)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a main window..", __FILE__, __LINE__);
-        return;
      }
    evas_object_show(main_win);
 }
@@ -60,20 +59,14 @@ START_TEST(utc_elm_plug_connect_p_01)
 {
    Evas_Object *plug = NULL;
 
-   if (main_win == NULL)
-     {
-        return;
-     }
    plug = elm_plug_add(main_win);
    if (plug == NULL)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        return;
      }
    if (elm_plug_connect(plug, "elm_indicator_portrait", 0, EINA_TRUE) != EINA_TRUE)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        return;
      }
    printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
 }
@@ -102,12 +95,34 @@ START_TEST(utc_elm_plug_connect_n_01)
    if (elm_plug_connect(NULL, NULL, 0, EINA_FALSE) != EINA_FALSE)
      {
         ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        return;
      }
    printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__,__LINE__);
 }
 END_TEST
 
+/**
+ * @addtogroup elm_plug_add
+ * @{
+ * @objective Negative Test case 01 checks if call test function with NULL instead of the parent object
+ * works properly and doesn't cause segmentation fault
+ * @n Input Data: NULL instead of the parent object
+ *
+ * @procedure
+ * @step 1 Call test function with NULL instead of the parent object
+ *
+ * @passcondition Returned value is NULL and there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_plug_add_n_01)
+{
+   if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_plug_add, main_win))
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
 /**
  *@}
  */
@@ -119,5 +134,6 @@ TCase * _utc_elm_plug_connect()
    tcase_add_checked_fixture(tcase, setup, teardown);
    tcase_add_test(tcase, utc_elm_plug_connect_p_01);
    tcase_add_test(tcase, utc_elm_plug_connect_n_01);
+   tcase_add_test(tcase, utc_elm_plug_add_n_01);
    return tcase;
 }