summaryrefslogtreecommitdiff
path: root/src/tests/ecore
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-20 11:46:41 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2018-07-30 17:40:57 +0200
commit774ac32f690181bcf2c106af81f2919bf81ecec5 (patch)
treec7ef9b582046714eff988c7b80ee88469e404a38 /src/tests/ecore
parentbc248fdcf2095f5e047b7fc6e0f7273e521470d4 (diff)
tests/ecore: remove tolerance threshold from ecore_timer_reset test case
unit tests should test one thing only: testing timer accuracy and the effectiveness of resetting a timer in the same test leads to timing issues, so remove the timing component from the test ref T6878 Differential Revision: https://phab.enlightenment.org/D6653
Diffstat (limited to 'src/tests/ecore')
-rw-r--r--src/tests/ecore/ecore_test_timer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tests/ecore/ecore_test_timer.c b/src/tests/ecore/ecore_test_timer.c
index b7661d0043..7b41b8bc1b 100644
--- a/src/tests/ecore/ecore_test_timer.c
+++ b/src/tests/ecore/ecore_test_timer.c
@@ -173,7 +173,6 @@ EFL_END_TEST
173typedef struct _Test_Inside_Call 173typedef struct _Test_Inside_Call
174{ 174{
175 Ecore_Timer *t; 175 Ecore_Timer *t;
176 double start;
177 int it; 176 int it;
178} Test_Inside_Call; 177} Test_Inside_Call;
179 178
@@ -182,9 +181,7 @@ _timeri_cb(void *data)
182{ 181{
183 Test_Inside_Call *c = data; 182 Test_Inside_Call *c = data;
184 183
185 fail_if(fabs((ecore_time_get() - c->start) - 0.011) > 0.01);
186 ecore_timer_reset(c->t); 184 ecore_timer_reset(c->t);
187 c->start = ecore_time_get();
188 185
189 c->it--; 186 c->it--;
190 187
@@ -194,14 +191,21 @@ _timeri_cb(void *data)
194 return EINA_FALSE; 191 return EINA_FALSE;
195} 192}
196 193
194static Eina_Bool
195timeout_timer_cb()
196{
197 ck_abort();
198 return EINA_FALSE;
199}
200
197EFL_START_TEST(ecore_test_timer_inside_call) 201EFL_START_TEST(ecore_test_timer_inside_call)
198{ 202{
199 Test_Inside_Call *c; 203 Test_Inside_Call *c;
200 204
201 c = malloc(sizeof(Test_Inside_Call)); 205 c = malloc(sizeof(Test_Inside_Call));
202 c->start = ecore_time_get();
203 c->it = 5; 206 c->it = 5;
204 c->t = ecore_timer_add(0.01, _timeri_cb, c); 207 c->t = ecore_timer_add(0.01, _timeri_cb, c);
208 ecore_timer_add(1.0, timeout_timer_cb, NULL);
205 209
206 fail_if(!c->t, "Error add timer\n"); 210 fail_if(!c->t, "Error add timer\n");
207 211