summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-04 10:04:46 -0500
committerDerek Foreman <derek.foreman.samsung@gmail.com>2019-02-04 14:11:48 -0600
commit93694ffd12d85b05728fd3075d58dc40538fdf80 (patch)
tree096a1474bef2f6a91f3b5832f224288dfc8b8b66
parentc946b1477dcaf35830ed66c409615f926ef0931b (diff)
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 <derekf@osg.samsung.com> Differential Revision: https://phab.enlightenment.org/D7874
-rw-r--r--src/tests/ecore/efl_app_test_loop.c11
1 files 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,7 +46,7 @@ efl_app_test_efl_loop_concentric_fail(void *data EINA_UNUSED, const Efl_Event *e
46} 46}
47 47
48static void 48static void
49loop_idle(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) 49loop_idle_enter(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
50{ 50{
51 static int num = 0; 51 static int num = 0;
52 52
@@ -54,6 +54,12 @@ loop_idle(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
54} 54}
55 55
56static void 56static void
57loop_idle(void *data, const Efl_Event *ev EINA_UNUSED)
58{
59 efl_loop_iterate(data);
60}
61
62static void
57loop_timer_tick(void *data, const Efl_Event *ev EINA_UNUSED) 63loop_timer_tick(void *data, const Efl_Event *ev EINA_UNUSED)
58{ 64{
59 efl_loop_iterate(data); 65 efl_loop_iterate(data);
@@ -65,8 +71,9 @@ EFL_START_TEST(efl_app_test_efl_loop_concentric)
65 int exitcode; 71 int exitcode;
66 72
67 loop = efl_main_loop_get(); 73 loop = efl_main_loop_get();
68 efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE, loop_idle, NULL);
69 loop2 = efl_add(EFL_LOOP_CLASS, loop); 74 loop2 = efl_add(EFL_LOOP_CLASS, loop);
75 efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE, loop_idle, loop2);
76 efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE_ENTER, loop_idle_enter, NULL);
70 timer = efl_add(EFL_LOOP_TIMER_CLASS, loop2, 77 timer = efl_add(EFL_LOOP_TIMER_CLASS, loop2,
71 efl_loop_timer_interval_set(efl_added, 0.01), 78 efl_loop_timer_interval_set(efl_added, 0.01),
72 efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, loop_timer_tick, loop) 79 efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, loop_timer_tick, loop)