derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=93694ffd12d85b05728fd3075d58dc40538fdf80

commit 93694ffd12d85b05728fd3075d58dc40538fdf80
Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Feb 4 10:04:46 2019 -0500

    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 <[email protected]>
    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 f02af90707..b37ba414ab 100644
--- a/src/tests/ecore/efl_app_test_loop.c
+++ b/src/tests/ecore/efl_app_test_loop.c
@@ -46,13 +46,19 @@ 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;
 
    if (num++ == 5) efl_loop_quit(efl_main_loop_get(), eina_value_int_init(0));
 }
 
+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)
 {
@@ -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)

-- 


Reply via email to