+++ /dev/null
-#include <check.h>
-#include <Elementary.h>
-#include "../utc_elm_common.h"
-#include "../../utc_negative_unitest.h"
-static Evas_Object *main_win = NULL;
-
-/**
- * @addtogroup elm_plug
- * @{
- * @defgroup elm_plug_add elm_plug_add()
- *
- * @precondition
- * @step 1 Initialize Elementary
- * @step 2 Create and show main window
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- UTC_ELM_INIT();
- 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;
- }
- evas_object_show(main_win);
-}
-
-static void
-teardown(void)
-{
- if (main_win != NULL)
- {
- evas_object_del(main_win);
- main_win = NULL;
- }
- elm_shutdown();
- printf(" ============ Cleanup ============ \n");
-}
-
-/**
- * @addtogroup elm_plug_add
- * @{
- * @objective Positive Test case 01 check if create a new plug widget
- * works properly and doesn't cause segmentation fault
- * @n Input Data: the parent window object
- *
- * @procedure
- * @step 1 Create a new plug widget
- *
- * @passcondition Returned value is not NULL and there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_plug_add_p_01)
-{
- Evas_Object *plug = NULL;
-
- if (main_win == NULL)
- {
- return;
- }
- plug = elm_plug_add(main_win);
- if (plug == 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__);
-}
-END_TEST
-
-/**
- * @addtogroup elm_plug_add
- * @{
- * @objective Negative Test case 01 checks if call test function with NULL instead of the parent object
- * works properly and doesn't cause segmentation fault
- * @n Input Data: NULL instead of the parent object
- *
- * @procedure
- * @step 1 Call test function with NULL instead of the parent object
- *
- * @passcondition Returned value is NULL and there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_plug_add_n_01)
-{
- if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_plug_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 * _utc_elm_plug_add()
-{
- TCase *tcase = tcase_create("utc_elm_plug_add");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_elm_plug_add_p_01);
- tcase_add_test(tcase, utc_elm_plug_add_n_01);
- return tcase;
-}
if (main_win == NULL)
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a main window..", __FILE__, __LINE__);
- return;
}
evas_object_show(main_win);
}
{
Evas_Object *plug = NULL;
- if (main_win == NULL)
- {
- return;
- }
plug = elm_plug_add(main_win);
if (plug == NULL)
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- return;
}
if (elm_plug_connect(plug, "elm_indicator_portrait", 0, EINA_TRUE) != EINA_TRUE)
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- return;
}
printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
}
if (elm_plug_connect(NULL, NULL, 0, EINA_FALSE) != EINA_FALSE)
{
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
+/**
+ * @addtogroup elm_plug_add
+ * @{
+ * @objective Negative Test case 01 checks if call test function with NULL instead of the parent object
+ * works properly and doesn't cause segmentation fault
+ * @n Input Data: NULL instead of the parent object
+ *
+ * @procedure
+ * @step 1 Call test function with NULL instead of the parent object
+ *
+ * @passcondition Returned value is NULL and there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_plug_add_n_01)
+{
+ if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_plug_add, main_win))
+ {
+ 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_add_checked_fixture(tcase, setup, teardown);
tcase_add_test(tcase, utc_elm_plug_connect_p_01);
tcase_add_test(tcase, utc_elm_plug_connect_n_01);
+ tcase_add_test(tcase, utc_elm_plug_add_n_01);
return tcase;
}