{
printf(" ============ Startup ============ \n");
elm_init(0, NULL);
+
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;
}
}
/**
* @addtogroup elm_conformant_add
* @{
- * @objective Positive Test case checks if function call with valid value to add a new conformant widget
+ * @objective Positive Test case 01 checks if function call with valid value to add a new conformant widget
* to the given parent Elementary (container) object 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_conformant_add_p)
+START_TEST(utc_elm_conformant_add_p1)
{
if (main_win == NULL)
{
- return;
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
}
Evas_Object *conformant = NULL;
if (conformant == 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(conformant);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_conformant_add
+ * @{
+ * @objective Positive Test case 02 checks if function call with valid value to add a new conformant widget
+ * with precreated object to the given parent Elementary (container) 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 conformant object
+ * @step 3 Call elm_conformant_add with valid value
+ *
+ * @passcondition
+ * @li Test passes if returned value is not NULL and there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_conformant_add_p2)
+{
+ Evas_Object *conformant = NULL;
+ Evas_Object *box = NULL;
+ Evas_Object *ret = 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)
+ {
+ evas_object_del(box);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__);
+ }
+
+ elm_conformant_precreated_object_set(box);
+ ret = elm_conformant_precreated_object_get();
+ if ((ret == NULL) || (ret != box))
+ {
+ evas_object_del(ret);
+ evas_object_del(box);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ conformant = elm_conformant_add(main_win);
+ if (conformant == NULL)
+ {
+ evas_object_del(ret);
+ evas_object_del(box);
+ 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(conformant);
+ evas_object_del(ret);
+ evas_object_del(box);
}
END_TEST
if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_conformant_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__);
}
TCase *tcase = tcase_create("TCase");
tcase_set_timeout(tcase, 30);
tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_elm_conformant_add_p);
+ tcase_add_test(tcase, utc_elm_conformant_add_p1);
+ tcase_add_test(tcase, utc_elm_conformant_add_p2);
tcase_add_test(tcase, utc_elm_conformant_add_n);
suite_add_tcase(suite, tcase);