summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/tests/elm_test_fileselector.c
diff options
context:
space:
mode:
authorRyuan Choi <ryuan.choi@gmail.com>2014-07-16 23:17:31 +0900
committerRyuan Choi <ryuan.choi@gmail.com>2014-07-16 23:31:58 +0900
commit4938a7c246758af601986f1706b0a23b68b6b77d (patch)
tree7ccf38da1077f9ed45827d48cb9896d840c133f3 /legacy/elementary/src/tests/elm_test_fileselector.c
parentf7c43bff97551a83625808ab28465d13c5db638a (diff)
tests: Add elm_test_helper_wait_flag to avoid infinite loop
Test of elm_fileselector_selected and future tests may have conditional loop which some flag. This patch adds elm_test_helper_wait_flag, simple wrapper of the loop with timer in order to exit the loop when expected callbacks are not called.
Diffstat (limited to '')
-rw-r--r--legacy/elementary/src/tests/elm_test_fileselector.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/legacy/elementary/src/tests/elm_test_fileselector.c b/legacy/elementary/src/tests/elm_test_fileselector.c
index e5dd0677be..a204917306 100644
--- a/legacy/elementary/src/tests/elm_test_fileselector.c
+++ b/legacy/elementary/src/tests/elm_test_fileselector.c
@@ -69,12 +69,14 @@ START_TEST (elm_fileselector_selected)
69 69
70 selected = EINA_FALSE; 70 selected = EINA_FALSE;
71 ck_assert(elm_fileselector_selected_set(fileselector, path)); 71 ck_assert(elm_fileselector_selected_set(fileselector, path));
72 while (!selected) ecore_main_loop_iterate(); 72 ck_assert(elm_test_helper_wait_flag(&selected));
73
73 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path); 74 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path);
74 75
75 selected = EINA_FALSE; 76 selected = EINA_FALSE;
76 ck_assert(elm_fileselector_selected_set(fileselector, exist)); 77 ck_assert(elm_fileselector_selected_set(fileselector, exist));
77 while (!selected) ecore_main_loop_iterate(); 78 ck_assert(elm_test_helper_wait_flag(&selected));
79
78 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist); 80 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist);
79 81
80 eina_stringshare_del(exist); 82 eina_stringshare_del(exist);