utc_evas_object_data_xxxx: Merge TCs to reduce duplicate test operations 21/190521/2
authorApurv Khatri <apurv.khatri@samsung.com>
Wed, 3 Oct 2018 08:54:50 +0000 (14:24 +0530)
committerHermet Park <chuneon.park@samsung.com>
Fri, 12 Oct 2018 07:26:45 +0000 (07:26 +0000)
Change-Id: If593cfe583fc1b262e3f03d21a81039fdc9fd160

TC/evas/canvas/evas_object_data/tslist
TC/evas/canvas/evas_object_data/tslist_mobile
TC/evas/canvas/evas_object_data/tslist_tv
TC/evas/canvas/evas_object_data/tslist_wear
TC/evas/canvas/evas_object_data/utc_evas_object_data_get.c [deleted file]
TC/evas/canvas/evas_object_data/utc_evas_object_data_get_set.c [new file with mode: 0644]
TC/evas/canvas/evas_object_data/utc_evas_object_data_set.c [deleted file]

index c042766aa06ee55137444c4804fbd4765e09cd32..423892e1d78b339021669374295f6926408c5408 100644 (file)
@@ -1,3 +1,2 @@
-utc_evas_object_data_set.c
-utc_evas_object_data_get.c
+utc_evas_object_data_get_set.c
 utc_evas_object_data_del.c
index c042766aa06ee55137444c4804fbd4765e09cd32..423892e1d78b339021669374295f6926408c5408 100644 (file)
@@ -1,3 +1,2 @@
-utc_evas_object_data_set.c
-utc_evas_object_data_get.c
+utc_evas_object_data_get_set.c
 utc_evas_object_data_del.c
index c042766aa06ee55137444c4804fbd4765e09cd32..423892e1d78b339021669374295f6926408c5408 100644 (file)
@@ -1,3 +1,2 @@
-utc_evas_object_data_set.c
-utc_evas_object_data_get.c
+utc_evas_object_data_get_set.c
 utc_evas_object_data_del.c
index c042766aa06ee55137444c4804fbd4765e09cd32..423892e1d78b339021669374295f6926408c5408 100644 (file)
@@ -1,3 +1,2 @@
-utc_evas_object_data_set.c
-utc_evas_object_data_get.c
+utc_evas_object_data_get_set.c
 utc_evas_object_data_del.c
diff --git a/TC/evas/canvas/evas_object_data/utc_evas_object_data_get.c b/TC/evas/canvas/evas_object_data/utc_evas_object_data_get.c
deleted file mode 100644 (file)
index 581455b..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-#include <check.h>
-#include <Evas.h>
-#include "../../../utc_negative_unitest.h"
-
-#define KEY "test_data"
-
-/**
- * @addtogroup evas_object_data
- * @{
- * @defgroup evas_object_data_get evas_object_data_get()
- *
- *
- * @precondition
- * @step 1 evas initialized with evas_init()
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   evas_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   evas_shutdown();
-}
-
-/**
- * @addtogroup evas_object_data_get
- * @{
- * @objective Positive test case checks if function set and get data properly.
- * @n Input Data:
- * @li Pointer to text Evas_Object;
- * @li "test_data" - data key.
- *
- * @procedure
- * @step 1 Create new Evas and Evas_Object
- * @step 2 Set data for the object
- * @step 3 Get data from the object and compare it with the initial one.
- *
- * @passcondition Function returns pointer the same as was set with evas_object_data_set().
- * @}
- */
-START_TEST(utc_evas_object_data_get_p)
-{
-   Evas *evas = evas_new();
-   Evas_Object *obj = evas_object_text_add(evas);
-
-   if (!obj)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
-        evas_free(evas);
-        return;
-     }
-   const int my_data = 42;
-   int result = TEST_FAIL;
-
-   evas_object_data_set(obj, KEY, &my_data);
-   int *data_ptr = (int*)evas_object_data_get(obj, KEY);
-
-   if (!data_ptr)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
-     }
-   else if (data_ptr != &my_data)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Returned and initial pointers don't match..", __FILE__, __LINE__);
-     }
-   else
-     {
-        printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-        result = TEST_PASS;
-     }
-   evas_free(evas);
-}
-END_TEST
-
-/**
- * @addtogroup evas_object_data_get
- * @{
- * @objective Negative test case 1 checks if function works properly if it is called
- * when getting data from evas object without data.
- * @n Input Data:
- * @li Pointer to text Evas_Object without data;
- * @li "test_data" - data key.
- *
- * @procedure
- * @step 1 Create new Evas and Evas_Object
- * @step 2 Try get data from it
- * @step 3 Check if the data is NULL
- *
- * @passcondition Function returns NULL.
- * @}
- */
-START_TEST(utc_evas_object_data_get_n)
-{
-   Evas *evas = evas_new();
-   Evas_Object *obj = evas_object_text_add(evas);
-
-   if (!obj)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
-        evas_free(evas);
-        return;
-     }
-
-   if (evas_object_data_get(obj, KEY))
-     {
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        return;
-     }
-   evas_free(evas);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup evas_object_data_get
- * @{
- * @objective Negative test case 2 checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of any argument.
- * @n Input Data: pointer to Evas_Object and "test_data" as key.
- *
- * @procedure
- * @step 1 Create new Evas
- * @step 2 Create new text Evas_Object
- * @step 3 Call function 2 times and pass (in turn) NULL instead of one from valid arguments.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_evas_object_data_get_n2)
-{
-   Evas *evas = evas_new();
-   Evas_Object *obj = evas_object_text_add(evas);
-
-   if (!obj)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
-        evas_free(evas);
-        return;
-     }
-
-   if (UNITEST_FUNC_NEG_RET(NULL, evas_object_data_get, obj, KEY) == TEST_FAIL)
-     {
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-        return;
-     }
-   evas_free(evas);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-/**
- *@}
- */
-
-TCase * _utc_evas_object_data_get()
-{
-   TCase *tcase = tcase_create("utc_evas_object_data_get");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_evas_object_data_get_p);
-   tcase_add_test(tcase, utc_evas_object_data_get_n);
-   tcase_add_test(tcase, utc_evas_object_data_get_n2);
-   return tcase;
-}
diff --git a/TC/evas/canvas/evas_object_data/utc_evas_object_data_get_set.c b/TC/evas/canvas/evas_object_data/utc_evas_object_data_get_set.c
new file mode 100644 (file)
index 0000000..7e6bc1b
--- /dev/null
@@ -0,0 +1,200 @@
+#include <check.h>
+#include <Evas.h>
+#include "../../../utc_negative_unitest.h"
+
+#define KEY "test_data"
+
+/**
+ * @addtogroup evas_object_data
+ * @{
+ * @defgroup evas_object_data_get evas_object_data_get()
+ *
+ *
+ * @precondition
+ * @step 1 evas initialized with evas_init()
+ */
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   evas_init();
+}
+
+static void
+teardown(void)
+{
+   printf(" ============ Cleanup ============ \n");
+   evas_shutdown();
+}
+
+/**
+ * @addtogroup evas_object_data_get
+ * @{
+ * @objective Positive test case checks if function set and get data properly.
+ * @n Input Data:
+ * @li Pointer to text Evas_Object;
+ * @li "test_data" - data key.
+ *
+ * @procedure
+ * @step 1 Create new Evas and Evas_Object
+ * @step 2 Set data for the object
+ * @step 3 Get data from the object and compare it with the initial one.
+ *
+ * @passcondition Function returns pointer the same as was set with evas_object_data_set().
+ * @}
+ */
+START_TEST(utc_evas_object_data_get_p)
+{
+   Evas *evas = evas_new();
+   Evas_Object *obj = evas_object_text_add(evas);
+
+   if (!obj)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
+     }
+   const int my_data = 42;
+   int result = TEST_FAIL;
+
+   evas_object_data_set(obj, KEY, &my_data);
+   int *data_ptr = (int*)evas_object_data_get(obj, KEY);
+
+   if (!data_ptr)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
+     }
+   else if (data_ptr != &my_data)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Returned and initial pointers don't match..", __FILE__, __LINE__);
+     }
+   else
+     {
+        printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+        result = TEST_PASS;
+     }
+   evas_free(evas);
+}
+END_TEST
+
+/**
+ * @addtogroup evas_object_data_get
+ * @{
+ * @objective Negative test case 1 checks if function works properly if it is called
+ * when getting data from evas object without data.
+ * @n Input Data:
+ * @li Pointer to text Evas_Object without data;
+ * @li "test_data" - data key.
+ *
+ * @procedure
+ * @step 1 Create new Evas and Evas_Object
+ * @step 2 Try get data from it
+ * @step 3 Check if the data is NULL
+ *
+ * @passcondition Function returns NULL.
+ * @}
+ */
+START_TEST(utc_evas_object_data_get_n)
+{
+   Evas *evas = evas_new();
+   Evas_Object *obj = evas_object_text_add(evas);
+
+   if (!obj)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
+     }
+
+   if (evas_object_data_get(obj, KEY))
+     {
+        evas_free(evas);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+   evas_free(evas);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup evas_object_data_get
+ * @{
+ * @objective Negative test case 2 checks if function doesn't cause segmentation fault
+ * and returns NULL if it is called with NULL instead of any argument.
+ * @n Input Data: pointer to Evas_Object and "test_data" as key.
+ *
+ * @procedure
+ * @step 1 Create new Evas
+ * @step 2 Create new text Evas_Object
+ * @step 3 Call function 2 times and pass (in turn) NULL instead of one from valid arguments.
+ *
+ * @passcondition Function doesn't cause segmentation fault and returns NULL.
+ * @}
+ */
+START_TEST(utc_evas_object_data_get_n2)
+{
+   Evas *evas = evas_new();
+   Evas_Object *obj = evas_object_text_add(evas);
+
+   if (!obj)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
+     }
+
+   if (UNITEST_FUNC_NEG_RET(NULL, evas_object_data_get, obj, KEY) == TEST_FAIL)
+     {
+        evas_free(evas);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+   evas_free(evas);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup evas_object_data_set
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * if it is called with NULL instead of any argument.
+ * @n Input Data:
+ * @li Pointer to text Evas_Object;
+ * @li "test_data" - data key;
+ * @li pointer to integer value 42.
+ *
+ * @procedure
+ * @step 1 Create new Evas
+ * @step 2 Create new text Evas_Object
+ * @step 3 Call function 3 times and pass (in turn) NULL instead of one from valid arguments.
+ *
+ * @passcondition Function doesn't cause segmentation fault.
+ * @}
+ */
+START_TEST(utc_evas_object_data_set_n)
+{
+   const int my_data = 42;
+   Evas *evas = evas_new();
+   Evas_Object *obj = evas_object_text_add(evas);
+
+   if (!obj)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
+     }
+
+   UNITEST_FUNC_NEG(evas_object_data_set, obj, KEY, &my_data);
+
+   evas_free(evas);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ *@}
+ */
+
+TCase * _utc_evas_object_data_get_set()
+{
+   TCase *tcase = tcase_create("utc_evas_object_data_get_set");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_evas_object_data_get_p);
+   tcase_add_test(tcase, utc_evas_object_data_get_n);
+   tcase_add_test(tcase, utc_evas_object_data_get_n2);
+   tcase_add_test(tcase, utc_evas_object_data_set_n);
+   return tcase;
+}
diff --git a/TC/evas/canvas/evas_object_data/utc_evas_object_data_set.c b/TC/evas/canvas/evas_object_data/utc_evas_object_data_set.c
deleted file mode 100644 (file)
index 4f2da65..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-#include <check.h>
-#include <Evas.h>
-#include "../../../utc_negative_unitest.h"
-
-#define KEY "test_data"
-
-/**
- * @addtogroup evas_object_data
- * @{
- * @defgroup evas_object_data_set evas_object_data_set()
- *
- *
- * @precondition
- * @step 1 evas initialized with evas_init()
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   evas_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   evas_shutdown();
-}
-
-/**
- * @addtogroup evas_object_data_set
- * @{
- * @objective Positive test case checks if function set data properly.
- * @n Input Data:
- * @li Pointer to text Evas_Object;
- * @li "test_data" - data key;
- * @li pointer to integer value 42.
- *
- * @procedure
- * @step 1 Create new Evas and Evas_Object
- * @step 2 Set data for the object
- * @step 3 Get data from the object and compare it with the initial one.
- *
- * @passcondition Function evas_object_data_get() returns pointer the same as was set.
- * @}
- */
-START_TEST(utc_evas_object_data_set_p)
-{
-   Evas *evas = evas_new();
-   Evas_Object *obj = evas_object_text_add(evas);
-
-   if (!obj)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
-        evas_free(evas);
-        return;
-     }
-   const int my_data = 42;
-   int result = TEST_FAIL;
-
-   evas_object_data_set(obj, KEY, &my_data);
-   int *data_ptr = (int*)evas_object_data_get(obj, KEY);
-
-   if (!data_ptr)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Function has returned NULL..", __FILE__, __LINE__);
-     }
-   else if (data_ptr != &my_data)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Returned and initial pointers don't match..", __FILE__, __LINE__);
-     }
-   else
-     {
-        printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-        result = TEST_PASS;
-     }
-   evas_free(evas);
-}
-END_TEST
-
-/**
- * @addtogroup evas_object_data_set
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * if it is called with NULL instead of any argument.
- * @n Input Data:
- * @li Pointer to text Evas_Object;
- * @li "test_data" - data key;
- * @li pointer to integer value 42.
- *
- * @procedure
- * @step 1 Create new Evas
- * @step 2 Create new text Evas_Object
- * @step 3 Call function 3 times and pass (in turn) NULL instead of one from valid arguments.
- *
- * @passcondition Function doesn't cause segmentation fault.
- * @}
- */
-START_TEST(utc_evas_object_data_set_n)
-{
-   const int my_data = 42;
-   Evas *evas = evas_new();
-   Evas_Object *obj = evas_object_text_add(evas);
-
-   if (!obj)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Object is not created..", __FILE__, __LINE__);
-        evas_free(evas);
-        return;
-     }
-
-   UNITEST_FUNC_NEG(evas_object_data_set, obj, KEY, &my_data);
-
-   evas_free(evas);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-/**
- *@}
- */
-
-TCase * _utc_evas_object_data_set()
-{
-   TCase *tcase = tcase_create("utc_evas_object_data_set");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_evas_object_data_set_p);
-   tcase_add_test(tcase, utc_evas_object_data_set_n);
-   return tcase;
-}