diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2018-04-09 13:36:59 +0200 |
---|---|---|
committer | Stefan Schmidt <stefan@osg.samsung.com> | 2018-04-10 11:28:01 +0200 |
commit | 96da1551c5dc7234b2c32fb7c2310ea994e5399b (patch) | |
tree | dae5306bfb2ec6528a71c59b4783cf1c0a38bf5f | |
parent | 3858186376da10a801677e26cc1573c95dd1c48b (diff) | |
download | efl-96da1551c5dc7234b2c32fb7c2310ea994e5399b.tar.gz |
tests: move ecore_test_ecore_main_loop_timer into timers test file
Summary: Depends on D5892
Reviewers: stefan_schmidt
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5893
-rw-r--r-- | src/tests/ecore/ecore_test_ecore.c | 22 | ||||
-rw-r--r-- | src/tests/ecore/ecore_test_timer.c | 32 |
2 files changed, 32 insertions, 22 deletions
diff --git a/src/tests/ecore/ecore_test_ecore.c b/src/tests/ecore/ecore_test_ecore.c index f429c5b2c9..3f68225956 100644 --- a/src/tests/ecore/ecore_test_ecore.c +++ b/src/tests/ecore/ecore_test_ecore.c @@ -117,27 +117,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_exiter) } EFL_END_TEST -EFL_START_TEST(ecore_test_ecore_main_loop_timer) -{ - Eina_Bool did = EINA_FALSE; - Ecore_Timer *timer; - double start, end, elapsed; - - - timer = ecore_timer_add(0.1, _quit_cb, &did); - fail_if(timer == NULL); - - start = ecore_time_get(); - ecore_main_loop_begin(); - end = ecore_time_get(); - elapsed = end - start; - - fail_if(did == EINA_FALSE); - fail_if(elapsed < 0.05); - fail_if(elapsed > 0.15); /* .05 second "error margin" */ - -} -EFL_END_TEST // Disabled tests: inner main loops are not supposed to work! #if 0 @@ -796,7 +775,6 @@ void ecore_test_ecore(TCase *tc) tcase_add_test(tc, ecore_test_ecore_main_loop_idle_enterer); tcase_add_test(tc, ecore_test_ecore_main_loop_idle_before_enterer); tcase_add_test(tc, ecore_test_ecore_main_loop_idle_exiter); - tcase_add_test(tc, ecore_test_ecore_main_loop_timer); tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler); tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler_valid_flags); tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler_activate_modify); diff --git a/src/tests/ecore/ecore_test_timer.c b/src/tests/ecore/ecore_test_timer.c index c325716e3b..0df1e064f8 100644 --- a/src/tests/ecore/ecore_test_timer.c +++ b/src/tests/ecore/ecore_test_timer.c @@ -265,6 +265,37 @@ EFL_START_TEST(ecore_test_timer_valid_callbackfunc) } EFL_END_TEST +static Eina_Bool +_quit_cb(void *data) +{ + Eina_Bool *val = data; + if (val) *val = EINA_TRUE; + ecore_main_loop_quit(); + return EINA_FALSE; +} + +EFL_START_TEST(ecore_test_ecore_main_loop_timer) +{ + Eina_Bool did = EINA_FALSE; + Ecore_Timer *timer; + double start, end, elapsed; + + + timer = ecore_timer_add(0.1, _quit_cb, &did); + fail_if(timer == NULL); + + start = ecore_time_get(); + ecore_main_loop_begin(); + end = ecore_time_get(); + elapsed = end - start; + + fail_if(did == EINA_FALSE); + fail_if(elapsed < 0.05); + fail_if(elapsed > 0.15); /* .05 second "error margin" */ + +} +EFL_END_TEST + void ecore_test_timer(TCase *tc) { tcase_add_test(tc, ecore_test_timers); @@ -273,4 +304,5 @@ void ecore_test_timer(TCase *tc) */ tcase_add_test(tc, ecore_test_timer_inside_call); tcase_add_test(tc, ecore_test_timer_valid_callbackfunc); + tcase_add_test(tc, ecore_test_ecore_main_loop_timer); } |