From: Ryuan Choi Date: Thu, 17 Jul 2014 13:30:01 +0000 (+0900) Subject: tests: Pass the interval to elm_test_helper_wait_flag for the caller to change X-Git-Tag: upstream/1.20.0~7116^2~14^2~2316 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=057d5456c64a3abe4b9aef0e183340e970652856;p=platform%2Fupstream%2Fefl.git tests: Pass the interval to elm_test_helper_wait_flag for the caller to change Like JackDanielZ suggested. --- diff --git a/legacy/elementary/src/tests/elm_test_fileselector.c b/legacy/elementary/src/tests/elm_test_fileselector.c index a204917..11e52b1 100644 --- a/legacy/elementary/src/tests/elm_test_fileselector.c +++ b/legacy/elementary/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/legacy/elementary/src/tests/elm_test_helper.c b/legacy/elementary/src/tests/elm_test_helper.c index 453e888..6e11ef3 100644 --- a/legacy/elementary/src/tests/elm_test_helper.c +++ b/legacy/elementary/src/tests/elm_test_helper.c @@ -5,8 +5,6 @@ #include #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/legacy/elementary/src/tests/elm_test_helper.h b/legacy/elementary/src/tests/elm_test_helper.h index 62974f1..0bfc5ca 100644 --- a/legacy/elementary/src/tests/elm_test_helper.h +++ b/legacy/elementary/src/tests/elm_test_helper.h @@ -3,6 +3,6 @@ #include -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 */