/**
* @addtogroup elm_bg_add
* @{
- * @objective Positive Test case checks if function call with valid value to add a new background
+ * @objective Positive Test case 01 checks if function call with valid value to add a new background
* to the parent works properly and without segmentation fault
* @n Input Data:
* @li the window object
* @li Test passes if returned value is not NULL and there is no segmentation fault
* @}
*/
-START_TEST(utc_elm_bg_add_p)
+START_TEST(utc_elm_bg_add_p1)
{
if (main_win == NULL)
{
- return;
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
}
Evas_Object *bg = NULL;
if (bg == 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__);
evas_object_del(bg);
}
END_TEST
+/**
+ * @addtogroup elm_bg_add
+ * @{
+ * @objective Positive Test case 02 checks if function call with valid value to add a new background
+ * to the parent with precreated object works properly and without segmentation fault
+ * @n Input Data:
+ * @li the window object
+ *
+ * @procedure
+ * @step 1 Create box object with main window parent
+ * @step 2 Set box object as precreated bg object
+ * @step 3 Call elm_bg_add with valid value
+ *
+ * @passcondition
+ * @li Test passes if returned value is not NULL and there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_bg_add_p2)
+{
+ Evas_Object *bg = NULL;
+ Evas_Object *box = NULL;
+ Evas_Object *res_bg = NULL;
+
+ if (main_win == NULL)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
+ }
+
+ box = elm_box_add(main_win);
+ if (box == NULL)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ elm_bg_precreated_object_set(box);
+ res_bg = elm_bg_precreated_object_get();
+ if ((res_bg == NULL) || (res_bg != box))
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ bg = elm_bg_add(main_win);
+ if (bg == NULL)
+ {
+ evas_object_del(box);
+ evas_object_del(res_bg);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
+ }
+
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+ evas_object_del(bg);
+ evas_object_del(box);
+ evas_object_del(res_bg);
+}
+END_TEST
+
/**
* @addtogroup elm_bg_add
* @{
if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_bg_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 *tcase = tcase_create("TCase");
tcase_set_timeout(tcase, 30);
tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_elm_bg_add_p);
+ tcase_add_test(tcase, utc_elm_bg_add_p1);
+ tcase_add_test(tcase, utc_elm_bg_add_p2);
tcase_add_test(tcase, utc_elm_bg_add_n);
suite_add_tcase(suite, tcase);