bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=07e017c510fe796a9f73756dda54bfffd78174f2

commit 07e017c510fe796a9f73756dda54bfffd78174f2
Author: Cedric BAIL <cedric.b...@free.fr>
Date:   Wed Mar 27 14:24:57 2019 -0700

    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 <m...@marcel-hollerbach.de>
    Differential Revision: https://phab.enlightenment.org/D8490
---
 src/tests/elementary/elm_test_fileselector.c | 8 ++++++--
 1 file 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
 {
     Eina_Bool *ret = data;
     *ret = EINA_TRUE;
+
+    ecore_main_loop_quit();
 }
 
 EFL_START_TEST(elm_fileselector_selected)
@@ -116,7 +118,6 @@ EFL_START_TEST(elm_fileselector_selected)
 
    fileselector = elm_fileselector_add(win);
    evas_object_smart_callback_add(fileselector, "directory,open", _ready_cb, 
&open);
-   evas_object_smart_callback_add(fileselector, "selected", _ready_cb, 
&selected);
 
    ck_assert(!elm_fileselector_selected_set(fileselector, no_exist));
 
@@ -126,10 +127,13 @@ EFL_START_TEST(elm_fileselector_selected)
 
    ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path);
 
-   selected = EINA_FALSE;
+   evas_object_smart_callback_del(fileselector, "directory,open", _ready_cb);
+   evas_object_smart_callback_add(fileselector, "selected", _ready_cb, 
&selected);
+
    ck_assert(elm_fileselector_selected_set(fileselector, exist));
    ck_assert(fileselector_test_helper_wait_flag(10, &selected));
    ck_assert(selected == EINA_TRUE);
+
    ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist);
 
    eina_stringshare_del(exist);

-- 


Reply via email to