Merged TCs to reduce duplicate test operations.
Change-Id: Id4786e935ed10feb2ef41e3a7db7620df9cae1c5
utc_elm_object_scroll_item_loop_enabled.c
utc_elm_object_disabled_set.c
utc_elm_object_disabled_get.c
-utc_elm_object_focus_set.c
utc_elm_object_access_info_set.c
utc_elm_object_access_info_get.c
utc_elm_object_parent_widget_get.c
utc_elm_object_cursor_unset.c
utc_elm_object_cursor_style_set.c
utc_elm_object_cursor_style_get.c
-utc_elm_object_focus_get.c
+utc_elm_object_focus_get_set_next.c
utc_elm_object_focus_custom_chain_append.c
utc_elm_object_focus_custom_chain_prepend.c
utc_elm_object_focus_custom_chain_set.c
utc_elm_object_domain_translatable_part_text_set.c
#utc_elm_object_domain_translatable_text_part_set.c
utc_elm_object_focus_custom_chain_unset.c
-utc_elm_object_focus_next.c
utc_elm_object_focus_next_object_get.c
utc_elm_object_focus_next_object_set.c
utc_elm_object_focused_object_get.c
utc_elm_object_scroll_item_loop_enabled.c
utc_elm_object_disabled_set.c
utc_elm_object_disabled_get.c
-#utc_elm_object_focus_set.c
utc_elm_object_access_info_set.c
utc_elm_object_access_info_get.c
utc_elm_object_parent_widget_get.c
utc_elm_object_cursor_unset.c
utc_elm_object_cursor_style_set.c
utc_elm_object_cursor_style_get.c
-#utc_elm_object_focus_get.c
+#utc_elm_object_focus_get_set_next.c
utc_elm_object_focus_custom_chain_append.c
utc_elm_object_focus_custom_chain_prepend.c
utc_elm_object_focus_custom_chain_set.c
utc_elm_object_domain_translatable_part_text_set.c
#utc_elm_object_domain_translatable_text_part_set.c
utc_elm_object_focus_custom_chain_unset.c
-#utc_elm_object_focus_next.c
utc_elm_object_focus_next_object_get.c
utc_elm_object_focus_next_object_set.c
utc_elm_object_focused_object_get.c
utc_elm_object_scroll_item_loop_enabled.c
utc_elm_object_disabled_set.c
utc_elm_object_disabled_get.c
-utc_elm_object_focus_set.c
utc_elm_object_access_info_set.c
utc_elm_object_access_info_get.c
utc_elm_object_parent_widget_get.c
utc_elm_object_cursor_unset.c
utc_elm_object_cursor_style_set.c
utc_elm_object_cursor_style_get.c
-utc_elm_object_focus_get.c
+utc_elm_object_focus_get_set_next.c
utc_elm_object_focus_custom_chain_append.c
utc_elm_object_focus_custom_chain_prepend.c
utc_elm_object_focus_custom_chain_set.c
utc_elm_object_domain_translatable_part_text_set.c
#utc_elm_object_domain_translatable_text_part_set.c
utc_elm_object_focus_custom_chain_unset.c
-utc_elm_object_focus_next.c
utc_elm_object_focus_next_object_get.c
utc_elm_object_focus_next_object_set.c
utc_elm_object_focused_object_get.c
#utc_elm_object_scroll_item_loop_enabled.c
utc_elm_object_disabled_set.c
utc_elm_object_disabled_get.c
-utc_elm_object_focus_set.c
utc_elm_object_access_info_set.c
#utc_elm_object_access_info_get.c
utc_elm_object_parent_widget_get.c
utc_elm_object_cursor_unset.c
utc_elm_object_cursor_style_set.c
utc_elm_object_cursor_style_get.c
-utc_elm_object_focus_get.c
+utc_elm_object_focus_get_set_next.c
utc_elm_object_focus_custom_chain_append.c
utc_elm_object_focus_custom_chain_prepend.c
utc_elm_object_focus_custom_chain_set.c
utc_elm_object_domain_translatable_part_text_set.c
#utc_elm_object_domain_translatable_text_part_set.c
utc_elm_object_focus_custom_chain_unset.c
-utc_elm_object_focus_next.c
utc_elm_object_focus_next_object_get.c
utc_elm_object_focus_next_object_set.c
utc_elm_object_focused_object_get.c
#utc_elm_object_scroll_item_loop_enabled.c
utc_elm_object_disabled_set.c
utc_elm_object_disabled_get.c
-utc_elm_object_focus_set.c
utc_elm_object_access_info_set.c
#utc_elm_object_access_info_get.c
utc_elm_object_parent_widget_get.c
utc_elm_object_cursor_unset.c
utc_elm_object_cursor_style_set.c
utc_elm_object_cursor_style_get.c
-utc_elm_object_focus_get.c
+utc_elm_object_focus_get_set_next.c
utc_elm_object_focus_custom_chain_append.c
utc_elm_object_focus_custom_chain_prepend.c
utc_elm_object_focus_custom_chain_set.c
utc_elm_object_domain_translatable_part_text_set.c
#utc_elm_object_domain_translatable_text_part_set.c
utc_elm_object_focus_custom_chain_unset.c
-utc_elm_object_focus_next.c
utc_elm_object_focus_next_object_get.c
utc_elm_object_focus_next_object_set.c
utc_elm_object_focused_object_get.c
+++ /dev/null
-#include <check.h>
-#include "utc_util_elm_widget_create.h"
-#include "../../utc_negative_unitest.h"
-Evas_Object *main_win = NULL;
-
-#define WAIT_FOR(duration) \
- do \
- { \
- if (ecore_timer_add(duration, _timer_cb, NULL) == NULL) \
- { \
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed (timer cannot be created for testing)..", __FILE__, __LINE__); \
- return; \
- } \
- ecore_main_loop_begin(); \
- } while (0);
-
-
-/**
- * @addtogroup elm_object
- * @{
- * @defgroup elm_object_focus_get elm_object_focus_get()
- *
- * @precondition
- * @step 1 Initialize Elementary
- * @step 2 Create and show 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);
-}
-
-static void
-teardown(void)
-{
- if (main_win != NULL)
- {
- evas_object_del(main_win);
- main_win = NULL;
- }
- elm_shutdown();
- printf(" ============ Cleanup ============ \n");
-}
-
-static Eina_Bool _timer_cb(void *data)
-{
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-/**
- * @addtogroup elm_object_focus_get
- * @{
- * @objective Positive Test case checks if function call with valid values to get the whether the Elementary object
- * has the focus or not works properly and without segmentation fault
- * @n Input Data:
- * @li the Elementary object to operate on
- *
- * @procedure
- * @step 1 Run the application main loop
- * @step 2 Get the list of widgets
- * @step 3 Allow focusable for every widget in list
- * @step 4 Show every widget in list
- * @step 5 Traverse the list of widgets
- * @step 6 Get whether the Elementary object is focusable or not. If the object is unfocusable then ignore it and go to the next object
- * @step 7 Set focus to a given Elementary object
- * @step 8 Call elm_object_focus_get with valid value
- * @step 9 Unset focus to a given Elementary object
- * @step 10 Call elm_object_focus_get with valid value
- *
- * @passcondition
- * @li Test passes if returned value is same as specified value and there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_object_focus_get_p)
-{
- Eina_List *widgets = NULL, *l = NULL;
- Evas_Object *obj = NULL;
- Eina_Bool ret_focus = EINA_FALSE, is_object_focusable = EINA_TRUE, pass = EINA_FALSE;
- char *widget_type = NULL;
-
- if (main_win == NULL)
- {
- return;
- }
-
- widgets = utc_util_elm_not_container_widget_list_get(main_win);
- if (widgets == NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to get a list of widgets..", __FILE__, __LINE__);
- return;
- }
-
- for (l = widgets; l; l = eina_list_next(l))
- {
- obj = (Evas_Object *) eina_list_data_get(l);
- if (obj)
- {
- elm_object_focus_allow_set(obj, EINA_TRUE);
- evas_object_show(obj);
- widget_type = elm_object_widget_type_get(obj);
- printf("[TEST_MSG]:: %s[%d] : Widget %s is testing...", __FILE__, __LINE__, widget_type);
- is_object_focusable = elm_object_focus_allow_get(obj);
- if (is_object_focusable == EINA_FALSE)
- {
- printf("[TEST_MSG]:: %s[%d] : Widget %s can't be focused", __FILE__, __LINE__, widget_type);
- continue;
- }
- elm_object_focus_set(obj, EINA_TRUE);
- WAIT_FOR(0.2)
- ret_focus = elm_object_focus_get(obj);
- if (ret_focus == EINA_FALSE)
- {
- printf("[TEST_MSG]:: %s[%d] : Widget %s can't focus set", __FILE__, __LINE__, widget_type);
- continue;
- }
- elm_object_focus_set(obj, EINA_FALSE);
- WAIT_FOR(0.2)
- ret_focus = elm_object_focus_get(obj);
- if (ret_focus == EINA_TRUE)
- {
- printf("[TEST_MSG]:: %s[%d] : Widget %s can't focus unset", __FILE__, __LINE__, widget_type);
- continue;
- }
- pass = EINA_TRUE;
- printf("[TEST_MSG]:: %s[%d] : Widget %s focused and unfocused. Test is ok", __FILE__, __LINE__, widget_type);
- }
- }
- if (pass)
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- else
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to get any appropriate widget object..", __FILE__, __LINE__);
- }
-}
-END_TEST
-
-/**
- * @addtogroup elm_object_focus_get
- * @{
- * @objective Negative Test case checks if function call with invalid value to get the whether the Elementary object
- * has the focus or not works properly and without segmentation fault
- * @n Input Data:
- * @li NULL instead of the Elementary object to operate on
- *
- * @procedure
- * @step 1 Call elm_object_focus_get with invalid value instead of the Elementary object to operate on
- *
- * @passcondition
- * @li Test passes if returned value is EINA_FALSE and there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_object_focus_get_n)
-{
- Evas_Object *obj = NULL;
-
- if (TEST_FAIL == UNITEST_FUNC_NEG_RET(EINA_FALSE, elm_object_focus_get, obj))
- {
- 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
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_elm_object_focus_get");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_elm_object_focus_get_p);
- tcase_add_test(tcase, utc_elm_object_focus_get_n);
- suite_add_tcase(suite, tcase);
-
- return suite;
-}
-
-int
-main()
-{
- int number_failed;
-
- Suite *suite = test_suite();
- SRunner *srunner = srunner_create(suite);
- srunner_set_log(srunner, "utc_elm_object_focus_get.log");
- srunner_set_xml(srunner, "utc_elm_object_focus_get.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
--- /dev/null
+#include <check.h>
+#include "utc_util_elm_widget_create.h"
+#include "../../utc_negative_unitest.h"
+
+#define WAIT_FOR(duration) \
+ do \
+ { \
+ if (ecore_timer_add(duration, _timer_cb, NULL) == NULL) \
+ { \
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (timer cannot be created for testing)..", __FILE__, __LINE__); \
+ } \
+ ecore_main_loop_begin(); \
+ } while (0);
+
+static Evas_Object *main_win = NULL;
+
+/**
+ * @addtogroup elm_object
+ * @{
+ * @defgroup elm_object_focus_next elm_object_focus_next()
+ *
+ * @precondition
+ * @step 1 elm initialized with elm_init().
+ * @step 2 A window object created and showed.
+ */
+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__);
+ }
+ 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");
+}
+
+static Eina_Bool _timer_cb(void *data)
+{
+ ecore_main_loop_quit();
+ return EINA_FALSE;
+}
+
+/**
+ * @addtogroup elm_object_focus_get, elm_object_focus_set, elm_object_focus_next
+ * @{
+ * @objective Positive Test case checks if function call with valid values to unset/set focus to a given Elementary object
+ * @and get if the Elementary object has the focus or not. Also checks if focus to next object in object tree works properly.
+ * @n Input Data:
+ * @li the Elementary object to operate on.
+ * @li EINA_TRUE, EINA_FALSE as the flag's value to set/unset focus, ELM_FOCUS_NEXT focus direction.
+ *
+ * @procedure
+ * @step 1 Get widgets list.
+ * @step 2 Traverse the widgets list.
+ * @step 3 Allow focusable for every widget in list
+ * @step 4 Show every widget in list
+ * @step 5 Check if the Elementary object is focusable or not. If the object is unfocusable then ignore it and go to the next object
+ * @step 6 For given available widget, unset focus.
+ * @step 7 Check if the Elementary object has the focus or not.
+ * @step 8 For given available widget, set focus.
+ * @step 9 Check if the Elementary object has the focus or not.
+ * @step 10 For the focus object set focus next object with ELM_FOCUS_NEXT focus direction.
+ * @step 10 Check if next object which was set with specific focus direction is same as expected.
+ * @step 11 Give focus to next object with ELM_FOCUS_NEXT focus direction.
+ * @step 12 Check if next object has the focus or not.
+ *
+ * @passcondition: Test passes if the next object is focused.
+ * @}
+ */
+START_TEST(utc_elm_object_focus_get_set_next_p)
+{
+ Eina_List *widgets = NULL;
+ Eina_List *l = NULL;
+ Evas_Object *obj = NULL;
+ Eina_Bool ret_focus = EINA_FALSE, is_object_focusable = EINA_TRUE, pass = EINA_FALSE;
+ char *widget_type = NULL;
+
+ widgets = utc_util_elm_not_container_widget_list_get(main_win);
+ if (!widgets)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ Evas_Object *button_next = elm_button_add(main_win);
+ evas_object_show(button_next);
+
+ for (l = widgets; l; l = eina_list_next(l))
+ {
+ obj = (Evas_Object *) eina_list_data_get(l);
+ if (obj)
+ {
+ elm_object_focus_allow_set(obj, EINA_TRUE);
+ evas_object_show(obj);
+ widget_type = elm_object_widget_type_get(obj);
+ printf("[TEST_MSG]:: Widget %s is testing...\n", widget_type);
+ is_object_focusable = elm_object_focus_allow_get(obj);
+ if (is_object_focusable == EINA_FALSE)
+ {
+ evas_object_del(obj);
+ printf("[TEST_MSG]:: Widget %s can't be focused\n", widget_type);
+ continue;
+ }
+ elm_object_focus_set(obj, EINA_FALSE);
+ WAIT_FOR(0.1)
+ ret_focus = elm_object_focus_get(obj);
+ if (ret_focus != EINA_FALSE)
+ {
+ evas_object_del(obj);
+ printf("[TEST_MSG]:: %s[%d] : Widget %s can't focus unset", __FILE__, __LINE__, widget_type);
+ continue;
+ }
+ elm_object_focus_set(obj, EINA_TRUE);
+ WAIT_FOR(0.1)
+ ret_focus = elm_object_focus_get(obj);
+ if (ret_focus != EINA_TRUE)
+ {
+ evas_object_del(obj);
+ printf("[TEST_MSG]:: Widget %s can't focus set\n", widget_type);
+ continue;
+ }
+ elm_object_focus_next_object_set(obj, button_next, ELM_FOCUS_NEXT);
+ if (elm_object_focus_next_object_get(obj, ELM_FOCUS_NEXT) != button_next)
+ {
+ evas_object_del(obj);
+ printf("[TEST_MSG]:: Widget %s can't set next object - button\n", widget_type);
+ continue;
+ }
+ elm_object_focus_next(obj, ELM_FOCUS_NEXT);
+ WAIT_FOR(0.1)
+ if (!elm_object_focus_get(button_next))
+ {
+ evas_object_del(obj);
+ printf("[TEST_MSG]:: Widget %s can't set focus to the next object - button. Was set: %s\n", widget_type, elm_object_widget_type_get(elm_object_focused_object_get(main_win)));
+ continue;
+ }
+ pass = EINA_TRUE;
+ printf("[TEST_MSG]:: Widget %s focused and set focus to next object - button. Test is ok\n", widget_type);
+ }
+ evas_object_del(obj);
+ }
+ evas_object_del(button_next);
+ eina_list_free(widgets);
+ if (pass)
+ {
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+ }
+ else
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to get any appropriate widget object..", __FILE__, __LINE__);
+ }
+}
+END_TEST
+
+/**
+ * @addtogroup elm_object_focus_get
+ * @{
+ * @objective Negative Test case checks if function call with invalid value to get the whether the Elementary object
+ * has the focus or not works properly and without segmentation fault
+ * @n Input Data:
+ * @li NULL instead of the Elementary object to operate on
+ *
+ * @procedure
+ * @step 1 Call elm_object_focus_get with invalid value instead of the Elementary object to operate on
+ *
+ * @passcondition
+ * @li Test passes if returned value is EINA_FALSE and there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_object_focus_get_n)
+{
+ Evas_Object *obj = NULL;
+
+ if (TEST_FAIL == UNITEST_FUNC_NEG_RET(EINA_FALSE, elm_object_focus_get, obj))
+ {
+ 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_object_focus_set
+ * @{
+ * @objective Negative Test case checks if function call with invalid value to set/unset focus to a given Elementary object
+ * works without segmentation fault
+ * @n Input Data:
+ * @li NULL instead of the Elementary object to operate on
+ * @li EINA_TRUE as the flag's value to set/unset focus to a given Elementary object
+ *
+ * @procedure
+ * @step 1 Call elm_object_focus_set with invalid value instead of the Elementary object to operate on
+ *
+ * @passcondition
+ * @li Test passes if there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_object_focus_set_n)
+{
+ Evas_Object *obj = NULL;
+
+ CREATE_CHECKED_ARGS_ARRAY(1, 0)
+ UNITEST_FUNC_NEG_CA(elm_object_focus_set, obj, EINA_TRUE)
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_object_focus_next
+ * @{
+ * @objective Negative Test case : Give focus to next object of the NULL Elementary object.
+ * @n Input Data:
+ * @li NULL as the Elementary object;
+ * @li ELM_FOCUS_NEXT focus direction.
+ *
+ * @procedure
+ * @step 1 Try to give focus to next object of the NULL Elementary object.
+ *
+ * @passcondition: Return type of this API is void. Test passes if API completes successfully.
+ * @}
+ */
+START_TEST(utc_elm_object_focus_next_n)
+{
+ elm_object_focus_next(NULL, ELM_FOCUS_NEXT);
+
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ *@}
+ */
+Suite *
+test_suite(void)
+{
+ Suite *suite = suite_create("utc_elm_object_focus_get_set_next");
+
+ TCase *tcase = tcase_create("TCase");
+ tcase_set_timeout(tcase, 30);
+ tcase_add_checked_fixture(tcase, setup, teardown);
+ tcase_add_test(tcase, utc_elm_object_focus_get_set_next_p);
+ tcase_add_test(tcase, utc_elm_object_focus_get_n);
+ tcase_add_test(tcase, utc_elm_object_focus_set_n);
+ tcase_add_test(tcase, utc_elm_object_focus_next_n);
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+int
+main()
+{
+ int number_failed;
+
+ Suite *suite = test_suite();
+ SRunner *srunner = srunner_create(suite);
+ srunner_set_log(srunner, "utc_elm_object_focus_get_set_next.log");
+ srunner_set_xml(srunner, "utc_elm_object_focus_get_set_next.xml");
+ srunner_run_all(srunner, CK_NORMAL);
+ number_failed = srunner_ntests_failed(srunner);
+ srunner_free(srunner);
+
+ return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+++ /dev/null
-#include <check.h>
-#include "utc_util_elm_widget_create.h"
-
-#define WAIT_FOR(duration) \
- do \
- { \
- if (ecore_timer_add(duration, _timer_cb, NULL) == NULL) \
- { \
- ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (timer cannot be created for testing)..", __FILE__, __LINE__); \
- return; \
- } \
- ecore_main_loop_begin(); \
- } while (0);
-
-Evas_Object *main_win = NULL;
-
-/**
- * @addtogroup elm_object
- * @{
- * @defgroup elm_object_focus_next elm_object_focus_next()
- *
- * @precondition
- * @step 1 elm initialized with elm_init().
- * @step 2 A window object created and showed.
- */
-static void
-setup(void)
-{
- printf(" ============ Startup ============ \n");
- elm_init(0, NULL);
- elm_config_accel_preference_set("3d");
- main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
- evas_object_show(main_win);
-}
-
-static void
-teardown(void)
-{
- if (main_win)
- {
- evas_object_del(main_win);
- main_win = NULL;
- }
- elm_shutdown();
- printf(" ============ Cleanup ============ \n");
-}
-
-static Eina_Bool _timer_cb(void *data)
-{
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-/**
- * @addtogroup elm_object_focus_next
- * @{
- * @objective Positive Test case 01: Give focus to next object in object tree.
- * @n Input Data:
- * @li the Elementary object;
- * @li ELM_FOCUS_NEXT focus direction.
- *
- * @procedure
- * @step 1 Get widgets list.
- * @step 2 Traverse the widgets list.
- * @step 3 For given available widget, set focus.
- * @step 4 For the focus object set focus next object with ELM_FOCUS_NEXT focus direction.
- * @step 5 Give focus to next object with ELM_FOCUS_NEXT focus direction.
- * @step 6 Get the whether next object has the focus or not.
- *
- * @passcondition: Test passes if the next object is focused.
- * @}
- */
-START_TEST(utc_UIFW_elm_object_focus_next_p_1)
-{
- Eina_List *widgets = NULL;
- Eina_List *l = NULL;
- Evas_Object *obj = NULL;
- Eina_Bool ret_focus = EINA_FALSE, is_object_focusable = EINA_TRUE, pass = EINA_FALSE;
- char *widget_type = NULL;
-
- widgets = utc_util_elm_not_container_widget_list_get(main_win);
- if (!widgets)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- return;
- }
-
- Evas_Object *button_next = elm_button_add(main_win);
- evas_object_show(button_next);
-
- for (l = widgets; l; l = eina_list_next(l))
- {
- obj = (Evas_Object *) eina_list_data_get(l);
- if (obj)
- {
- elm_object_focus_allow_set(obj, EINA_TRUE);
- evas_object_show(obj);
- widget_type = elm_object_widget_type_get(obj);
- printf("Widget %s is testing...\n", widget_type);
- is_object_focusable = elm_object_focus_allow_get(obj);
- if (is_object_focusable == EINA_FALSE)
- {
- printf("Widget %s can't be focused\n", widget_type);
- continue;
- }
- elm_object_focus_set(obj, EINA_TRUE);
- WAIT_FOR(0.2)
- ret_focus = elm_object_focus_get(obj);
- if (ret_focus == EINA_FALSE)
- {
- printf("Widget %s can't focus set\n", widget_type);
- continue;
- }
-
- elm_object_focus_next_object_set(obj, button_next, ELM_FOCUS_NEXT);
- if (elm_object_focus_next_object_get(obj, ELM_FOCUS_NEXT) != button_next)
- {
- printf("Widget %s can't set next object - button\n", widget_type);
- continue;
- }
-
- elm_object_focus_next(obj, ELM_FOCUS_NEXT);
- WAIT_FOR(0.25)
- if (!elm_object_focus_get(button_next))
- {
- /* evas_object_del(obj);
- eina_list_free(widgets);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..Can't do next focus", __FILE__, __LINE__);
- return;*/
- printf("Widget %s can't set focus to the next object - button. Was set: %s\n", widget_type, elm_object_widget_type_get(elm_object_focused_object_get(main_win)));
- continue;
- }
- pass = EINA_TRUE;
- printf("Widget %s focused and set focus to next object - button. Test is ok\n", widget_type);
- }
- evas_object_del(obj);
- }
-
- eina_list_free(widgets);
- if (pass)
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- else
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to get any appropriate widget object..", __FILE__, __LINE__);
- }
-}
-END_TEST
-
-/**
- * @addtogroup elm_object_focus_next
- * @{
- * @objective Negative Test case 01: Give focus to next object of the NULL Elementary object.
- * @n Input Data:
- * @li NULL as the Elementary object;
- * @li ELM_FOCUS_NEXT focus direction.
- *
- * @procedure
- * @step 1 Try to give focus to next object of the NULL Elementary object.
- *
- * @passcondition: Return type of this API is void. Test passes if API completes successfully.
- * @}
- */
-START_TEST(utc_UIFW_elm_object_focus_next_n_1)
-{
- elm_object_focus_next(NULL, ELM_FOCUS_NEXT);
-
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- return;
-}
-END_TEST
-/**
- * @}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_elm_object_focus_next");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_UIFW_elm_object_focus_next_p_1);
- tcase_add_test(tcase, utc_UIFW_elm_object_focus_next_n_1);
- suite_add_tcase(suite, tcase);
-
- return suite;
-}
-
-int
-main()
-{
- int number_failed;
-
- Suite *suite = test_suite();
- SRunner *srunner = srunner_create(suite);
- srunner_set_log(srunner, "utc_elm_object_focus_next.log");
- srunner_set_xml(srunner, "utc_elm_object_focus_next.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+++ /dev/null
-#include <check.h>
-#include "utc_util_elm_widget_create.h"
-#include "../../utc_negative_unitest.h"
-Evas_Object *main_win = NULL;
-
-#define WAIT_FOR(duration) \
- do \
- { \
- if (ecore_timer_add(duration, _timer_cb, NULL) == NULL) \
- { \
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed (timer cannot be created for testing)..", __FILE__, __LINE__); \
- return; \
- } \
- ecore_main_loop_begin(); \
- } while (0);
-
-
-/**
- * @addtogroup elm_object
- * @{
- * @defgroup elm_object_focus_set elm_object_focus_set()
- *
- * @precondition
- * @step 1 Initialize Elementary
- * @step 2 Create and show 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);
-}
-
-static void
-teardown(void)
-{
- if (main_win != NULL)
- {
- evas_object_del(main_win);
- main_win = NULL;
- }
- elm_shutdown();
- printf(" ============ Cleanup ============ \n");
-}
-
-static Eina_Bool _timer_cb(void *data)
-{
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-/**
- * @addtogroup elm_object_focus_set
- * @{
- * @objective Positive Test case checks if function call with valid values to set/unset focus to a given Elementary object
- * works properly and without segmentation fault
- * @n Input Data:
- * @li the Elementary object to operate on
- * @li EINA_TRUE, EINA_FALSE as the flag's value to set/unset focus to a given Elementary object
- *
- * @procedure
- * @step 1 Run the application main loop
- * @step 2 Get the list of widgets
- * @step 3 Allow focusable for every widget in list
- * @step 4 Show every widget in list
- * @step 5 Traverse the list of widgets
- * @step 6 Get whether the Elementary object is focusable or not. If the object is unfocusable then ignore it and go to the next object
- * @step 7 Call elm_object_focus_set with EINA_TRUE as the flag's value to set/unset focus to a given focusable Elementary object
- * @step 8 Get the whether the Elementary object has the focus or not
- * @step 9 Call elm_object_focus_set with EINA_FALSE as the flag's value to set/unset focus to a given focusable Elementary object
- * @step 10 Get the whether the Elementary object has the focus or not
- *
- * @passcondition
- * @li Test passes if returned value is same as specified value and there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_object_focus_set_p)
-{
- Eina_List *widgets = NULL, *l = NULL;
- Evas_Object *obj = NULL;
- Eina_Bool ret_focus = EINA_FALSE, is_object_focusable = EINA_TRUE, pass = EINA_FALSE;
- char *widget_type = NULL;
-
- if (main_win == NULL)
- {
- return;
- }
-
- widgets = utc_util_elm_not_container_widget_list_get(main_win);
- if (widgets == NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to get a list of widgets..", __FILE__, __LINE__);
- return;
- }
-
- for (l = widgets; l; l = eina_list_next(l))
- {
- obj = (Evas_Object *) eina_list_data_get(l);
- if (obj)
- {
- elm_object_focus_allow_set(obj, EINA_TRUE);
- evas_object_show(obj);
- widget_type = elm_object_widget_type_get(obj);
- printf("[TEST_MSG]:: %s[%d] : Widget %s is testing...", __FILE__, __LINE__, widget_type);
- is_object_focusable = elm_object_focus_allow_get(obj);
- if (is_object_focusable == EINA_FALSE)
- {
- printf("[TEST_MSG]:: %s[%d] : Widget %s can't be focused", __FILE__, __LINE__, widget_type);
- continue;
- }
- elm_object_focus_set(obj, EINA_TRUE);
- WAIT_FOR(0.2)
- ret_focus = elm_object_focus_get(obj);
- if (ret_focus == EINA_FALSE)
- {
- printf("[TEST_MSG]:: %s[%d] : Widget %s can't focus set", __FILE__, __LINE__, widget_type);
- continue;
- }
- elm_object_focus_set(obj, EINA_FALSE);
- WAIT_FOR(0.2)
- ret_focus = elm_object_focus_get(obj);
- if (ret_focus == EINA_TRUE)
- {
- printf("[TEST_MSG]:: %s[%d] : Widget %s can't focus unset", __FILE__, __LINE__, widget_type);
- continue;
- }
- pass = EINA_TRUE;
- printf("[TEST_MSG]:: %s[%d] : Widget %s focused and unfocused. Test is ok", __FILE__, __LINE__, widget_type);
- }
- }
- if (pass)
- {
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
- }
- else
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Unable to get any appropriate widget object..", __FILE__, __LINE__);
- }
-}
-END_TEST
-
-/**
- * @addtogroup elm_object_focus_set
- * @{
- * @objective Negative Test case checks if function call with invalid value to set/unset focus to a given Elementary object
- * works without segmentation fault
- * @n Input Data:
- * @li NULL instead of the Elementary object to operate on
- * @li EINA_TRUE as the flag's value to set/unset focus to a given Elementary object
- *
- * @procedure
- * @step 1 Call elm_object_focus_set with invalid value instead of the Elementary object to operate on
- *
- * @passcondition
- * @li Test passes if there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_object_focus_set_n)
-{
- Evas_Object *obj = NULL;
-
- CREATE_CHECKED_ARGS_ARRAY(1, 0)
- UNITEST_FUNC_NEG_CA(elm_object_focus_set, obj, EINA_TRUE)
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_elm_object_focus_set");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_elm_object_focus_set_p);
- tcase_add_test(tcase, utc_elm_object_focus_set_n);
- suite_add_tcase(suite, tcase);
-
- return suite;
-}
-
-int
-main()
-{
- int number_failed;
-
- Suite *suite = test_suite();
- SRunner *srunner = srunner_create(suite);
- srunner_set_log(srunner, "utc_elm_object_focus_set.log");
- srunner_set_xml(srunner, "utc_elm_object_focus_set.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
utc_elm_entry_select_all.c
utc_elm_entry_select_none.c
utc_elm_entry_select_region_set.c
-utc_elm_entry_selection_copy.c
-utc_elm_entry_selection_cut.c
utc_elm_entry_selection_get.c
utc_elm_entry_selection_handler_disabled_set.c
-utc_elm_entry_selection_paste.c
+utc_elm_entry_selection_cut_copy_paste.c
utc_elm_entry_single_line_get.c
utc_elm_entry_single_line_set.c
utc_elm_entry_text_style_user_peek.c
utc_elm_entry_select_all.c
utc_elm_entry_select_none.c
utc_elm_entry_select_region_set.c
-#utc_elm_entry_selection_copy.c
-#utc_elm_entry_selection_cut.c
utc_elm_entry_selection_get.c
utc_elm_entry_selection_handler_disabled_set.c
-#utc_elm_entry_selection_paste.c
+#utc_elm_entry_selection_cut_copy_paste.c
utc_elm_entry_single_line_get.c
utc_elm_entry_single_line_set.c
utc_elm_entry_text_style_user_peek.c
utc_elm_entry_select_all.c
utc_elm_entry_select_none.c
utc_elm_entry_select_region_set.c
-utc_elm_entry_selection_copy.c
-utc_elm_entry_selection_cut.c
utc_elm_entry_selection_get.c
utc_elm_entry_selection_handler_disabled_set.c
-utc_elm_entry_selection_paste.c
+utc_elm_entry_selection_cut_copy_paste.c
utc_elm_entry_single_line_get.c
utc_elm_entry_single_line_set.c
utc_elm_entry_text_style_user_peek.c
utc_elm_entry_select_all.c
utc_elm_entry_select_none.c
utc_elm_entry_select_region_set.c
-utc_elm_entry_selection_copy.c
-utc_elm_entry_selection_cut.c
utc_elm_entry_selection_get.c
#utc_elm_entry_selection_handler_disabled_set.c
-utc_elm_entry_selection_paste.c
+utc_elm_entry_selection_cut_copy_paste.c
utc_elm_entry_single_line_get.c
utc_elm_entry_single_line_set.c
utc_elm_entry_text_style_user_peek.c
utc_elm_entry_select_all.c
utc_elm_entry_select_none.c
utc_elm_entry_select_region_set.c
-utc_elm_entry_selection_copy.c
-utc_elm_entry_selection_cut.c
utc_elm_entry_selection_get.c
#utc_elm_entry_selection_handler_disabled_set.c
-utc_elm_entry_selection_paste.c
+utc_elm_entry_selection_cut_copy_paste.c
utc_elm_entry_single_line_get.c
utc_elm_entry_single_line_set.c
utc_elm_entry_text_style_user_peek.c
+++ /dev/null
-#include <check.h>
-#include <Elementary.h>
-#include "../../utc_negative_unitest.h"
-Evas_Object *main_win = NULL;
-
-Eina_Bool _timer_cb_copy(void *data)
-{
- Evas_Object *entry_p = (Evas_Object *)data;
- elm_entry_selection_copy(entry_p);
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-Eina_Bool _timer_cb_paste(void *data)
-{
- Evas_Object *entry_p = (Evas_Object *)data;
- elm_entry_selection_paste(entry_p);
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-Eina_Bool _timer_cb(void *data)
-{
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-/**
- * @addtogroup elm_entry
- * @{
- * @defgroup elm_entry_selection_copy elm_entry_selection_copy()
- *
- * @precondition
- * @step 1 Initialize elementary
- * @step 2 Create a main window
- * @step 3 Set size and focus for the main window
- * @step 4 Show 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__);
- }
- evas_object_resize(main_win, 320, 480);
- elm_object_focus_set(main_win, EINA_TRUE);
- 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_entry_selection_copy
- * @{
- * @objective Positive test case checks whether function call to copy text selected in created entry object
- * works properly
- * @n Input Data: the entry object
- *
- * @procedure
- * @step 1 Add an box object to the main window
- * @step 2 Show the box object
- * @step 3 Add an entry object to the main window
- * @step 4 Add an entry object to the box object
- * @step 5 Show the entry object
- * @step 6 Set the "test text" for the entry object
- * @step 7 Select the first 6 chars ("test t") from the entry text using cursor selection functions
- * @step 8 Copy the selected text from the entry object
- * @step 9 Set cursor position to the end of the entry text
- * @step 10 Paste the selected text to the entry object
- * @step 11 Get the entry text
- *
- * @passcondition Test passes if returned char array after function call is the "test texttest t" char array
- * @}
- */
-START_TEST(utc_elm_entry_selection_copy_p)
-{
- Evas_Object *entry = NULL;
-#if 0 /* remove due to timer expiration issue when set entry to box */
- Evas_Object *box = NULL;
-#endif
- const char *text = NULL;
-#if 0 /* remove due to timer expiration issue when set entry to box */
- box = elm_box_add(main_win);
- if (box == NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Unable to create an box object..", __FILE__, __LINE__);
- }
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(main_win, box);
- evas_object_show(box);
-#endif
-
- entry = elm_entry_add(main_win);
- if (entry == NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Unable to create an entry object..", __FILE__, __LINE__);
- }
- elm_entry_scrollable_set(entry, EINA_TRUE);
- evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
- evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0.5);
- elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
- elm_object_text_set(entry, "test text");
- elm_entry_single_line_set(entry, EINA_TRUE);
-#if 0 /* remove due to timer expiration issue when set entry to box */
- elm_box_pack_end(box, entry);
-#endif
- evas_object_show(entry);
- elm_object_focus_set(entry, EINA_TRUE);
-
- text = elm_entry_entry_get(entry);
- if (text == NULL || strcmp(text, "test text"))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Entry text: %s", __FILE__, __LINE__, text);
- }
- elm_entry_cursor_begin_set(entry);
- elm_entry_cursor_selection_begin(entry);
- elm_entry_cursor_pos_set(entry, 6);
- elm_entry_cursor_selection_end(entry);
- text = elm_entry_selection_get(entry);
- if (text == NULL || strcmp(text, "test t"))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- ecore_timer_add(3.0, _timer_cb_copy, entry);
- ecore_main_loop_begin();
- elm_entry_select_none(entry);
- elm_entry_cursor_end_set(entry);
- ecore_timer_add(5.0, _timer_cb_paste, entry);
- ecore_main_loop_begin();
- ecore_timer_add(5.0, _timer_cb, entry);
- ecore_main_loop_begin();
- text = elm_entry_entry_get(entry);
- if (text == NULL || strcmp(text, "test texttest t"))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- evas_object_del(entry);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup elm_entry_selection_copy
- * @{
- * @objective Negative test case checks whether function called with NULL as the entry object
- * works without segmentation fault
- * @n Input Data: NULL instead of the entry object
- *
- * @procedure
- * @step 1 Call function with NULL as the entry object
- *
- * @passcondition Test passes if there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_entry_selection_copy_n)
-{
- UNITEST_FUNC_NEG(elm_entry_selection_copy, NULL);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_elm_entry_selection_copy");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_elm_entry_selection_copy_p);
- tcase_add_test(tcase, utc_elm_entry_selection_copy_n);
- suite_add_tcase(suite, tcase);
-
- return suite;
-}
-
-int
-main()
-{
- int number_failed;
-
- Suite *suite = test_suite();
- SRunner *srunner = srunner_create(suite);
- srunner_set_log(srunner, "utc_elm_entry_selection_copy.log");
- srunner_set_xml(srunner, "utc_elm_entry_selection_copy.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
+++ /dev/null
-#include <check.h>
-#include <Elementary.h>
-#include "../../utc_negative_unitest.h"
-Evas_Object *main_win = NULL;
-
-Eina_Bool _timer_cb_cut(void *data)
-{
- Evas_Object *entry_p = (Evas_Object *)data;
- elm_entry_selection_cut(entry_p);
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-Eina_Bool _timer_cb_paste(void *data)
-{
- Evas_Object *entry_p = (Evas_Object *)data;
- elm_entry_selection_paste(entry_p);
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-Eina_Bool _timer_cb(void *data)
-{
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-/**
- * @addtogroup elm_entry
- * @{
- * @defgroup elm_entry_selection_cut elm_entry_selection_cut()
- *
- * @precondition
- * @step 1 Initialize elementary
- * @step 2 Create a main window
- * @step 3 Set size and focus for the main window
- * @step 4 Show 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__);
- }
- evas_object_resize(main_win, 320, 480);
- elm_object_focus_set(main_win, EINA_TRUE);
- 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_entry_selection_cut
- * @{
- * @objective Positive test case checks whether function call
- * to cut the selected text from the entry object works properly
- * @n Input Data: the entry object
- *
- * @procedure
- * @step 1 Add an box object to the main window
- * @step 2 Show the box object
- * @step 3 Add an entry object to the main window
- * @step 4 Add an entry object to the box object
- * @step 5 Show the entry object
- * @step 6 Set the "test text" for the entry object
- * @step 7 Select the first 5 chars("test ") from the entry text using cursor selection functions
- * @step 8 Cut the selected text with ecore timer
- * @step 9 Get the entry text
- * @step 10 Set the cursor position at the beginning of the entry text
- * @step 11 Paste the cut text at the beginning of the entry text with ecore timer
- *
- * @passcondition Test passes if returned char array after function call is the "test" char array
- * and the "test text" after pasting function call
- * @}
- */
-START_TEST(utc_elm_entry_selection_cut_p)
-{
- Evas_Object *entry = NULL;
-#if 0 /* remove due to timer expiration issue when set entry to box */
- Evas_Object *box = NULL;
-#endif
- const char *text = NULL;
-
-#if 0 /* remove due to timer expiration issue when set entry to box */
- box = elm_box_add(main_win);
- if (box == NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Unable to create an box object..", __FILE__, __LINE__);
- }
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(main_win, box);
- evas_object_show(box);
-#endif
-
- entry = elm_entry_add(main_win);
- if (entry == NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Unable to create an entry object..", __FILE__, __LINE__);
- }
- elm_entry_scrollable_set(entry, EINA_TRUE);
- evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
- evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0.5);
- elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
- elm_object_text_set(entry, "test text");
- elm_entry_single_line_set(entry, EINA_TRUE);
-#if 0 /* remove due to timer expiration issue when set entry to box */
- elm_box_pack_end(box, entry);
-#endif
- evas_object_show(entry);
- elm_object_focus_set(entry, EINA_TRUE);
-
- elm_entry_cursor_begin_set(entry);
- elm_entry_cursor_selection_begin(entry);
- elm_entry_cursor_pos_set(entry, 5);
- elm_entry_cursor_selection_end(entry);
- text = elm_entry_selection_get(entry);
- if (text == NULL || strcmp(text, "test "))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..1", __FILE__, __LINE__);
- }
- ecore_timer_add(5.0, _timer_cb_cut, entry);
- ecore_main_loop_begin();
- text = elm_entry_entry_get(entry);
- if (text == NULL || strcmp(text, "text"))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..2", __FILE__, __LINE__);
- }
- elm_entry_cursor_begin_set(entry);
- ecore_timer_add(5.0, _timer_cb_paste, entry);
- ecore_main_loop_begin();
- ecore_timer_add(5.0, _timer_cb, entry);
- ecore_main_loop_begin();
- text = elm_entry_entry_get(entry);
- if (text == NULL || strcmp(text, "test text"))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Text pasting is failed..", text, __LINE__);
- }
- evas_object_del(entry);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup elm_entry_selection_cut
- * @{
- * @objective Negative test case checks whether function called with NULL as the entry object
- * works without segmentation fault
- * @n Input Data: NULL instead of the entry object
- *
- * @procedure
- * @step 1 Call function with NULL as the entry object
- *
- * @passcondition Test passes if there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_entry_selection_cut_n)
-{
- UNITEST_FUNC_NEG(elm_entry_selection_cut, NULL);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_elm_entry_selection_cut");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_elm_entry_selection_cut_p);
- tcase_add_test(tcase, utc_elm_entry_selection_cut_n);
- suite_add_tcase(suite, tcase);
-
- return suite;
-}
-
-int
-main()
-{
- int number_failed;
-
- Suite *suite = test_suite();
- SRunner *srunner = srunner_create(suite);
- srunner_set_log(srunner, "utc_elm_entry_selection_cut.log");
- srunner_set_xml(srunner, "utc_elm_entry_selection_cut.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
--- /dev/null
+#include <check.h>
+#include <Elementary.h>
+#include "../../utc_negative_unitest.h"
+static Evas_Object *main_win = NULL;
+
+static Eina_Bool _timer_cb_cut(void *data)
+{
+ Evas_Object *entry_p = (Evas_Object *)data;
+ elm_entry_selection_cut(entry_p);
+ ecore_main_loop_quit();
+ return EINA_FALSE;
+}
+
+static Eina_Bool _timer_cb_copy(void *data)
+{
+ Evas_Object *entry_p = (Evas_Object *)data;
+ elm_entry_selection_copy(entry_p);
+ ecore_main_loop_quit();
+ return EINA_FALSE;
+}
+
+static Eina_Bool _timer_cb_paste(void *data)
+{
+ Evas_Object *entry_p = (Evas_Object *)data;
+ elm_entry_selection_paste(entry_p);
+ ecore_main_loop_quit();
+ return EINA_FALSE;
+}
+
+static Eina_Bool _timer_cb(void *data)
+{
+ ecore_main_loop_quit();
+ return EINA_FALSE;
+}
+
+/**
+ * @addtogroup elm_entry
+ * @{
+ * @defgroup elm_entry_selection_paste elm_entry_selection_paste()
+ *
+ * @precondition
+ * @step 1 Initialize elementary
+ * @step 2 Create and show a main window
+ * @step 3 Set size and focus for the main window
+ * @step 4 Show 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__);
+ }
+ evas_object_resize(main_win, 320, 480);
+ elm_object_focus_set(main_win, EINA_TRUE);
+ 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_entry_selection_cut, elm_entry_selection_copy, elm_entry_selection_paste
+ * @{
+ * @objective Positive test case checks whether function call
+ * to cut, copy and paste the selection to the entry object works properly
+ * @n Input Data: the entry object
+ *
+ * @procedure
+ * @step 1 Add an entry object to the main window
+ * @step 2 Show the entry object
+ * @step 3 Set the "Hello World" text for the entry object
+ * @step 4 Select all text in the entry
+ * @step 5 Cut the selected text and check if entry is empty with ecore timer
+ * @step 6 Paste the selected text with ecore timer
+ * @step 7 Get the entry text and check if pasted text is OK.
+ * @step 8 Select first 6 characters of the entry
+ * @step 9 copy the selected text and set the cursor at the end of the entry.
+ * @step 10 Paste the selected text with ecore timer
+ * @step 11 Get the entry text and check if pasted text is OK.
+ *
+ * @passcondition Test passes if returned value is the same as set value
+ * @}
+ */
+START_TEST(utc_elm_entry_selection_cut_copy_paste_p)
+{
+ Evas_Object *entry = NULL;
+ const char *entry_text = NULL;
+ entry = elm_entry_add(main_win);
+ if (entry == NULL)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Unable to create an entry object..", __FILE__, __LINE__);
+ }
+ elm_entry_scrollable_set(entry, EINA_TRUE);
+ evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0.5);
+ elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ elm_object_text_set(entry, "Hello World");
+ elm_entry_single_line_set(entry, EINA_TRUE);
+ evas_object_show(entry);
+ elm_object_focus_set(entry, EINA_TRUE);
+
+ /* testing cut & paste operation */
+ elm_entry_select_all(entry);
+ entry_text = elm_entry_selection_get(entry);
+ if (entry_text == NULL || strcmp(entry_text, "Hello World"))
+ {
+ evas_object_del(entry);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Entry text: %s", __FILE__, __LINE__, entry_text);
+ }
+ ecore_timer_add(5.0, _timer_cb_cut, entry);
+ ecore_main_loop_begin();
+ entry_text = elm_entry_entry_get(entry);
+ if (entry_text == NULL || strcmp(entry_text, ""))
+ {
+ evas_object_del(entry);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+ ecore_timer_add(5.0, _timer_cb_paste, entry);
+ ecore_main_loop_begin();
+ ecore_timer_add(5.0, _timer_cb, entry);
+ ecore_main_loop_begin();
+ entry_text = elm_entry_entry_get(entry);
+ if (entry_text == NULL || strcmp(entry_text, "Hello World"))
+ {
+ evas_object_del(entry);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+ /* testing copy & paste operation */
+ elm_entry_cursor_begin_set(entry);
+ elm_entry_cursor_selection_begin(entry);
+ elm_entry_cursor_pos_set(entry, 6);
+ elm_entry_cursor_selection_end(entry);
+ entry_text = elm_entry_selection_get(entry);
+ if (entry_text == NULL || strcmp(entry_text, "Hello "))
+ {
+ evas_object_del(entry);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+ ecore_timer_add(5.0, _timer_cb_copy, entry);
+ ecore_main_loop_begin();
+ elm_entry_select_none(entry);
+ elm_entry_cursor_end_set(entry);
+ ecore_timer_add(5.0, _timer_cb_paste, entry);
+ ecore_main_loop_begin();
+ ecore_timer_add(5.0, _timer_cb, entry);
+ ecore_main_loop_begin();
+ entry_text = elm_entry_entry_get(entry);
+ if (entry_text == NULL || strcmp(entry_text, "Hello WorldHello "))
+ {
+ evas_object_del(entry);
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+ evas_object_del(entry);
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_entry_selection_cut
+ * @{
+ * @objective Negative test case checks whether function called with NULL as the entry object
+ * works without segmentation fault
+ * @n Input Data: NULL instead of the entry object
+ *
+ * @procedure
+ * @step 1 Call function with NULL as the entry object
+ *
+ * @passcondition Test passes if there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_entry_selection_cut_n)
+{
+ UNITEST_FUNC_NEG(elm_entry_selection_cut, NULL);
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_entry_selection_copy
+ * @{
+ * @objective Negative test case checks whether function called with NULL as the entry object
+ * works without segmentation fault
+ * @n Input Data: NULL instead of the entry object
+ *
+ * @procedure
+ * @step 1 Call function with NULL as the entry object
+ *
+ * @passcondition Test passes if there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_entry_selection_copy_n)
+{
+ UNITEST_FUNC_NEG(elm_entry_selection_copy, NULL);
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup elm_entry_selection_paste
+ * @{
+ * @objective Negative test case checks whether function called with NULL as the entry object
+ * works without segmentation fault
+ * @n Input Data: NULL instead of the entry object
+ *
+ * @procedure
+ * @step 1 Call function with NULL as the entry object
+ *
+ * @passcondition Test passes if there is no segmentation fault
+ * @}
+ */
+START_TEST(utc_elm_entry_selection_paste_n)
+{
+ UNITEST_FUNC_NEG(elm_entry_selection_paste, NULL);
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ *@}
+ */
+Suite *
+test_suite(void)
+{
+ Suite *suite = suite_create("utc_elm_entry_selection_cut_copy_paste");
+
+ TCase *tcase = tcase_create("TCase");
+ tcase_set_timeout(tcase, 30);
+ tcase_add_checked_fixture(tcase, setup, teardown);
+ tcase_add_test(tcase, utc_elm_entry_selection_cut_copy_paste_p);
+ tcase_add_test(tcase, utc_elm_entry_selection_cut_n);
+ tcase_add_test(tcase, utc_elm_entry_selection_copy_n);
+ tcase_add_test(tcase, utc_elm_entry_selection_paste_n);
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+int
+main()
+{
+ int number_failed;
+
+ Suite *suite = test_suite();
+ SRunner *srunner = srunner_create(suite);
+ srunner_set_log(srunner, "utc_elm_entry_selection_cut_copy_paste.log");
+ srunner_set_xml(srunner, "utc_elm_entry_selection_cut_copy_paste.xml");
+ srunner_run_all(srunner, CK_NORMAL);
+ number_failed = srunner_ntests_failed(srunner);
+ srunner_free(srunner);
+
+ return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+++ /dev/null
-#include <check.h>
-#include <Elementary.h>
-#include "../../utc_negative_unitest.h"
-Evas_Object *main_win = NULL;
-
-Eina_Bool _timer_cb_cut(void *data)
-{
- Evas_Object *entry_p = (Evas_Object *)data;
- elm_entry_selection_cut(entry_p);
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-Eina_Bool _timer_cb_paste(void *data)
-{
- Evas_Object *entry_p = (Evas_Object *)data;
- elm_entry_selection_paste(entry_p);
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-Eina_Bool _timer_cb(void *data)
-{
- ecore_main_loop_quit();
- return EINA_FALSE;
-}
-
-/**
- * @addtogroup elm_entry
- * @{
- * @defgroup elm_entry_selection_paste elm_entry_selection_paste()
- *
- * @precondition
- * @step 1 Initialize elementary
- * @step 2 Create and show a main window
- * @step 3 Set size and focus for the main window
- * @step 4 Show 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__);
- }
- evas_object_resize(main_win, 320, 480);
- elm_object_focus_set(main_win, EINA_TRUE);
- 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_entry_selection_paste
- * @{
- * @objective Positive test case checks whether function call
- * to paste the selection to the entry object works properly
- * @n Input Data: the entry object
- *
- * @procedure
- * @step 1 Add an box object to the main window
- * @step 2 Show the box object
- * @step 3 Add an entry object to the main window
- * @step 4 Add an entry object to the box object
- * @step 5 Show the entry object
- * @step 6 Set the "Hello World" text for the entry object
- * @step 7 Select all text in the entry
- * @step 8 Cut the selected text and check if entry is empty with ecore timer
- * @step 9 Get the entry text
- * @step 10 Paste the selected text with ecore timer
- * @step 11 Get the entry text
- *
- * @passcondition Test passes if returned value is the same as set value
- * @}
- */
-START_TEST(utc_elm_entry_selection_paste_p)
-{
-#if 0 /* remove due to timer expiration issue when set entry to box */
- Evas_Object *box = NULL;
-#endif
- Evas_Object *entry = NULL;
- const char *entry_text = NULL;
-
-#if 0 /* remove due to timer expiration issue when set entry to box */
- box = elm_box_add(main_win);
- if (box == NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Unable to create an box object..", __FILE__, __LINE__);
- }
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(main_win, box);
- evas_object_show(box);
-#endif
-
- entry = elm_entry_add(main_win);
- if (entry == NULL)
- {
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Unable to create an entry object..", __FILE__, __LINE__);
- }
- elm_entry_scrollable_set(entry, EINA_TRUE);
- evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0);
- evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0.5);
- elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
- elm_object_text_set(entry, "Hello World");
- elm_entry_single_line_set(entry, EINA_TRUE);
-#if 0 /* remove due to timer expiration issue when set entry to box */
- elm_box_pack_end(box, entry);
-#endif
- evas_object_show(entry);
- elm_object_focus_set(entry, EINA_TRUE);
-
- elm_entry_select_all(entry);
- entry_text = elm_entry_selection_get(entry);
- if (entry_text == NULL || strcmp(entry_text, "Hello World"))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed.. Entry text: %s", __FILE__, __LINE__, entry_text);
- }
- ecore_timer_add(5.0, _timer_cb_cut, entry);
- ecore_main_loop_begin();
- entry_text = elm_entry_entry_get(entry);
- if (entry_text == NULL || strcmp(entry_text, ""))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- ecore_timer_add(5.0, _timer_cb_paste, entry);
- ecore_main_loop_begin();
- ecore_timer_add(5.0, _timer_cb, entry);
- ecore_main_loop_begin();
- entry_text = elm_entry_entry_get(entry);
- if (entry_text == NULL || strcmp(entry_text, "Hello World"))
- {
- evas_object_del(entry);
- ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
- }
- evas_object_del(entry);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-
-/**
- * @addtogroup elm_entry_selection_paste
- * @{
- * @objective Negative test case checks whether function called with NULL as the entry object
- * works without segmentation fault
- * @n Input Data: NULL instead of the entry object
- *
- * @procedure
- * @step 1 Call function with NULL as the entry object
- *
- * @passcondition Test passes if there is no segmentation fault
- * @}
- */
-START_TEST(utc_elm_entry_selection_paste_n)
-{
- UNITEST_FUNC_NEG(elm_entry_selection_paste, NULL);
- printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
-}
-END_TEST
-/**
- *@}
- */
-Suite *
-test_suite(void)
-{
- Suite *suite = suite_create("utc_elm_entry_selection_paste");
-
- TCase *tcase = tcase_create("TCase");
- tcase_set_timeout(tcase, 30);
- tcase_add_checked_fixture(tcase, setup, teardown);
- tcase_add_test(tcase, utc_elm_entry_selection_paste_p);
- tcase_add_test(tcase, utc_elm_entry_selection_paste_n);
- suite_add_tcase(suite, tcase);
-
- return suite;
-}
-
-int
-main()
-{
- int number_failed;
-
- Suite *suite = test_suite();
- SRunner *srunner = srunner_create(suite);
- srunner_set_log(srunner, "utc_elm_entry_selection_paste.log");
- srunner_set_xml(srunner, "utc_elm_entry_selection_paste.xml");
- srunner_run_all(srunner, CK_NORMAL);
- number_failed = srunner_ntests_failed(srunner);
- srunner_free(srunner);
-
- return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
-}
print_checklist_pre
+## Disable crash popup
+pkgcmd -D -t tpk -n org.tizen.crash-syspopup --global
+
## Smack rules
chsmack -e 'System' /opt/usr/efl-test-suite/TC/ecore/ecore_con/utc_ecore_con_server_add
chsmack -e 'System' /opt/usr/efl-test-suite/TC/ecore/ecore_con/utc_ecore_con_server_flush
done < $filename
done < $FileLibsScen
+## Enable crash popup
+pkgcmd -A -t tpk -n org.tizen.crash-syspopup --global
+
./target_generation_html_report.py $XML_RESULT
#processing all passed, failed and errors TC