tests: Pass the interval to elm_test_helper_wait_flag for the caller to change
authorRyuan Choi <ryuan.choi@gmail.com>
Thu, 17 Jul 2014 13:30:01 +0000 (22:30 +0900)
committerRyuan Choi <ryuan.choi@gmail.com>
Thu, 17 Jul 2014 13:36:31 +0000 (22:36 +0900)
Like JackDanielZ suggested.

legacy/elementary/src/tests/elm_test_fileselector.c
legacy/elementary/src/tests/elm_test_helper.c
legacy/elementary/src/tests/elm_test_helper.h

index a204917..11e52b1 100644 (file)
@@ -69,13 +69,13 @@ START_TEST (elm_fileselector_selected)
 
    selected = EINA_FALSE;
    ck_assert(elm_fileselector_selected_set(fileselector, path));
-   ck_assert(elm_test_helper_wait_flag(&selected));
+   ck_assert(elm_test_helper_wait_flag(10, &selected));
 
    ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path);
 
    selected = EINA_FALSE;
    ck_assert(elm_fileselector_selected_set(fileselector, exist));
-   ck_assert(elm_test_helper_wait_flag(&selected));
+   ck_assert(elm_test_helper_wait_flag(10, &selected));
 
    ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist);
 
index 453e888..6e11ef3 100644 (file)
@@ -5,8 +5,6 @@
 #include <Ecore.h>
 #include "elm_suite.h"
 
-const double timeout = 10;
-
 typedef struct _Callback_Data
 {
    Ecore_Timer *timer;
@@ -24,12 +22,12 @@ timer_expired_cb(void *user_data)
 }
 
 Eina_Bool
-elm_test_helper_wait_flag(Eina_Bool *done)
+elm_test_helper_wait_flag(double in, Eina_Bool *done)
 {
    Callback_Data data;
 
    data.did_timeout = EINA_FALSE;
-   data.timer = ecore_timer_add(timeout, timer_expired_cb, &data);
+   data.timer = ecore_timer_add(in, timer_expired_cb, &data);
 
    while (*done == EINA_FALSE && data.did_timeout == EINA_FALSE)
      ecore_main_loop_iterate();
index 62974f1..0bfc5ca 100644 (file)
@@ -3,6 +3,6 @@
 
 #include <Eina.h>
 
-Eina_Bool elm_test_helper_wait_flag(Eina_Bool *done);
+Eina_Bool elm_test_helper_wait_flag(double in, Eina_Bool *done);
 
 #endif /* _ELM_TEST_HELPER_H */