stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=96da1551c5dc7234b2c32fb7c2310ea994e5399b

commit 96da1551c5dc7234b2c32fb7c2310ea994e5399b
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Mon Apr 9 13:36:59 2018 +0200

    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
---
 src/tests/ecore/ecore_test_ecore.c | 22 ----------------------
 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);
 }

-- 


Reply via email to