utc_evas_object_smart: Merge TCs to reduce duplicate test operations 15/191015/3
authorApurv Khatri <apurv.khatri@samsung.com>
Wed, 10 Oct 2018 11:39:48 +0000 (17:09 +0530)
committerHermet Park <chuneon.park@samsung.com>
Fri, 12 Oct 2018 07:39:03 +0000 (07:39 +0000)
Change-Id: Ifa7b16e0b6aea2b71cce8bc8a1d5212185d0e979

TC/evas/canvas/evas_object_smart/tslist
TC/evas/canvas/evas_object_smart/tslist_mobile
TC/evas/canvas/evas_object_smart/tslist_tv
TC/evas/canvas/evas_object_smart/tslist_wear
TC/evas/canvas/evas_object_smart/utc_evas_object_smart_add.c [deleted file]
TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_get.c [deleted file]
TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_get_set.c [new file with mode: 0644]
TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_set.c [deleted file]
TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_get.c [deleted file]
TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_get_set.c [new file with mode: 0644]
TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_set.c [deleted file]

index d06844236dcf72af50c8fd2656ba3bd122eb3de8..91aeb2e649f9fb00937ed33957b4f61a709143e7 100644 (file)
@@ -3,10 +3,8 @@ utc_evas_object_smart_callback_call.c
 utc_evas_object_smart_callback_del.c
 utc_evas_object_smart_callbacks_descriptions_set.c
 utc_evas_object_smart_callbacks_descriptions_get.c
-utc_evas_object_smart_data_get.c
-utc_evas_object_smart_data_set.c
+utc_evas_object_smart_data_get_set.c
 utc_evas_object_smart_type_check.c
-utc_evas_object_smart_add.c
 utc_evas_object_smart_member_add.c
 utc_evas_object_smart_member_del.c
 utc_evas_object_smart_parent_get.c
@@ -15,8 +13,7 @@ utc_evas_smart_objects_calculate.c
 utc_evas_object_smart_callback_del_full.c
 utc_evas_object_smart_members_get.c
 utc_evas_smart_objects_calculate_count_get.c
-utc_evas_object_smart_need_recalculate_get.c
-utc_evas_object_smart_need_recalculate_set.c
+utc_evas_object_smart_need_recalculate_get_set.c
 utc_evas_object_smart_calculate.c
 utc_evas_object_smart_callback_priority_add.c
 utc_evas_object_smart_callback_description_find.c
index d06844236dcf72af50c8fd2656ba3bd122eb3de8..91aeb2e649f9fb00937ed33957b4f61a709143e7 100644 (file)
@@ -3,10 +3,8 @@ utc_evas_object_smart_callback_call.c
 utc_evas_object_smart_callback_del.c
 utc_evas_object_smart_callbacks_descriptions_set.c
 utc_evas_object_smart_callbacks_descriptions_get.c
-utc_evas_object_smart_data_get.c
-utc_evas_object_smart_data_set.c
+utc_evas_object_smart_data_get_set.c
 utc_evas_object_smart_type_check.c
-utc_evas_object_smart_add.c
 utc_evas_object_smart_member_add.c
 utc_evas_object_smart_member_del.c
 utc_evas_object_smart_parent_get.c
@@ -15,8 +13,7 @@ utc_evas_smart_objects_calculate.c
 utc_evas_object_smart_callback_del_full.c
 utc_evas_object_smart_members_get.c
 utc_evas_smart_objects_calculate_count_get.c
-utc_evas_object_smart_need_recalculate_get.c
-utc_evas_object_smart_need_recalculate_set.c
+utc_evas_object_smart_need_recalculate_get_set.c
 utc_evas_object_smart_calculate.c
 utc_evas_object_smart_callback_priority_add.c
 utc_evas_object_smart_callback_description_find.c
index 3a50ef38340b88266b72d2fdb2d42cbc1eb18ddc..041921b72bf083261ed62ff225e07b6e37bf6753 100644 (file)
@@ -3,10 +3,8 @@
 #utc_evas_object_smart_callback_del.c
 #utc_evas_object_smart_callbacks_descriptions_set.c
 #utc_evas_object_smart_callbacks_descriptions_get.c
-#utc_evas_object_smart_data_get.c
-#utc_evas_object_smart_data_set.c
+#utc_evas_object_smart_data_get_set.c
 #utc_evas_object_smart_type_check.c
-#utc_evas_object_smart_add.c
 #utc_evas_object_smart_member_add.c
 #utc_evas_object_smart_member_del.c
 #utc_evas_object_smart_parent_get.c
@@ -15,8 +13,7 @@
 #utc_evas_object_smart_callback_del_full.c
 #utc_evas_object_smart_members_get.c
 #utc_evas_smart_objects_calculate_count_get.c
-#utc_evas_object_smart_need_recalculate_get.c
-#utc_evas_object_smart_need_recalculate_set.c
+#utc_evas_object_smart_need_recalculate_get_set.c
 #utc_evas_object_smart_calculate.c
 #utc_evas_object_smart_callback_priority_add.c
 #utc_evas_object_smart_callback_description_find.c
index 3a50ef38340b88266b72d2fdb2d42cbc1eb18ddc..041921b72bf083261ed62ff225e07b6e37bf6753 100644 (file)
@@ -3,10 +3,8 @@
 #utc_evas_object_smart_callback_del.c
 #utc_evas_object_smart_callbacks_descriptions_set.c
 #utc_evas_object_smart_callbacks_descriptions_get.c
-#utc_evas_object_smart_data_get.c
-#utc_evas_object_smart_data_set.c
+#utc_evas_object_smart_data_get_set.c
 #utc_evas_object_smart_type_check.c
-#utc_evas_object_smart_add.c
 #utc_evas_object_smart_member_add.c
 #utc_evas_object_smart_member_del.c
 #utc_evas_object_smart_parent_get.c
@@ -15,8 +13,7 @@
 #utc_evas_object_smart_callback_del_full.c
 #utc_evas_object_smart_members_get.c
 #utc_evas_smart_objects_calculate_count_get.c
-#utc_evas_object_smart_need_recalculate_get.c
-#utc_evas_object_smart_need_recalculate_set.c
+#utc_evas_object_smart_need_recalculate_get_set.c
 #utc_evas_object_smart_calculate.c
 #utc_evas_object_smart_callback_priority_add.c
 #utc_evas_object_smart_callback_description_find.c
diff --git a/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_add.c b/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_add.c
deleted file mode 100644 (file)
index c65408b..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-#include <check.h>
-#include <Evas.h>
-#include "../../../utc_negative_unitest.h"
-
-/**
- * @addtogroup evas_object_smart
- * @{
- * @defgroup evas_object_smart_add evas_object_smart_add()
- *
- *
- * @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_smart_add
- * @{
- * @objective Positive test case checks if function works properly and returns valid pointer to Evas_Object, not NULL.
- * @n Input Data:
- * @li pointer to Evas;
- * @li pointer to Evas_Smart object.
- *
- * @procedure
- * @step 1 Create new Evas object.
- * @step 2 Create new Evas_Smart structure.
- * @step 3 Create new smart object on the evas.
- *
- * @passcondition Function returns valid pointer, not NULL.
- * @}
- */
-START_TEST(utc_evas_object_smart_add_p)
-{
-   Evas *evas = evas_new();
-
-   if (!evas)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
-        return;
-     }
-   const Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("UTC_Smart");
-   Evas_Smart *smart = evas_smart_class_new(&sc);
-   Evas_Object *obj = evas_object_smart_add(evas, smart);
-   evas_free(evas);
-
-   if (!obj)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
-        return;
-     }
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup evas_object_smart_add
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of pointer to Evas.
- * @n Input Data: NULL instead of pointer to Evas and pointer to Evas_Smart.
- *
- * @procedure
- * @step 1 Create new Evas_Smart object.
- * @step 2 Call function once and pass NULL instead of first argument.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_evas_object_smart_add_n)
-{
-   const Evas_Smart_Class *evas_smart_class = evas_object_smart_clipped_class_get();
-   Evas_Smart *evas_smart = evas_smart_class_new(evas_smart_class);
-
-   if (!evas_smart)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Smart is not created..", __FILE__, __LINE__);
-        return;
-     }
-
-   CREATE_CHECKED_ARGS_ARRAY(1, 0);
-   UNITEST_FUNC_NEG_CA_RET(NULL, evas_object_smart_add, NULL, evas_smart);
-
-   if (result_of_testing == TEST_FAIL)
-      ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-   else
-      printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-
-   evas_smart_free(evas_smart);
-}
-END_TEST
-
-/**
- * @addtogroup evas_object_smart_add
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * if it is called with NULL instead of pointer to Evas_Smart.
- * @n Input Data: pointer to Evas and NULL instead of pointer to Evas_Smart.
- *
- * @procedure
- * @step 1 Call function once and pass NULL instead of second argument.
- *
- * @passcondition Function doesn't cause segmentation fault.
- * @}
- */
-START_TEST(utc_evas_object_smart_add_n2)
-{
-   Evas *evas = evas_new();
-
-   if (!evas)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
-        return;
-     }
-
-   CREATE_CHECKED_ARGS_ARRAY(0, 1);
-   UNITEST_FUNC_NEG_CA(evas_object_smart_add, evas, NULL);
-
-   evas_free(evas);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-/**
- *@}
- */
-
-TCase * _utc_evas_object_smart_add()
-{
-   TCase *tcase = tcase_create("utc_evas_object_smart_add");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_evas_object_smart_add_p);
-   tcase_add_test(tcase, utc_evas_object_smart_add_n);
-   tcase_add_test(tcase, utc_evas_object_smart_add_n2);
-   return tcase;
-}
diff --git a/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_get.c b/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_get.c
deleted file mode 100644 (file)
index 412aa7e..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#include <check.h>
-#include <Evas.h>
-#include <Ecore_Evas.h>
-#include "../../../utc_negative_unitest.h"
-
-static void *data=NULL;
-
-static void _smart_add(Evas_Object *obj)
-{
-   data = (void *)malloc(2);
-   if (!data)
-       {
-          ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Memory is not allocated..", __FILE__, __LINE__);
-       }
-   evas_object_smart_data_set(obj, data);
-}
-
-/**
- * @addtogroup evas_object_smart
- * @{
- * @defgroup evas_object_smart_data_get evas_object_smart_data_get()
- *
- *
- * @precondition
- * @step 1 ecore_evas initialized with ecore_evas_init()
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   ecore_evas_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   ecore_evas_shutdown();
-}
-
-/**
- * @addtogroup evas_object_smart_data_get
- * @{
- * @objective Positive test case checks if function gets user data from given Evas_Object properly.
- * @n Input Data:
- * @li pointer to table Evas_Object.
- *
- * @procedure
- * @step 1 Create new Evas object.
- * @step 2 Create new smart Evas_Object.
- * @step 3 Set data of the smart object to newly allocated buffer
- * @step 4 Get the data from the box and compare it with data, which was set.
- *
- * @passcondition Returned pointer and pointer that was set are equal.
- * @}
- */
-START_TEST(utc_evas_object_smart_data_get_p)
-{
-   Evas *evas = evas_new();
-   if (!evas)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
-     }
-   Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("utc_smart_data_get");
-   sc.add = _smart_add;
-   Evas_Smart *smart = evas_smart_class_new(&sc);
-   Evas_Object *obj = evas_object_smart_add(evas, smart);
-   if (!obj)
-     {
-        evas_free(evas);
-        free(data);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
-     }
-   if (data != evas_object_smart_data_get(obj))
-     {
-        evas_free(evas);
-        free(data);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-     }
-
-   evas_free(evas);
-   free(data);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup evas_object_smart_data_get
- * @{
- * @objective Negative test case checks if function doesn't cause segmentation fault
- * and returns NULL if it is called with NULL instead of pointer to Evas_Object.
- * @n Input Data: NULL as pointer to Evas_Object.
- *
- * @procedure
- * @step 1 Call function and pass NULL instead of its argument.
- *
- * @passcondition Function doesn't cause segmentation fault and returns NULL.
- * @}
- */
-START_TEST(utc_evas_object_smart_data_get_n)
-{
-
-   if (UNITEST_FUNC_NEG_RET(NULL, evas_object_smart_data_get, NULL) == TEST_FAIL)
-     {
-        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
-/**
- *@}
- */
-
-TCase * _utc_evas_object_smart_data_get()
-{
-   TCase *tcase = tcase_create("utc_evas_object_smart_data_get");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_evas_object_smart_data_get_p);
-   tcase_add_test(tcase, utc_evas_object_smart_data_get_n);
-   return tcase;
-}
diff --git a/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_get_set.c b/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_get_set.c
new file mode 100644 (file)
index 0000000..3189344
--- /dev/null
@@ -0,0 +1,177 @@
+#include <check.h>
+#include <Evas.h>
+#include <Ecore_Evas.h>
+#include "../../../utc_negative_unitest.h"
+
+static void *data=NULL;
+
+static void _smart_add(Evas_Object *obj)
+{
+   data = (void *)malloc(2);
+   if (!data)
+       {
+          ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Memory is not allocated..", __FILE__, __LINE__);
+       }
+   evas_object_smart_data_set(obj, data);
+}
+
+static void _smart_add_negative(Evas_Object *obj)
+{
+   data = (void *)malloc(2);
+   if (!data)
+       {
+          ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Memory is not allocated..", __FILE__, __LINE__);
+       }
+   UNITEST_FUNC_NEG(evas_object_smart_data_set, obj, data);
+}
+
+/**
+ * @addtogroup evas_object_smart
+ * @{
+ * @defgroup evas_object_smart_data_set evas_object_smart_data_set()
+ *
+ *
+ * @precondition
+ * @step 1 ecore_evas initialized with ecore_evas_init()
+ */
+static void
+setup(void)
+{
+   printf(" ============ Startup ============ \n");
+   ecore_evas_init();
+}
+
+static void
+teardown(void)
+{
+   printf(" ============ Cleanup ============ \n");
+   ecore_evas_shutdown();
+}
+
+/**
+ * @addtogroup evas_object_smart_data_set
+ * @{
+ * @objective Positive test case checks if function sets user data for given Evas_Object properly.
+ * @n Input Data:
+ * @li pointer to table Evas_Object;
+ * @li pointer to user data to store in the object.
+ *
+ * @procedure
+ * @step 1 Create new Evas object.
+ * @step 2 Create new smart Evas_Object.
+ * @step 3 Set data of the smart object to newly allocated buffer
+ * @step 4 Get the data from the box and compare it with data, which was set.
+ *
+ * @passcondition Function sets data successfully, pointer returned by 'evas_object_smart_data_get'
+ * is equal to pointer that was set.
+ * @}
+ */
+START_TEST(utc_evas_object_smart_data_set_p)
+{
+   Evas *evas = evas_new();
+   if (!evas)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
+     }
+   Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("smart_data_set");
+   sc.add = _smart_add;
+   Evas_Smart *smart = evas_smart_class_new(&sc);
+   Evas_Object *obj = evas_object_smart_add(evas, smart);
+   if (!obj)
+     {
+        evas_free(evas);
+        free(data);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
+     }
+   if (data != evas_object_smart_data_get(obj))
+     {
+        evas_free(evas);
+        free(data);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+     }
+
+   evas_free(evas);
+   free(data);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup evas_object_smart_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 smart Evas_Object;
+ * @li pointer to user data to store in the object.
+ *
+ * @procedure
+ * @step 1 Create new Evas object.
+ * @step 2 Create new smart 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.
+ * @}
+ */
+START_TEST(utc_evas_object_smart_data_set_n)
+{
+       Evas *evas = evas_new();
+       if (!evas)
+         {
+                ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
+         }
+       Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("smart_data_set_n");
+       sc.add = _smart_add_negative;
+       Evas_Smart *smart = evas_smart_class_new(&sc);
+       Evas_Object *obj = evas_object_smart_add(evas, smart);
+       if (!obj)
+         {
+                evas_free(evas);
+                free(data);
+                ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
+         }
+   
+   evas_free(evas);
+   free(data);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup evas_object_smart_data_get
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * and returns NULL if it is called with NULL instead of pointer to Evas_Object.
+ * @n Input Data: NULL as pointer to Evas_Object.
+ *
+ * @procedure
+ * @step 1 Call function and pass NULL instead of its argument.
+ *
+ * @passcondition Function doesn't cause segmentation fault and returns NULL.
+ * @}
+ */
+START_TEST(utc_evas_object_smart_data_get_n)
+{
+
+   if (UNITEST_FUNC_NEG_RET(NULL, evas_object_smart_data_get, NULL) == TEST_FAIL)
+     {
+        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
+
+/**
+ *@}
+ */
+
+TCase * _utc_evas_object_smart_data_get_set()
+{
+   TCase *tcase = tcase_create("utc_evas_object_smart_data_get_set");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_evas_object_smart_data_set_p);
+   tcase_add_test(tcase, utc_evas_object_smart_data_set_n);
+   tcase_add_test(tcase, utc_evas_object_smart_data_get_n);
+   return tcase;
+}
diff --git a/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_set.c b/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_data_set.c
deleted file mode 100644 (file)
index 678de55..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#include <check.h>
-#include <Evas.h>
-#include <Ecore_Evas.h>
-#include "../../../utc_negative_unitest.h"
-
-static void *data=NULL;
-
-static void _smart_add(Evas_Object *obj)
-{
-   data = (void *)malloc(2);
-   if (!data)
-       {
-          ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Memory is not allocated..", __FILE__, __LINE__);
-       }
-   evas_object_smart_data_set(obj, data);
-}
-
-static void _smart_add_negative(Evas_Object *obj)
-{
-   data = (void *)malloc(2);
-   if (!data)
-       {
-          ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Memory is not allocated..", __FILE__, __LINE__);
-       }
-   UNITEST_FUNC_NEG(evas_object_smart_data_set, obj, data);
-}
-
-/**
- * @addtogroup evas_object_smart
- * @{
- * @defgroup evas_object_smart_data_set evas_object_smart_data_set()
- *
- *
- * @precondition
- * @step 1 ecore_evas initialized with ecore_evas_init()
- */
-static void
-setup(void)
-{
-   printf(" ============ Startup ============ \n");
-   ecore_evas_init();
-}
-
-static void
-teardown(void)
-{
-   printf(" ============ Cleanup ============ \n");
-   ecore_evas_shutdown();
-}
-
-/**
- * @addtogroup evas_object_smart_data_set
- * @{
- * @objective Positive test case checks if function sets user data for given Evas_Object properly.
- * @n Input Data:
- * @li pointer to table Evas_Object;
- * @li pointer to user data to store in the object.
- *
- * @procedure
- * @step 1 Create new Evas object.
- * @step 2 Create new smart Evas_Object.
- * @step 3 Set data of the smart object to newly allocated buffer
- * @step 4 Get the data from the box and compare it with data, which was set.
- *
- * @passcondition Function sets data successfully, pointer returned by 'evas_object_smart_data_get'
- * is equal to pointer that was set.
- * @}
- */
-START_TEST(utc_evas_object_smart_data_set_p)
-{
-   Evas *evas = evas_new();
-   if (!evas)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
-     }
-   Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("smart_data_set");
-   sc.add = _smart_add;
-   Evas_Smart *smart = evas_smart_class_new(&sc);
-   Evas_Object *obj = evas_object_smart_add(evas, smart);
-   if (!obj)
-     {
-        evas_free(evas);
-        free(data);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
-     }
-   if (data != evas_object_smart_data_get(obj))
-     {
-        evas_free(evas);
-        free(data);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
-     }
-
-   evas_free(evas);
-   free(data);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup evas_object_smart_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 smart Evas_Object;
- * @li pointer to user data to store in the object.
- *
- * @procedure
- * @step 1 Create new Evas object.
- * @step 2 Create new smart 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.
- * @}
- */
-START_TEST(utc_evas_object_smart_data_set_n)
-{
-       Evas *evas = evas_new();
-       if (!evas)
-         {
-                ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
-         }
-       Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("smart_data_set_n");
-       sc.add = _smart_add_negative;
-       Evas_Smart *smart = evas_smart_class_new(&sc);
-       Evas_Object *obj = evas_object_smart_add(evas, smart);
-       if (!obj)
-         {
-                evas_free(evas);
-                free(data);
-                ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
-         }
-   
-   evas_free(evas);
-   free(data);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-/**
- *@}
- */
-
-TCase * _utc_evas_object_smart_data_set()
-{
-   TCase *tcase = tcase_create("utc_evas_object_smart_data_set");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_evas_object_smart_data_set_p);
-   tcase_add_test(tcase, utc_evas_object_smart_data_set_n);
-   return tcase;
-}
diff --git a/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_get.c b/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_get.c
deleted file mode 100644 (file)
index 5b5c153..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#include <check.h>
-#include <Evas.h>
-
-
-/**
- * @addtogroup evas_object_smart
- * @{
- * @defgroup evas_object_smart_need_recalculate_get evas_object_smart_need_recalculate_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_smart_need_recalculate_get
- * @{
- * @objective Positive test case checks if function gets need_recalculate of smart object proprly.
- * @n Input Data:
- * @li pointer to Evas_Smart object.
- *
- * @procedure
- * @step 1 Create new Evas_Smart object.
- * @step 2 Set need_recalculate flag = EINA_TRUE for Evas_Smart object.
- * @step 3 Run evas_object_smart_need_recalculate_get() for Evas_Smart object.
- * @step 4 Set need_recalculate flag = EINA_FALSE for Evas_Smart object.
- * @step 5 Run evas_object_smart_need_recalculate_get() for Evas_Smart object.
- *
- * @passcondition Evas_Smart object has need_recalculate flag equal to EINA_TRUE at the
- * first time and equal to EINA_FALSE at the second time.
- * @}
- */
-START_TEST(utc_evas_object_smart_need_recalculate_get_p)
-{
-   Evas *evas = evas_new();
-
-   if (!evas)
-     {
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
-     }
-   const Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("UTC_Smart");
-   Evas_Smart *smart = evas_smart_class_new(&sc);
-   Evas_Object *obj = evas_object_smart_add(evas, smart);
-
-   if (!obj)
-     {
-        evas_smart_free(smart);
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
-     }
-
-   evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
-   if (!evas_object_smart_need_recalculate_get(obj))
-     {
-        evas_object_del(obj);
-        evas_smart_free(smart);
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. No calculate() is provided for object..", __FILE__, __LINE__);
-     }
-
-   evas_object_smart_need_recalculate_set(obj, EINA_FALSE);
-   if (evas_object_smart_need_recalculate_get(obj))
-     {
-        evas_object_del(obj);
-        evas_smart_free(smart);
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. calculate() is provided for object..", __FILE__, __LINE__);
-     }
-
-   evas_object_del(obj);
-   evas_smart_free(smart);
-   evas_free(evas);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- *@}
- */
-
-TCase * _utc_evas_object_smart_need_recalculate_get()
-{
-   TCase *tcase = tcase_create("utc_evas_object_smart_need_recalculate_get");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_evas_object_smart_need_recalculate_get_p);
-   return tcase;
-}
diff --git a/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_get_set.c b/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_get_set.c
new file mode 100644 (file)
index 0000000..bcd60ef
--- /dev/null
@@ -0,0 +1,169 @@
+#include <check.h>
+#include <Evas.h>
+#include "../../../utc_negative_unitest.h"
+
+/**
+ * @addtogroup evas_object_smart
+ * @{
+ * @defgroup evas_object_smart_need_recalculate_get evas_object_smart_need_recalculate_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_smart_need_recalculate_get
+ * @{
+ * @objective Positive test case checks if function gets need_recalculate of smart object proprly.
+ * @n Input Data:
+ * @li pointer to Evas_Smart object.
+ *
+ * @procedure
+ * @step 1 Create new Evas_Smart object.
+ * @step 2 Set need_recalculate flag = EINA_TRUE for Evas_Smart object.
+ * @step 3 Run evas_object_smart_need_recalculate_get() for Evas_Smart object.
+ * @step 4 Set need_recalculate flag = EINA_FALSE for Evas_Smart object.
+ * @step 5 Run evas_object_smart_need_recalculate_get() for Evas_Smart object.
+ *
+ * @passcondition Evas_Smart object has need_recalculate flag equal to EINA_TRUE at the
+ * first time and equal to EINA_FALSE at the second time.
+ * @}
+ */
+START_TEST(utc_evas_object_smart_need_recalculate_get_p)
+{
+   Evas *evas = evas_new();
+
+   if (!evas)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
+     }
+   const Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("UTC_Smart");
+   Evas_Smart *smart = evas_smart_class_new(&sc);
+   Evas_Object *obj = evas_object_smart_add(evas, smart);
+
+   if (!obj)
+     {
+        evas_smart_free(smart);
+        evas_free(evas);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
+     }
+
+   evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
+   if (!evas_object_smart_need_recalculate_get(obj))
+     {
+        evas_object_del(obj);
+        evas_smart_free(smart);
+        evas_free(evas);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. No calculate() is provided for object..", __FILE__, __LINE__);
+     }
+
+   evas_object_smart_need_recalculate_set(obj, EINA_FALSE);
+   if (evas_object_smart_need_recalculate_get(obj))
+     {
+        evas_object_del(obj);
+        evas_smart_free(smart);
+        evas_free(evas);
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. calculate() is provided for object..", __FILE__, __LINE__);
+     }
+
+   evas_object_del(obj);
+   evas_smart_free(smart);
+   evas_free(evas);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup evas_object_smart_add
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * and returns NULL if it is called with NULL instead of pointer to Evas.
+ * @n Input Data: NULL instead of pointer to Evas and pointer to Evas_Smart.
+ *
+ * @procedure
+ * @step 1 Create new Evas_Smart object.
+ * @step 2 Call function once and pass NULL instead of first argument.
+ *
+ * @passcondition Function doesn't cause segmentation fault and returns NULL.
+ * @}
+ */
+START_TEST(utc_evas_object_smart_add_n)
+{
+   const Evas_Smart_Class *evas_smart_class = evas_object_smart_clipped_class_get();
+   Evas_Smart *evas_smart = evas_smart_class_new(evas_smart_class);
+
+   if (!evas_smart)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas_Smart is not created..", __FILE__, __LINE__);
+     }
+
+   CREATE_CHECKED_ARGS_ARRAY(1, 0);
+   UNITEST_FUNC_NEG_CA_RET(NULL, evas_object_smart_add, NULL, evas_smart);
+
+   if (result_of_testing == TEST_FAIL)
+      ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+   else
+      printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+
+   evas_smart_free(evas_smart);
+}
+END_TEST
+
+/**
+ * @addtogroup evas_object_smart_add
+ * @{
+ * @objective Negative test case checks if function doesn't cause segmentation fault
+ * if it is called with NULL instead of pointer to Evas_Smart.
+ * @n Input Data: pointer to Evas and NULL instead of pointer to Evas_Smart.
+ *
+ * @procedure
+ * @step 1 Call function once and pass NULL instead of second argument.
+ *
+ * @passcondition Function doesn't cause segmentation fault.
+ * @}
+ */
+START_TEST(utc_evas_object_smart_add_n2)
+{
+   Evas *evas = evas_new();
+
+   if (!evas)
+     {
+        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
+     }
+
+   CREATE_CHECKED_ARGS_ARRAY(0, 1);
+   UNITEST_FUNC_NEG_CA(evas_object_smart_add, evas, NULL);
+
+   evas_free(evas);
+   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ *@}
+ */
+
+TCase * _utc_evas_object_smart_need_recalculate_get_set()
+{
+   TCase *tcase = tcase_create("utc_evas_object_smart_need_recalculate_get_set");
+   tcase_set_timeout(tcase, 30);
+   tcase_add_checked_fixture(tcase, setup, teardown);
+   tcase_add_test(tcase, utc_evas_object_smart_need_recalculate_get_p);
+   tcase_add_test(tcase, utc_evas_object_smart_add_n);
+   tcase_add_test(tcase, utc_evas_object_smart_add_n2);
+   return tcase;
+}
diff --git a/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_set.c b/TC/evas/canvas/evas_object_smart/utc_evas_object_smart_need_recalculate_set.c
deleted file mode 100644 (file)
index f8455bf..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#include <check.h>
-#include <Evas.h>
-
-
-/**
- * @addtogroup evas_object_smart
- * @{
- * @defgroup evas_object_smart_need_recalculate_set evas_object_smart_need_recalculate_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_smart_need_recalculate_set
- * @{
- * @objective Positive test case checks if function sets need_recalculate of smart object proprly.
- * @n Input Data:
- * @li pointer to Evas_Smart object.
- *
- * @procedure
- * @step 1 Create new Evas_Smart object.
- * @step 2 Run evas_object_smart_need_recalculate_set() for Evas_Smart object with EINA_TRUE value.
- * @step 3 Get need_recalculate flag from Evas_Smart object.
- * @step 4 Run evas_object_smart_need_recalculate_set() for Evas_Smart object with EINA_FALSE value.
- * @step 5 Get need_recalculate flag from Evas_Smart object.
- *
- * @passcondition Evas_Smart object has need_recalculate flag equal to EINA_TRUE at the
- * first time and equal to EINA_FALSE at the second time.
- * @}
- */
-START_TEST(utc_evas_object_smart_need_recalculate_set_p)
-{
-   Evas *evas = evas_new();
-
-   if (!evas)
-     {
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Evas object is not created..", __FILE__, __LINE__);
-     }
-   const Evas_Smart_Class sc = EVAS_SMART_CLASS_INIT_NAME_VERSION("UTC_Smart");
-   Evas_Smart *smart = evas_smart_class_new(&sc);
-   Evas_Object *obj = evas_object_smart_add(evas, smart);
-
-   if (!obj)
-     {
-        evas_smart_free(smart);
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Smart Evas_Object is not created..", __FILE__, __LINE__);
-     }
-
-   evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
-   if (!evas_object_smart_need_recalculate_get(obj))
-     {
-        evas_object_del(obj);
-        evas_smart_free(smart);
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. No calculate() is provided for object..", __FILE__, __LINE__);
-     }
-
-   evas_object_smart_need_recalculate_set(obj, EINA_FALSE);
-   if (evas_object_smart_need_recalculate_get(obj))
-     {
-        evas_object_del(obj);
-        evas_smart_free(smart);
-        evas_free(evas);
-        ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. calculate() is provided for object..", __FILE__, __LINE__);
-     }
-
-   evas_object_del(obj);
-   evas_smart_free(smart);
-   evas_free(evas);
-   printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- *@}
- */
-
-TCase * _utc_evas_object_smart_need_recalculate_set()
-{
-   TCase *tcase = tcase_create("utc_evas_object_smart_need_recalculate_set");
-   tcase_set_timeout(tcase, 30);
-   tcase_add_checked_fixture(tcase, setup, teardown);
-   tcase_add_test(tcase, utc_evas_object_smart_need_recalculate_set_p);
-   return tcase;
-}