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
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
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
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
#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
#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
#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
#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
+++ /dev/null
-#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;
-}
+++ /dev/null
-#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;
-}
--- /dev/null
+#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;
+}
+++ /dev/null
-#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;
-}
+++ /dev/null
-#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;
-}
--- /dev/null
+#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;
+}
+++ /dev/null
-#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;
-}