From: Taehyub Kim Date: Thu, 11 Jun 2020 06:42:54 +0000 (+0900) Subject: elm_popup: add elm_popup_scrollable_set/get api tcs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ded9eeefa8e33d8c7c9f48c1e16ceb0f98f1e47b;p=test%2Ftct%2Fnative%2Fefl-test-suite.git elm_popup: add elm_popup_scrollable_set/get api tcs Change-Id: Icad423e1108135149105a5487208a871891bad64 --- diff --git a/TC/elementary/popup/tslist b/TC/elementary/popup/tslist index 6419e7c0..0a929dbe 100644 --- a/TC/elementary/popup/tslist +++ b/TC/elementary/popup/tslist @@ -5,3 +5,4 @@ utc_elm_popup_orient_get_set.c utc_elm_popup_timeout_get_set.c utc_elm_popup_align_get_set.c utc_elm_popup_dismiss.c +utc_elm_popup_scrollable_get_set.c diff --git a/TC/elementary/popup/tslist_fhub b/TC/elementary/popup/tslist_fhub index 6419e7c0..0a929dbe 100644 --- a/TC/elementary/popup/tslist_fhub +++ b/TC/elementary/popup/tslist_fhub @@ -5,3 +5,4 @@ utc_elm_popup_orient_get_set.c utc_elm_popup_timeout_get_set.c utc_elm_popup_align_get_set.c utc_elm_popup_dismiss.c +utc_elm_popup_scrollable_get_set.c diff --git a/TC/elementary/popup/tslist_mobile b/TC/elementary/popup/tslist_mobile index 6419e7c0..0a929dbe 100644 --- a/TC/elementary/popup/tslist_mobile +++ b/TC/elementary/popup/tslist_mobile @@ -5,3 +5,4 @@ utc_elm_popup_orient_get_set.c utc_elm_popup_timeout_get_set.c utc_elm_popup_align_get_set.c utc_elm_popup_dismiss.c +utc_elm_popup_scrollable_get_set.c diff --git a/TC/elementary/popup/tslist_tv b/TC/elementary/popup/tslist_tv index 1b32462f..be0a2a67 100644 --- a/TC/elementary/popup/tslist_tv +++ b/TC/elementary/popup/tslist_tv @@ -5,3 +5,4 @@ utc_elm_popup_orient_get_set.c utc_elm_popup_timeout_get_set.c utc_elm_popup_align_get_set.c #utc_elm_popup_dismiss.c +utc_elm_popup_scrollable_get_set.c diff --git a/TC/elementary/popup/tslist_wear b/TC/elementary/popup/tslist_wear index 6419e7c0..0a929dbe 100644 --- a/TC/elementary/popup/tslist_wear +++ b/TC/elementary/popup/tslist_wear @@ -5,3 +5,4 @@ utc_elm_popup_orient_get_set.c utc_elm_popup_timeout_get_set.c utc_elm_popup_align_get_set.c utc_elm_popup_dismiss.c +utc_elm_popup_scrollable_get_set.c diff --git a/TC/elementary/popup/utc_elm_popup_scrollable_get_set.c b/TC/elementary/popup/utc_elm_popup_scrollable_get_set.c new file mode 100644 index 00000000..0d70c8e2 --- /dev/null +++ b/TC/elementary/popup/utc_elm_popup_scrollable_get_set.c @@ -0,0 +1,153 @@ +#include +#include +#include "../../utc_negative_unitest.h" +Evas_Object *main_win = NULL, *popup = NULL; + +/** + * @addtogroup elm_popup + * @{ + * @defgroup elm_popup_scrollable_set elm_popup_scrollable_set() + * + * @precondition + * @step 1 Initialize Elementary + * @step 2 Create and show main window + * @step 3 Add a popup to the main window + */ + +static void +setup(void) +{ + 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; + } + evas_object_show(main_win); + popup = elm_popup_add(main_win); + if (popup == NULL) + { + ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to add a box to the main window..", __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_popup_scrollable_set + * @{ + * @objective Positive Test case p_1 checks if function call with valid values to set the scroller + * of the popup object works properly and without segmentation fault + * @n Input Data: + * @li the popup object + * @li the scroller value + * + * @procedure + * @step 1 Call elm_popup_scrollable_set with valid values + * @step 2 Get the scroll value of the popup object + * + * @passcondition Test passes if returned value is same as specified value and there is no segmentation fault + * @} + */ + +START_TEST(utc_elm_popup_scrollable_get_set_p_1) +{ + if (main_win == NULL || popup == NULL) + { + return; + } + + elm_popup_scrollable_set(popup, EINA_TRUE); + Eina_Bool ret = elm_popup_scrollable_get(popup); + if (!ret) + { + 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_popup_scrollable_set + * @{ + * @objective Negative Test case n_1 checks if function call with invalid value to get the scroller + * of the popup object works properly and without segmentation fault + * @n Input Data: + * @li NULL instead of the popup object + * + * @procedure + * @step 1 Call elm_popup_scrollable_get_set with invalid value instead of the popup object + * + * @passcondition Test passes if there is no segmentation fault + * @} + */ + +START_TEST(utc_elm_popup_scrollable_get_n_1) +{ + if (main_win == NULL || popup == NULL) + { + return; + } + + Eina_Bool ret = elm_popup_scrollable_get(NULL); + if (ret) + { + 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_popup_scrollable_set + * @{ + * @objective Negative Test case n_1 checks if function call with invalid value to set the scroller + * of the popup object works properly and without segmentation fault + * @n Input Data: + * @li NULL instead of the popup object + * + * @procedure + * @step 1 Call elm_popup_scrollable_set with invalid value instead of the popup object + * + * @passcondition Test passes if there is no segmentation fault + * @} + */ + +START_TEST(utc_elm_popup_scrollable_set_n_1) +{ + if (main_win == NULL || popup == NULL) + { + return; + } + + elm_popup_scrollable_set(NULL, EINA_TRUE); + printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__); +} +END_TEST + + +TCase * _utc_elm_popup_scrollable_get_set() +{ + TCase *tcase = tcase_create("utc_elm_popup_scrollable_get_set"); + tcase_set_timeout(tcase, 30); + tcase_add_checked_fixture(tcase, setup, teardown); + tcase_add_test(tcase, utc_elm_popup_scrollable_get_set_p_1); + tcase_add_test(tcase, utc_elm_popup_scrollable_get_n_1); + tcase_add_test(tcase, utc_elm_popup_scrollable_set_n_1); + return tcase; +}