From ecd86a563315239f3e819171bcf78254bbc2ca4b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 4 Feb 2019 10:04:46 -0500 Subject: [PATCH] tests: improve efl loop test (concentric) I forgot to spin the sub-loop, so this was previously just a test to verify that the IDLE callback was working. now this spins the sub-loop on the idle callback and tests the idle enter callback to verify that the main loop is being iterated Reviewed-by: Derek Foreman Differential Revision: https://phab.enlightenment.org/D7874 --- src/tests/ecore/efl_app_test_loop.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tests/ecore/efl_app_test_loop.c b/src/tests/ecore/efl_app_test_loop.c index f02af90..b37ba41 100644 --- a/src/tests/ecore/efl_app_test_loop.c +++ b/src/tests/ecore/efl_app_test_loop.c @@ -46,7 +46,7 @@ efl_app_test_efl_loop_concentric_fail(void *data EINA_UNUSED, const Efl_Event *e } static void -loop_idle(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) +loop_idle_enter(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { static int num = 0; @@ -54,6 +54,12 @@ loop_idle(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) } static void +loop_idle(void *data, const Efl_Event *ev EINA_UNUSED) +{ + efl_loop_iterate(data); +} + +static void loop_timer_tick(void *data, const Efl_Event *ev EINA_UNUSED) { efl_loop_iterate(data); @@ -65,8 +71,9 @@ EFL_START_TEST(efl_app_test_efl_loop_concentric) int exitcode; loop = efl_main_loop_get(); - efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE, loop_idle, NULL); loop2 = efl_add(EFL_LOOP_CLASS, loop); + efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE, loop_idle, loop2); + efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE_ENTER, loop_idle_enter, NULL); timer = efl_add(EFL_LOOP_TIMER_CLASS, loop2, efl_loop_timer_interval_set(efl_added, 0.01), efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, loop_timer_tick, loop) -- 2.7.4