From: Apurv Khatri Date: Thu, 13 Sep 2018 05:15:23 +0000 (+0530) Subject: utc_elm_multibuttonentry_xxxx: Merge TCs to reduce duplicate test operations X-Git-Tag: submit/tizen/20190320.070700~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfecda7cef16cf416aff16ee9a3fa85280373886;p=test%2Ftct%2Fnative%2Fefl-test-suite.git utc_elm_multibuttonentry_xxxx: Merge TCs to reduce duplicate test operations Change-Id: I0b6cf0f0299265e81dbae3cfc25fa31d6f6a535e --- diff --git a/TC/elementary/multibuttonentry/tslist b/TC/elementary/multibuttonentry/tslist index 2d874110..bc47edea 100644 --- a/TC/elementary/multibuttonentry/tslist +++ b/TC/elementary/multibuttonentry/tslist @@ -1,10 +1,7 @@ -utc_elm_multibuttonentry_add.c utc_elm_multibuttonentry_clear.c -utc_elm_multibuttonentry_editable_get.c -utc_elm_multibuttonentry_editable_set.c +utc_elm_multibuttonentry_editable_get_set.c utc_elm_multibuttonentry_entry_get.c -utc_elm_multibuttonentry_expanded_get.c -utc_elm_multibuttonentry_expanded_set.c +utc_elm_multibuttonentry_expanded_get_set.c utc_elm_multibuttonentry_first_item_get.c utc_elm_multibuttonentry_format_function_set.c utc_elm_multibuttonentry_item_append.c diff --git a/TC/elementary/multibuttonentry/tslist_mobile b/TC/elementary/multibuttonentry/tslist_mobile index 2d874110..bc47edea 100644 --- a/TC/elementary/multibuttonentry/tslist_mobile +++ b/TC/elementary/multibuttonentry/tslist_mobile @@ -1,10 +1,7 @@ -utc_elm_multibuttonentry_add.c utc_elm_multibuttonentry_clear.c -utc_elm_multibuttonentry_editable_get.c -utc_elm_multibuttonentry_editable_set.c +utc_elm_multibuttonentry_editable_get_set.c utc_elm_multibuttonentry_entry_get.c -utc_elm_multibuttonentry_expanded_get.c -utc_elm_multibuttonentry_expanded_set.c +utc_elm_multibuttonentry_expanded_get_set.c utc_elm_multibuttonentry_first_item_get.c utc_elm_multibuttonentry_format_function_set.c utc_elm_multibuttonentry_item_append.c diff --git a/TC/elementary/multibuttonentry/tslist_tv b/TC/elementary/multibuttonentry/tslist_tv index f265312e..2aa3b03a 100644 --- a/TC/elementary/multibuttonentry/tslist_tv +++ b/TC/elementary/multibuttonentry/tslist_tv @@ -1,10 +1,7 @@ -utc_elm_multibuttonentry_add.c utc_elm_multibuttonentry_clear.c -utc_elm_multibuttonentry_editable_get.c -utc_elm_multibuttonentry_editable_set.c +utc_elm_multibuttonentry_editable_get_set.c utc_elm_multibuttonentry_entry_get.c -utc_elm_multibuttonentry_expanded_get.c -utc_elm_multibuttonentry_expanded_set.c +utc_elm_multibuttonentry_expanded_get_set.c utc_elm_multibuttonentry_first_item_get.c #utc_elm_multibuttonentry_format_function_set.c utc_elm_multibuttonentry_item_append.c diff --git a/TC/elementary/multibuttonentry/tslist_wear b/TC/elementary/multibuttonentry/tslist_wear index f265312e..2aa3b03a 100644 --- a/TC/elementary/multibuttonentry/tslist_wear +++ b/TC/elementary/multibuttonentry/tslist_wear @@ -1,10 +1,7 @@ -utc_elm_multibuttonentry_add.c utc_elm_multibuttonentry_clear.c -utc_elm_multibuttonentry_editable_get.c -utc_elm_multibuttonentry_editable_set.c +utc_elm_multibuttonentry_editable_get_set.c utc_elm_multibuttonentry_entry_get.c -utc_elm_multibuttonentry_expanded_get.c -utc_elm_multibuttonentry_expanded_set.c +utc_elm_multibuttonentry_expanded_get_set.c utc_elm_multibuttonentry_first_item_get.c #utc_elm_multibuttonentry_format_function_set.c utc_elm_multibuttonentry_item_append.c diff --git a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_add.c b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_add.c deleted file mode 100644 index b725a0de..00000000 --- a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_add.c +++ /dev/null @@ -1,110 +0,0 @@ -#include -#include -#include "../utc_elm_common.h" -#include "../../utc_negative_unitest.h" -static Evas_Object *main_win = NULL; - -/** - * @addtogroup elm_multibuttonentry - * @{ - * @defgroup elm_multibuttonentry_add elm_multibuttonentry_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_multibuttonentry_add - * @{ - * @objective Positive Test case checks if add a new multibuttonentry - * works properly and doesn't cause segmentation fault - * @n Input Data: the parent window object - * - * @procedure - * @step 1 Add a new multibuttonentry - * - * @passcondition Returned value is not NULL and there is no segmentation fault - * @} - */ -START_TEST(utc_elm_multibuttonentry_add_p) -{ - Evas_Object *multibuttonentry = NULL; - - if (main_win == NULL) - { - return; - } - multibuttonentry = elm_multibuttonentry_add(main_win); - if (multibuttonentry == NULL) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); - return; - } - evas_object_del(multibuttonentry); - printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); -} -END_TEST - -/** - * @addtogroup elm_multibuttonentry_add - * @{ - * @objective Negative Test case 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_multibuttonentry_add_n) -{ - if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_multibuttonentry_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_multibuttonentry_add() -{ - TCase *tcase = tcase_create("utc_elm_multibuttonentry_add"); - tcase_set_timeout(tcase, 30); - tcase_add_checked_fixture(tcase, setup, teardown); - tcase_add_test(tcase, utc_elm_multibuttonentry_add_p); - tcase_add_test(tcase, utc_elm_multibuttonentry_add_n); - return tcase; -} diff --git a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_get.c b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_get.c deleted file mode 100644 index 9d544e8e..00000000 --- a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_get.c +++ /dev/null @@ -1,108 +0,0 @@ -#include -#include -#include "../utc_elm_common.h" -static Evas_Object *main_win = NULL; - -/** - * @addtogroup elm_multibuttonentry - * @{ - * @defgroup elm_multibuttonentry_editable_get elm_multibuttonentry_editable_get() - * - * @precondition - * @step 1 Create main window. - */ -static void -setup(void) -{ - printf(" ============ Startup ============ \n"); - UTC_ELM_INIT(); - main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); -} - -static void -teardown(void) -{ - if ( NULL != main_win ) - { - evas_object_del(main_win); - main_win = NULL; - } - elm_shutdown(); - printf(" ============ Cleanup ============ \n"); -} - -/** - * @addtogroup elm_multibuttonentry_editable_get - * @{ - * @objective Positive test case 01: Gets whether the multibuttonentry is editable or not - * @n Input Data: - * @li obj The multibuttonentry object - * - * @procedure - * @step 1 Add a new multibuttonentry to the main_win. - * @step 2 Set the multibuttonentry editable. - * @step 3 Get whether the multibuttonentry is editable or not. - * - * @passcondition: Returned value should be EINA_TRUE if the multibuttonentry is editable, EINA_FALSE otherwise. - * @} - */ -START_TEST(utc_UIFW_elm_multibuttonentry_editable_get_p_1) -{ - Evas_Object *multibuttonentry = NULL; - multibuttonentry = elm_multibuttonentry_add(main_win); - - elm_multibuttonentry_editable_set(multibuttonentry, EINA_TRUE); - if (!elm_multibuttonentry_editable_get(multibuttonentry)) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); - return; - } - - elm_multibuttonentry_editable_set(multibuttonentry, EINA_FALSE); - if (elm_multibuttonentry_editable_get(multibuttonentry)) - { - evas_object_del(multibuttonentry); - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); - return; - } - - evas_object_del(multibuttonentry); - printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); - return; -} -END_TEST - -/** - * @addtogroup elm_multibuttonentry_editable_get - * @{ - * @objective Negative test case 01: Gets whether the multibuttonentry is editable or not - * @n Input Data: - * @li obj The multibuttonentry object - * - * @procedure - * @step 1 Call elm_multibuttonentry_editable_get() with NULL. - * - * @passcondition: No crash. Test passes if API completes successfully. - * @} - */ -START_TEST(utc_UIFW_elm_multibuttonentry_editable_get_n_1) -{ - elm_multibuttonentry_editable_get(NULL); - printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); - return; -} -END_TEST - -/** - *@} - */ - -TCase * _utc_elm_multibuttonentry_editable_get() -{ - TCase *tcase = tcase_create("utc_elm_multibuttonentry_editable_get"); - tcase_set_timeout(tcase, 30); - tcase_add_checked_fixture(tcase, setup, teardown); - tcase_add_test(tcase, utc_UIFW_elm_multibuttonentry_editable_get_p_1); - tcase_add_test(tcase, utc_UIFW_elm_multibuttonentry_editable_get_n_1); - return tcase; -} diff --git a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_get_set.c b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_get_set.c new file mode 100644 index 00000000..3943fda8 --- /dev/null +++ b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_get_set.c @@ -0,0 +1,155 @@ +#include +#include +#include "../utc_elm_common.h" +#include "../../utc_negative_unitest.h" + +static Evas_Object *main_win = NULL; + +/** + * @addtogroup elm_multibuttonentry + * @{ + * @defgroup elm_multibuttonentry_editable_get elm_multibuttonentry_editable_get() + * + * @precondition + * @step 1 Create main window. + */ +static void +setup(void) +{ + printf(" ============ Startup ============ \n"); + UTC_ELM_INIT(); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); +} + +static void +teardown(void) +{ + if ( NULL != main_win ) + { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + printf(" ============ Cleanup ============ \n"); +} + +/** + * @addtogroup elm_multibuttonentry_editable_get + * @{ + * @objective Positive test case 01: Gets whether the multibuttonentry is editable or not + * @n Input Data: + * @li obj The multibuttonentry object + * + * @procedure + * @step 1 Add a new multibuttonentry to the main_win. + * @step 2 Set the multibuttonentry editable. + * @step 3 Get whether the multibuttonentry is editable or not. + * + * @passcondition: Returned value should be EINA_TRUE if the multibuttonentry is editable, EINA_FALSE otherwise. + * @} + */ +START_TEST(utc_elm_multibuttonentry_editable_get_p_1) +{ + Evas_Object *multibuttonentry = NULL; + multibuttonentry = elm_multibuttonentry_add(main_win); + + elm_multibuttonentry_editable_set(multibuttonentry, EINA_TRUE); + if (!elm_multibuttonentry_editable_get(multibuttonentry)) + { + ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); + } + + elm_multibuttonentry_editable_set(multibuttonentry, EINA_FALSE); + if (elm_multibuttonentry_editable_get(multibuttonentry)) + { + evas_object_del(multibuttonentry); + ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); + } + + evas_object_del(multibuttonentry); + printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); + return; +} +END_TEST + +/** + * @addtogroup elm_multibuttonentry_editable_get + * @{ + * @objective Negative test case 01: Gets whether the multibuttonentry is editable or not + * @n Input Data: + * @li obj The multibuttonentry object + * + * @procedure + * @step 1 Call elm_multibuttonentry_editable_get() with NULL. + * + * @passcondition: No crash. Test passes if API completes successfully. + * @} + */ +START_TEST(utc_elm_multibuttonentry_editable_get_n_1) +{ + elm_multibuttonentry_editable_get(NULL); + printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); + return; +} +END_TEST + +/** + * @addtogroup elm_multibuttonentry_editable_set + * @{ + * @objective Negative test case 01: Call function with NULL as multibuttonentry parameter. + * @n Input Data: + * @li NULL as the multibuttonentry object; + * @li EINA_TRUE to make multibutonentry editable. + * + * @procedure + * @step 1 Call elm_multibuttonentry_editable_set() with NULL. + * + * @passcondition: Return type of this API is void. Test passes if API completes successfully. + * @} + */ +START_TEST(utc_elm_multibuttonentry_editable_set_n_1) +{ + elm_multibuttonentry_editable_set(NULL, EINA_TRUE); + printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); + return; +} +END_TEST + +/** + * @addtogroup elm_multibuttonentry_add + * @{ + * @objective Negative Test case 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_multibuttonentry_add_n) +{ + if (TEST_FAIL == UNITEST_FUNC_NEG_RET(NULL, elm_multibuttonentry_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 * _utc_elm_multibuttonentry_editable_get_set() +{ + TCase *tcase = tcase_create("utc_elm_multibuttonentry_editable_get_set"); + tcase_set_timeout(tcase, 30); + tcase_add_checked_fixture(tcase, setup, teardown); + tcase_add_test(tcase, utc_elm_multibuttonentry_editable_get_p_1); + tcase_add_test(tcase, utc_elm_multibuttonentry_editable_get_n_1); + tcase_add_test(tcase, utc_elm_multibuttonentry_editable_set_n_1); + tcase_add_test(tcase, utc_elm_multibuttonentry_add_n); + return tcase; +} diff --git a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_set.c b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_set.c deleted file mode 100644 index 963322f8..00000000 --- a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_editable_set.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include "../utc_elm_common.h" -static Evas_Object *main_win = NULL; - -/** - * @addtogroup elm_multibuttonentry - * @{ - * @defgroup elm_multibuttonentry_editable_set elm_multibuttonentry_editable_set() - * - * @precondition - * @step 1 Create main window. - */ -static void -setup(void) -{ - printf(" ============ Startup ============ \n"); - UTC_ELM_INIT(); - main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); -} - -static void -teardown(void) -{ - if ( NULL != main_win ) - { - evas_object_del(main_win); - main_win = NULL; - } - elm_shutdown(); - printf(" ============ Cleanup ============ \n"); -} - -/** - * @addtogroup elm_multibuttonentry_editable_set - * @{ - * @objective Positive test case 01: Call function with correct parameters - * @n Input Data: - * @li the multibuttonentry object; - * @li EINA_TRUE/EINA_FALSE to make multibutonentry editable or not. - * - * @procedure - * @step 1 Add a new multibuttonentry to the main_win. - * @step 2 Set the multibuttonentry editable. - * @step 3 Get whether the multibuttonentry is editable or not. - * - * @passcondition: Returned value should be EINA_TRUE if the multibuttonentry is editable, EINA_FALSE otherwise. - * @} - */ -START_TEST(utc_UIFW_elm_multibuttonentry_editable_set_p_1) -{ - Evas_Object *multibuttonentry = NULL; - multibuttonentry = elm_multibuttonentry_add(main_win); - - elm_multibuttonentry_editable_set(multibuttonentry, EINA_TRUE); - if (!elm_multibuttonentry_editable_get(multibuttonentry)) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); - return; - } - - elm_multibuttonentry_editable_set(multibuttonentry, EINA_FALSE); - if (elm_multibuttonentry_editable_get(multibuttonentry)) - { - evas_object_del(multibuttonentry); - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); - return; - } - - evas_object_del(multibuttonentry); - printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); - return; -} -END_TEST - -/** - * @addtogroup elm_multibuttonentry_editable_set - * @{ - * @objective Negative test case 01: Call function with NULL as multibuttonentry parameter. - * @n Input Data: - * @li NULL as the multibuttonentry object; - * @li EINA_TRUE to make multibutonentry editable. - * - * @procedure - * @step 1 Call elm_multibuttonentry_editable_set() with NULL. - * - * @passcondition: Return type of this API is void. Test passes if API completes successfully. - * @} - */ -START_TEST(utc_UIFW_elm_multibuttonentry_editable_set_n_1) -{ - elm_multibuttonentry_editable_set(NULL, EINA_TRUE); - printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); - return; -} -END_TEST - -/** - * @addtogroup elm_multibuttonentry_editable_set - * @{ - * @objective Negative test case 02: Call function with NULL as multibuttonentry parameter. - * @n Input Data: - * @li NULL as the multibuttonentry object; - * @li EINA_FALSE to make multibutonentry editable. - * - * @procedure - * @step 1 Call elm_multibuttonentry_editable_set() with NULL. - * - * @passcondition: Return type of this API is void. Test passes if API completes successfully. - * @} - */ -START_TEST(utc_UIFW_elm_multibuttonentry_editable_set_n_2) -{ - elm_multibuttonentry_editable_set(NULL, EINA_TRUE); - printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); - return; -} -END_TEST -/** - *@} - */ - -TCase * _utc_elm_multibuttonentry_editable_set() -{ - TCase *tcase = tcase_create("utc_elm_multibuttonentry_editable_set"); - tcase_set_timeout(tcase, 30); - tcase_add_checked_fixture(tcase, setup, teardown); - tcase_add_test(tcase, utc_UIFW_elm_multibuttonentry_editable_set_p_1); - tcase_add_test(tcase, utc_UIFW_elm_multibuttonentry_editable_set_n_1); - tcase_add_test(tcase, utc_UIFW_elm_multibuttonentry_editable_set_n_2); - return tcase; -} diff --git a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_get.c b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_get.c deleted file mode 100644 index f0c27965..00000000 --- a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_get.c +++ /dev/null @@ -1,136 +0,0 @@ -#include -#include -#include "../utc_elm_common.h" -#include "../../utc_negative_unitest.h" -static Evas_Object *main_win = NULL; -static Evas_Object *multibuttonentry = NULL; -static Elm_Object_Item *item = NULL; - -/** - * @addtogroup elm_multibuttonentry - * @{ - * @defgroup elm_multibuttonentry_expanded_get elm_multibuttonentry_expanded_get() - * - * @precondition - * @step 1 Initialize Elementary - * @step 2 Create and show main window - * @step 3 Create a new multibuttonentry object - * @step 4 Add a new item to multibuttonentry object - */ -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); - multibuttonentry = elm_multibuttonentry_add(main_win); - if (multibuttonentry == NULL) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a multibuttonentry object..", __FILE__, __LINE__); - return; - } - item = elm_multibuttonentry_item_append(multibuttonentry, "item1", NULL, NULL); - if (item == NULL) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a multibuttonentry item..", __FILE__, __LINE__); - return; - } -} - -static void -teardown(void) -{ - if (main_win != NULL) - { - evas_object_del(main_win); - main_win = NULL; - } - elm_shutdown(); - printf(" ============ Cleanup ============ \n"); -} - -/** - * @addtogroup elm_multibuttonentry_expanded_get - * @{ - * @objective Positive Test case checks if get the value of expanded state - * works properly and doesn't cause segmentation fault - * @n Input Data: the multibuttonentry object - * - * @procedure - * @step 1 Set the value of expanded state to EINA_TRUE - * @step 2 Get the value of expanded state - * @step 3 Set the value of expanded state to EINA_FALSE - * @step 4 Get the value of expanded state - * - * @passcondition Returned value is equal to EINA_TRUE at step 2 and EINA_FALSE at step 4 and there is no segmentation fault - * @} - */ -START_TEST(utc_elm_multibuttonentry_expanded_get_p) -{ - Eina_Bool expanded = EINA_FALSE; - - if ((multibuttonentry == NULL) || (item == NULL)) - { - return; - } - elm_multibuttonentry_expanded_set(multibuttonentry, EINA_TRUE); - expanded = elm_multibuttonentry_expanded_get(multibuttonentry); - if (expanded != EINA_TRUE) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); - return; - } - elm_multibuttonentry_expanded_set(multibuttonentry, EINA_FALSE); - expanded = elm_multibuttonentry_expanded_get(multibuttonentry); - if (expanded != 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_multibuttonentry_expanded_get - * @{ - * @objective Negative Test case checks if call test function with NULL instead of the multibuttonentry object - * works properly and doesn't cause segmentation fault - * @n Input Data: NULL instead of the multibuttonentry object - * - * @procedure - * @step 1 Call test function with NULL instead of the multibuttonentry object - * - * @passcondition Returned value is EINA_FALSE and there is no segmentation fault - * @} - */ -START_TEST(utc_elm_multibuttonentry_expanded_get_n) -{ - if (UNITEST_FUNC_NEG_RET(EINA_FALSE, elm_multibuttonentry_expanded_get, multibuttonentry) == TEST_FAIL) - { - 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_multibuttonentry_expanded_get() -{ - TCase *tcase = tcase_create("utc_elm_multibuttonentry_expanded_get"); - tcase_set_timeout(tcase, 30); - tcase_add_checked_fixture(tcase, setup, teardown); - tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_get_p); - tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_get_n); - return tcase; -} diff --git a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_get_set.c b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_get_set.c new file mode 100644 index 00000000..9e931cd0 --- /dev/null +++ b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_get_set.c @@ -0,0 +1,175 @@ +#include +#include +#include "../utc_elm_common.h" +#include "../../utc_negative_unitest.h" +static Evas_Object *main_win = NULL; +static Evas_Object *multibuttonentry = NULL; +static Elm_Object_Item *item = NULL; + +/** + * @addtogroup elm_multibuttonentry + * @{ + * @defgroup elm_multibuttonentry_expanded_set elm_multibuttonentry_expanded_set() + * + * @precondition + * @step 1 Initialize Elementary + * @step 2 Create and show main window + * @step 3 Create a new multibuttonentry object + * @step 4 Add a new item to multibuttonentry object + */ +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__); + } + evas_object_show(main_win); + multibuttonentry = elm_multibuttonentry_add(main_win); + if (multibuttonentry == NULL) + { + ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a multibuttonentry object..", __FILE__, __LINE__); + } + item = elm_multibuttonentry_item_append(multibuttonentry, "item1", NULL, NULL); + if (item == NULL) + { + ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a multibuttonentry item..", __FILE__, __LINE__); + } +} + +static void +teardown(void) +{ + if (main_win != NULL) + { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + printf(" ============ Cleanup ============ \n"); +} + +/** + * @addtogroup elm_multibuttonentry_expanded_set + * @{ + * @objective Positive Test case 01: checks if set the value of expanded state + * works properly and doesn't cause segmentation fault + * @n Input Data: + * @li the multibuttonentry object + * @li EINA_TRUE, EINA_FALSE + * + * @procedure + * @step 1 Set the value of expanded state to EINA_TRUE + * @step 2 Get the value of expanded state + * @step 3 Set the value of expanded state to EINA_FALSE + * @step 4 Get the value of expanded state + * + * @passcondition Returned value is equal to EINA_TRUE at step 2 and EINA_FALSE at step 4 and there is no segmentation fault + * @} + */ +START_TEST(utc_elm_multibuttonentry_expanded_set_p_1) +{ + Eina_Bool expanded = EINA_FALSE; + elm_multibuttonentry_expanded_set(multibuttonentry, EINA_TRUE); + expanded = elm_multibuttonentry_expanded_get(multibuttonentry); + if (expanded != EINA_TRUE) + { + ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); + } + elm_multibuttonentry_expanded_set(multibuttonentry, EINA_FALSE); + expanded = elm_multibuttonentry_expanded_get(multibuttonentry); + if (expanded != EINA_FALSE) + { + 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 + +/** + * @addtogroup elm_multibuttonentry_expanded_set + * @{ + * @objective Negative Test case 01: checks if call test function with NULL instead of the multibuttonentry object + * doesn't cause segmentation fault + * @n Input Data: + * @li NULL instead of the multibuttonentry object + * @li EINA_FALSE + * + * @procedure + * @step 1 Call test function with NULL instead of the multibuttonentry object + * + * @passcondition There is no segmentation fault + * @} + */ +START_TEST(utc_elm_multibuttonentry_expanded_set_n_1) +{ + CREATE_CHECKED_ARGS_ARRAY(1, 0); + UNITEST_FUNC_NEG_CA(elm_multibuttonentry_expanded_set, multibuttonentry, EINA_FALSE); + printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); +} +END_TEST + +/** + * @addtogroup elm_multibuttonentry_expanded_set + * @{ + * @objective Negative Test case 02: checks if call test function with NULL instead of the multibuttonentry object + * doesn't cause segmentation fault + * @n Input Data: + * @li NULL instead of the multibuttonentry object + * @li EINA_TRUE + * + * @procedure + * @step 1 Call test function with NULL instead of the multibuttonentry object + * + * @passcondition There is no segmentation fault + * @} + */ +START_TEST(utc_elm_multibuttonentry_expanded_set_n_2) +{ + CREATE_CHECKED_ARGS_ARRAY(1, 0); + UNITEST_FUNC_NEG_CA(elm_multibuttonentry_expanded_set, multibuttonentry, EINA_TRUE); + printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); +} +END_TEST + +/** + * @addtogroup elm_multibuttonentry_expanded_get + * @{ + * @objective Negative Test case checks if call test function with NULL instead of the multibuttonentry object + * works properly and doesn't cause segmentation fault + * @n Input Data: NULL instead of the multibuttonentry object + * + * @procedure + * @step 1 Call test function with NULL instead of the multibuttonentry object + * + * @passcondition Returned value is EINA_FALSE and there is no segmentation fault + * @} + */ +START_TEST(utc_elm_multibuttonentry_expanded_get_n) +{ + if (UNITEST_FUNC_NEG_RET(EINA_FALSE, elm_multibuttonentry_expanded_get, multibuttonentry) == 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_elm_multibuttonentry_expanded_get_set() +{ + TCase *tcase = tcase_create("utc_elm_multibuttonentry_expanded_get_set"); + tcase_set_timeout(tcase, 30); + tcase_add_checked_fixture(tcase, setup, teardown); + tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_set_p_1); + tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_set_n_1); + tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_set_n_2); + tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_get_n); + return tcase; +} diff --git a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_set.c b/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_set.c deleted file mode 100644 index 3835709c..00000000 --- a/TC/elementary/multibuttonentry/utc_elm_multibuttonentry_expanded_set.c +++ /dev/null @@ -1,161 +0,0 @@ -#include -#include -#include "../utc_elm_common.h" -#include "../../utc_negative_unitest.h" -static Evas_Object *main_win = NULL; -static Evas_Object *multibuttonentry = NULL; -static Elm_Object_Item *item = NULL; - -/** - * @addtogroup elm_multibuttonentry - * @{ - * @defgroup elm_multibuttonentry_expanded_set elm_multibuttonentry_expanded_set() - * - * @precondition - * @step 1 Initialize Elementary - * @step 2 Create and show main window - * @step 3 Create a new multibuttonentry object - * @step 4 Add a new item to multibuttonentry object - */ -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); - multibuttonentry = elm_multibuttonentry_add(main_win); - if (multibuttonentry == NULL) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a multibuttonentry object..", __FILE__, __LINE__); - return; - } - item = elm_multibuttonentry_item_append(multibuttonentry, "item1", NULL, NULL); - if (item == NULL) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to create a multibuttonentry item..", __FILE__, __LINE__); - return; - } -} - -static void -teardown(void) -{ - if (main_win != NULL) - { - evas_object_del(main_win); - main_win = NULL; - } - elm_shutdown(); - printf(" ============ Cleanup ============ \n"); -} - -/** - * @addtogroup elm_multibuttonentry_expanded_set - * @{ - * @objective Positive Test case 01: checks if set the value of expanded state - * works properly and doesn't cause segmentation fault - * @n Input Data: - * @li the multibuttonentry object - * @li EINA_TRUE, EINA_FALSE - * - * @procedure - * @step 1 Set the value of expanded state to EINA_TRUE - * @step 2 Get the value of expanded state - * @step 3 Set the value of expanded state to EINA_FALSE - * @step 4 Get the value of expanded state - * - * @passcondition Returned value is equal to EINA_TRUE at step 2 and EINA_FALSE at step 4 and there is no segmentation fault - * @} - */ -START_TEST(utc_elm_multibuttonentry_expanded_set_p_1) -{ - Eina_Bool expanded = EINA_FALSE; - - if ((multibuttonentry == NULL) || (item == NULL)) - { - return; - } - elm_multibuttonentry_expanded_set(multibuttonentry, EINA_TRUE); - expanded = elm_multibuttonentry_expanded_get(multibuttonentry); - if (expanded != EINA_TRUE) - { - ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__); - return; - } - elm_multibuttonentry_expanded_set(multibuttonentry, EINA_FALSE); - expanded = elm_multibuttonentry_expanded_get(multibuttonentry); - if (expanded != 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_multibuttonentry_expanded_set - * @{ - * @objective Negative Test case 01: checks if call test function with NULL instead of the multibuttonentry object - * doesn't cause segmentation fault - * @n Input Data: - * @li NULL instead of the multibuttonentry object - * @li EINA_FALSE - * - * @procedure - * @step 1 Call test function with NULL instead of the multibuttonentry object - * - * @passcondition There is no segmentation fault - * @} - */ -START_TEST(utc_elm_multibuttonentry_expanded_set_n_1) -{ - CREATE_CHECKED_ARGS_ARRAY(1, 0); - UNITEST_FUNC_NEG_CA(elm_multibuttonentry_expanded_set, multibuttonentry, EINA_FALSE); - printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); -} -END_TEST - -/** - * @addtogroup elm_multibuttonentry_expanded_set - * @{ - * @objective Negative Test case 02: checks if call test function with NULL instead of the multibuttonentry object - * doesn't cause segmentation fault - * @n Input Data: - * @li NULL instead of the multibuttonentry object - * @li EINA_TRUE - * - * @procedure - * @step 1 Call test function with NULL instead of the multibuttonentry object - * - * @passcondition There is no segmentation fault - * @} - */ -START_TEST(utc_elm_multibuttonentry_expanded_set_n_2) -{ - CREATE_CHECKED_ARGS_ARRAY(1, 0); - UNITEST_FUNC_NEG_CA(elm_multibuttonentry_expanded_set, multibuttonentry, EINA_TRUE); - printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); -} -END_TEST - -/** - *@} - */ - -TCase * _utc_elm_multibuttonentry_expanded_set() -{ - TCase *tcase = tcase_create("utc_elm_multibuttonentry_expanded_set"); - tcase_set_timeout(tcase, 30); - tcase_add_checked_fixture(tcase, setup, teardown); - tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_set_p_1); - tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_set_n_1); - tcase_add_test(tcase, utc_elm_multibuttonentry_expanded_set_n_2); - return tcase; -}