summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/ecore/ecore_test_timer.c')
-rw-r--r--src/tests/ecore/ecore_test_timer.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/ecore/ecore_test_timer.c b/src/tests/ecore/ecore_test_timer.c
index 7b41b8bc1b..222c4151c5 100644
--- a/src/tests/ecore/ecore_test_timer.c
+++ b/src/tests/ecore/ecore_test_timer.c
@@ -252,10 +252,47 @@ EFL_START_TEST(ecore_test_ecore_main_loop_timer)
252} 252}
253EFL_END_TEST 253EFL_END_TEST
254 254
255static int count = 0;
256
257static Eina_Bool
258_timer_cb(void *data)
259{
260 count++;
261 int num = (intptr_t) data;
262 fail_if (num != count, "Error timer is called out of order");
263 if (count == 8) ecore_main_loop_quit();
264 return ECORE_CALLBACK_CANCEL;
265}
266
267EFL_START_TEST(ecore_test_timer_in_order)
268{
269 Ecore_Timer *timer;
270 timer = ecore_timer_add(0.001, _timer_cb, (void *) 1);
271 fail_if(timer == NULL);
272 timer = ecore_timer_add(0.001, _timer_cb, (void *) 2);
273 fail_if(timer == NULL);
274 timer = ecore_timer_add(0.001, _timer_cb, (void *) 3);
275 fail_if(timer == NULL);
276 timer = ecore_timer_add(0.001, _timer_cb, (void *) 4);
277 fail_if(timer == NULL);
278 timer = ecore_timer_add(0.001, _timer_cb, (void *) 5);
279 fail_if(timer == NULL);
280 timer = ecore_timer_add(0.001, _timer_cb, (void *) 6);
281 fail_if(timer == NULL);
282 timer = ecore_timer_add(0.001, _timer_cb, (void *) 7);
283 fail_if(timer == NULL);
284 timer = ecore_timer_add(0.001, _timer_cb, (void *) 8);
285 fail_if(timer == NULL);
286
287 ecore_main_loop_begin();
288}
289EFL_END_TEST
290
255void ecore_test_timer(TCase *tc) 291void ecore_test_timer(TCase *tc)
256{ 292{
257 tcase_add_test(tc, ecore_test_timers); 293 tcase_add_test(tc, ecore_test_timers);
258 tcase_add_test(tc, ecore_test_timer_inside_call); 294 tcase_add_test(tc, ecore_test_timer_inside_call);
259 tcase_add_test(tc, ecore_test_timer_valid_callbackfunc); 295 tcase_add_test(tc, ecore_test_timer_valid_callbackfunc);
260 tcase_add_test(tc, ecore_test_ecore_main_loop_timer); 296 tcase_add_test(tc, ecore_test_ecore_main_loop_timer);
297 tcase_add_test(tc, ecore_test_timer_in_order);
261} 298}