ryuan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=6e1f65b739e4c576d133c7ff464ccddf12ed2657
commit 6e1f65b739e4c576d133c7ff464ccddf12ed2657 Author: Ryuan Choi <ryuan.c...@gmail.com> Date: Thu Jul 17 22:30:01 2014 +0900 tests: Pass the interval to elm_test_helper_wait_flag for the caller to change Like JackDanielZ suggested. --- src/tests/elm_test_fileselector.c | 4 ++-- src/tests/elm_test_helper.c | 6 ++---- src/tests/elm_test_helper.h | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/tests/elm_test_fileselector.c b/src/tests/elm_test_fileselector.c index a204917..11e52b1 100644 --- a/src/tests/elm_test_fileselector.c +++ b/src/tests/elm_test_fileselector.c @@ -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); diff --git a/src/tests/elm_test_helper.c b/src/tests/elm_test_helper.c index 453e888..6e11ef3 100644 --- a/src/tests/elm_test_helper.c +++ b/src/tests/elm_test_helper.c @@ -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(); diff --git a/src/tests/elm_test_helper.h b/src/tests/elm_test_helper.h index 62974f1..0bfc5ca 100644 --- a/src/tests/elm_test_helper.h +++ b/src/tests/elm_test_helper.h @@ -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 */ --