summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-03-27 14:24:57 -0700
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-28 09:30:00 +0100
commit07e017c510fe796a9f73756dda54bfffd78174f2 (patch)
tree620d67b670dbe4fd0df159be6ae3b3822fae764f /src/tests
parent197210cde2bc1b94490c2a37ca001701b22550d3 (diff)
elementary: restore quick exit from wait loop in fileselector test.
The test was not expecting both callback to be set when the wait loop was started. By moving them around, it fixes the test case to only have one relevant callback set at a time. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D8490
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/elm_test_fileselector.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tests/elementary/elm_test_fileselector.c b/src/tests/elementary/elm_test_fileselector.c
index be8b53d672..a2df980a30 100644
--- a/src/tests/elementary/elm_test_fileselector.c
+++ b/src/tests/elementary/elm_test_fileselector.c
@@ -86,6 +86,8 @@ _ready_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED
86{ 86{
87 Eina_Bool *ret = data; 87 Eina_Bool *ret = data;
88 *ret = EINA_TRUE; 88 *ret = EINA_TRUE;
89
90 ecore_main_loop_quit();
89} 91}
90 92
91EFL_START_TEST(elm_fileselector_selected) 93EFL_START_TEST(elm_fileselector_selected)
@@ -116,7 +118,6 @@ EFL_START_TEST(elm_fileselector_selected)
116 118
117 fileselector = elm_fileselector_add(win); 119 fileselector = elm_fileselector_add(win);
118 evas_object_smart_callback_add(fileselector, "directory,open", _ready_cb, &open); 120 evas_object_smart_callback_add(fileselector, "directory,open", _ready_cb, &open);
119 evas_object_smart_callback_add(fileselector, "selected", _ready_cb, &selected);
120 121
121 ck_assert(!elm_fileselector_selected_set(fileselector, no_exist)); 122 ck_assert(!elm_fileselector_selected_set(fileselector, no_exist));
122 123
@@ -126,10 +127,13 @@ EFL_START_TEST(elm_fileselector_selected)
126 127
127 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path); 128 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path);
128 129
129 selected = EINA_FALSE; 130 evas_object_smart_callback_del(fileselector, "directory,open", _ready_cb);
131 evas_object_smart_callback_add(fileselector, "selected", _ready_cb, &selected);
132
130 ck_assert(elm_fileselector_selected_set(fileselector, exist)); 133 ck_assert(elm_fileselector_selected_set(fileselector, exist));
131 ck_assert(fileselector_test_helper_wait_flag(10, &selected)); 134 ck_assert(fileselector_test_helper_wait_flag(10, &selected));
132 ck_assert(selected == EINA_TRUE); 135 ck_assert(selected == EINA_TRUE);
136
133 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist); 137 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist);
134 138
135 eina_stringshare_del(exist); 139 eina_stringshare_del(exist);