summaryrefslogtreecommitdiff
path: root/src/tests/ecore/ecore_test_ecore.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-12-19 12:21:29 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-19 12:21:29 +0900
commitcb20ad9f5360a9d31ed7e820d9524f1234c00026 (patch)
tree055c02cc46d47a1190562900e16dd0860a8454c0 /src/tests/ecore/ecore_test_ecore.c
parentff24ac2d6ddaafba49ae5100f17fe37e5d874140 (diff)
ecore: Fix up some test cases
- Add missing ecore_shutdown - Reinstate supposedly silly test case (see previous commits, the main loop object can in fact die cleanly). - Disable really silly test cases (inner main loops aren't meant to work)
Diffstat (limited to 'src/tests/ecore/ecore_test_ecore.c')
-rw-r--r--src/tests/ecore/ecore_test_ecore.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/tests/ecore/ecore_test_ecore.c b/src/tests/ecore/ecore_test_ecore.c
index be99c37423..905af936dd 100644
--- a/src/tests/ecore/ecore_test_ecore.c
+++ b/src/tests/ecore/ecore_test_ecore.c
@@ -16,9 +16,6 @@
16#define ECORE_EVENT_CUSTOM_1 1 16#define ECORE_EVENT_CUSTOM_1 1
17#define ECORE_EVENT_CUSTOM_2 2 17#define ECORE_EVENT_CUSTOM_2 2
18 18
19static int _log_dom;
20#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
21
22static Eina_Bool 19static Eina_Bool
23_quit_cb(void *data) 20_quit_cb(void *data)
24{ 21{
@@ -177,6 +174,8 @@ START_TEST(ecore_test_ecore_main_loop_timer)
177} 174}
178END_TEST 175END_TEST
179 176
177// Disabled tests: inner main loops are not supposed to work!
178#if 0
180static Eina_Bool _timer3(void *data EINA_UNUSED) 179static Eina_Bool _timer3(void *data EINA_UNUSED)
181{ 180{
182 /* timer 3, do nothing */ 181 /* timer 3, do nothing */
@@ -222,8 +221,11 @@ START_TEST(ecore_test_ecore_main_loop_timer_inner)
222 /*END: outer mainloop */ 221 /*END: outer mainloop */
223 222
224 fail_if(times != 1); 223 fail_if(times != 1);
224
225 ecore_shutdown();
225} 226}
226END_TEST 227END_TEST
228#endif
227 229
228static Eina_Bool 230static Eina_Bool
229_fd_handler_cb(void *data, Ecore_Fd_Handler *handler EINA_UNUSED) 231_fd_handler_cb(void *data, Ecore_Fd_Handler *handler EINA_UNUSED)
@@ -599,6 +601,10 @@ START_TEST(ecore_test_ecore_main_loop_event)
599} 601}
600END_TEST 602END_TEST
601 603
604#if 0
605static int _log_dom;
606#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
607
602static Eina_Bool 608static Eina_Bool
603_timer_quit_recursive(void *data EINA_UNUSED) 609_timer_quit_recursive(void *data EINA_UNUSED)
604{ 610{
@@ -633,7 +639,6 @@ _event_recursive_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EI
633 return EINA_FALSE; 639 return EINA_FALSE;
634} 640}
635 641
636
637START_TEST(ecore_test_ecore_main_loop_event_recursive) 642START_TEST(ecore_test_ecore_main_loop_event_recursive)
638{ 643{
639 /* This test tests if the event handlers are really called only once when 644 /* This test tests if the event handlers are really called only once when
@@ -663,6 +668,7 @@ START_TEST(ecore_test_ecore_main_loop_event_recursive)
663 ecore_shutdown(); 668 ecore_shutdown();
664} 669}
665END_TEST 670END_TEST
671#endif
666 672
667START_TEST(ecore_test_ecore_app) 673START_TEST(ecore_test_ecore_app)
668{ 674{
@@ -741,9 +747,9 @@ START_TEST(ecore_test_ecore_main_loop_poller)
741 fail_if(ecore_poller_poller_interval_get(poll3_ptr) != poll3_interval); 747 fail_if(ecore_poller_poller_interval_get(poll3_ptr) != poll3_interval);
742 748
743 /* Check each poller call counter */ 749 /* Check each poller call counter */
744 fail_if(8 != poll1_counter); 750 ck_assert_int_eq(8, poll1_counter);
745 fail_if(4 != poll2_counter); 751 ck_assert_int_eq(4, poll2_counter);
746 fail_if(2 != poll3_counter); 752 ck_assert_int_eq(2, poll3_counter);
747 753
748 /* Destroy renewable pollers */ 754 /* Destroy renewable pollers */
749 ecore_poller_del(poll3_ptr); 755 ecore_poller_del(poll3_ptr);
@@ -893,15 +899,15 @@ void ecore_test_ecore(TCase *tc)
893 tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler); 899 tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler);
894 tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler_activate_modify); 900 tcase_add_test(tc, ecore_test_ecore_main_loop_fd_handler_activate_modify);
895 tcase_add_test(tc, ecore_test_ecore_main_loop_event); 901 tcase_add_test(tc, ecore_test_ecore_main_loop_event);
902#if 0
896 tcase_add_test(tc, ecore_test_ecore_main_loop_timer_inner); 903 tcase_add_test(tc, ecore_test_ecore_main_loop_timer_inner);
897 tcase_add_test(tc, ecore_test_ecore_main_loop_event_recursive); 904 tcase_add_test(tc, ecore_test_ecore_main_loop_event_recursive);
905#endif
898 tcase_add_test(tc, ecore_test_ecore_app); 906 tcase_add_test(tc, ecore_test_ecore_app);
899 tcase_add_test(tc, ecore_test_ecore_main_loop_poller); 907 tcase_add_test(tc, ecore_test_ecore_main_loop_poller);
900 tcase_add_test(tc, ecore_test_ecore_main_loop_poller_add_del); 908 tcase_add_test(tc, ecore_test_ecore_main_loop_poller_add_del);
901 tcase_add_test(tc, ecore_test_efl_loop_fd); 909 tcase_add_test(tc, ecore_test_efl_loop_fd);
902/* XXX: this seems a silly test... that we delete the loop object?
903 tcase_add_test(tc, ecore_test_efl_loop_fd_lifecycle); 910 tcase_add_test(tc, ecore_test_efl_loop_fd_lifecycle);
904 */
905 tcase_add_test(tc, ecore_test_efl_loop_register); 911 tcase_add_test(tc, ecore_test_efl_loop_register);
906 tcase_add_test(tc, ecore_test_efl_app_version); 912 tcase_add_test(tc, ecore_test_efl_app_version);
907} 913}