summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyuan Choi <ryuan.choi@gmail.com>2014-07-17 22:30:01 +0900
committerRyuan Choi <ryuan.choi@gmail.com>2014-07-17 22:36:31 +0900
commit6e1f65b739e4c576d133c7ff464ccddf12ed2657 (patch)
tree5088bb74947edf7b9b110c95ec2b11b2921694d0
parentd65c176b75f5eeaa00d9c0c9267d891c879981aa (diff)
tests: Pass the interval to elm_test_helper_wait_flag for the caller to change
Like JackDanielZ suggested.
-rw-r--r--src/tests/elm_test_fileselector.c4
-rw-r--r--src/tests/elm_test_helper.c6
-rw-r--r--src/tests/elm_test_helper.h2
3 files changed, 5 insertions, 7 deletions
diff --git a/src/tests/elm_test_fileselector.c b/src/tests/elm_test_fileselector.c
index a20491730..11e52b18c 100644
--- a/src/tests/elm_test_fileselector.c
+++ b/src/tests/elm_test_fileselector.c
@@ -69,13 +69,13 @@ START_TEST (elm_fileselector_selected)
69 69
70 selected = EINA_FALSE; 70 selected = EINA_FALSE;
71 ck_assert(elm_fileselector_selected_set(fileselector, path)); 71 ck_assert(elm_fileselector_selected_set(fileselector, path));
72 ck_assert(elm_test_helper_wait_flag(&selected)); 72 ck_assert(elm_test_helper_wait_flag(10, &selected));
73 73
74 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path); 74 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path);
75 75
76 selected = EINA_FALSE; 76 selected = EINA_FALSE;
77 ck_assert(elm_fileselector_selected_set(fileselector, exist)); 77 ck_assert(elm_fileselector_selected_set(fileselector, exist));
78 ck_assert(elm_test_helper_wait_flag(&selected)); 78 ck_assert(elm_test_helper_wait_flag(10, &selected));
79 79
80 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist); 80 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist);
81 81
diff --git a/src/tests/elm_test_helper.c b/src/tests/elm_test_helper.c
index 453e888f1..6e11ef381 100644
--- a/src/tests/elm_test_helper.c
+++ b/src/tests/elm_test_helper.c
@@ -5,8 +5,6 @@
5#include <Ecore.h> 5#include <Ecore.h>
6#include "elm_suite.h" 6#include "elm_suite.h"
7 7
8const double timeout = 10;
9
10typedef struct _Callback_Data 8typedef struct _Callback_Data
11{ 9{
12 Ecore_Timer *timer; 10 Ecore_Timer *timer;
@@ -24,12 +22,12 @@ timer_expired_cb(void *user_data)
24} 22}
25 23
26Eina_Bool 24Eina_Bool
27elm_test_helper_wait_flag(Eina_Bool *done) 25elm_test_helper_wait_flag(double in, Eina_Bool *done)
28{ 26{
29 Callback_Data data; 27 Callback_Data data;
30 28
31 data.did_timeout = EINA_FALSE; 29 data.did_timeout = EINA_FALSE;
32 data.timer = ecore_timer_add(timeout, timer_expired_cb, &data); 30 data.timer = ecore_timer_add(in, timer_expired_cb, &data);
33 31
34 while (*done == EINA_FALSE && data.did_timeout == EINA_FALSE) 32 while (*done == EINA_FALSE && data.did_timeout == EINA_FALSE)
35 ecore_main_loop_iterate(); 33 ecore_main_loop_iterate();
diff --git a/src/tests/elm_test_helper.h b/src/tests/elm_test_helper.h
index 62974f1f2..0bfc5ca0e 100644
--- a/src/tests/elm_test_helper.h
+++ b/src/tests/elm_test_helper.h
@@ -3,6 +3,6 @@
3 3
4#include <Eina.h> 4#include <Eina.h>
5 5
6Eina_Bool elm_test_helper_wait_flag(Eina_Bool *done); 6Eina_Bool elm_test_helper_wait_flag(double in, Eina_Bool *done);
7 7
8#endif /* _ELM_TEST_HELPER_H */ 8#endif /* _ELM_TEST_HELPER_H */