summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-03-27 13:51:13 -0400
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-05 11:10:26 +0200
commit624925fe6e9c72c639d47135d5ea70d4110ac1fe (patch)
treeb57c12a611bf3b4b492327a7fcb5722cd39dad5b /src/tests
parent730020c7d4a87daf60cbfbb3a0a912b4f75d8cb5 (diff)
tests: move to using checked fixtures for all test suites
individual tests should not need to explicitly call init/shutdown functions in most cases, and many did not properly do this anyway see followup commit which resolves some issues with eina tests ref T6813 ref T6811 Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/ecore/ecore_suite.c13
-rw-r--r--src/tests/ecore/ecore_test_animator.c8
-rw-r--r--src/tests/ecore/ecore_test_args.c6
-rw-r--r--src/tests/ecore/ecore_test_ecore.c93
-rw-r--r--src/tests/ecore/ecore_test_ecore_audio.c8
-rw-r--r--src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c33
-rw-r--r--src/tests/ecore/ecore_test_job.c4
-rw-r--r--src/tests/ecore/ecore_test_promise.c63
-rw-r--r--src/tests/ecore/ecore_test_promise2.c14
-rw-r--r--src/tests/ecore/ecore_test_timer.c15
-rw-r--r--src/tests/ecore/efl_app_suite.c2
-rw-r--r--src/tests/ecore_con/ecore_con_suite.c13
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con.c44
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con_eet.c8
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con_url.c16
-rw-r--r--src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c62
-rw-r--r--src/tests/ector/suite/ector_suite.c13
-rw-r--r--src/tests/ector/suite/ector_test_init.c2
-rw-r--r--src/tests/edje/edje_suite.c13
-rw-r--r--src/tests/edje/edje_test_edje.c7
-rw-r--r--src/tests/eet/eet_suite.c13
-rw-r--r--src/tests/eet/eet_test_cache.c2
-rw-r--r--src/tests/eet/eet_test_cipher.c4
-rw-r--r--src/tests/eet/eet_test_connection.c4
-rw-r--r--src/tests/eet/eet_test_data.c34
-rw-r--r--src/tests/eet/eet_test_file.c12
-rw-r--r--src/tests/eet/eet_test_identity.c12
-rw-r--r--src/tests/eet/eet_test_image.c6
-rw-r--r--src/tests/eet/eet_test_init.c7
-rw-r--r--src/tests/eeze/eeze_suite.c13
-rw-r--r--src/tests/eeze/eeze_test_init.c7
-rw-r--r--src/tests/eeze/eeze_test_net.c21
-rw-r--r--src/tests/eeze/eeze_test_sensor.c24
-rw-r--r--src/tests/eeze/eeze_test_udev.c21
-rw-r--r--src/tests/efl/efl_suite.c14
-rw-r--r--src/tests/efl/efl_test_model_composite.c10
-rw-r--r--src/tests/efl/efl_test_model_container.c5
-rw-r--r--src/tests/efl_check.h9
-rw-r--r--src/tests/efreet/efreet_suite.c13
-rw-r--r--src/tests/efreet/efreet_test_efreet.c7
-rw-r--r--src/tests/efreet/efreet_test_efreet_cache.c8
-rw-r--r--src/tests/eina/eina_suite.c34
-rw-r--r--src/tests/eina/eina_test_abi.c7
-rw-r--r--src/tests/eina/eina_test_accessor.c5
-rw-r--r--src/tests/eina/eina_test_array.c9
-rw-r--r--src/tests/eina/eina_test_barrier.c4
-rw-r--r--src/tests/eina/eina_test_bezier.c16
-rw-r--r--src/tests/eina/eina_test_binbuf.c22
-rw-r--r--src/tests/eina/eina_test_binshare.c16
-rw-r--r--src/tests/eina/eina_test_convert.c3
-rw-r--r--src/tests/eina/eina_test_counter.c6
-rw-r--r--src/tests/eina/eina_test_error.c15
-rw-r--r--src/tests/eina/eina_test_file.c32
-rw-r--r--src/tests/eina/eina_test_fp.c12
-rw-r--r--src/tests/eina/eina_test_freeq.c11
-rw-r--r--src/tests/eina/eina_test_hash.c28
-rw-r--r--src/tests/eina/eina_test_inarray.c21
-rw-r--r--src/tests/eina/eina_test_inlist.c9
-rw-r--r--src/tests/eina/eina_test_iterator.c12
-rw-r--r--src/tests/eina/eina_test_list.c14
-rw-r--r--src/tests/eina/eina_test_lock.c6
-rw-r--r--src/tests/eina/eina_test_log.c16
-rw-r--r--src/tests/eina/eina_test_magic.c2
-rw-r--r--src/tests/eina/eina_test_main.c11
-rw-r--r--src/tests/eina/eina_test_matrix.c14
-rw-r--r--src/tests/eina/eina_test_matrixsparse.c6
-rw-r--r--src/tests/eina/eina_test_module.c8
-rw-r--r--src/tests/eina/eina_test_quad.c2
-rw-r--r--src/tests/eina/eina_test_quadtree.c2
-rw-r--r--src/tests/eina/eina_test_quaternion.c33
-rw-r--r--src/tests/eina/eina_test_rbtree.c4
-rw-r--r--src/tests/eina/eina_test_rectangle.c6
-rw-r--r--src/tests/eina/eina_test_safepointer.c6
-rw-r--r--src/tests/eina/eina_test_sched.c2
-rw-r--r--src/tests/eina/eina_test_simple_xml_parser.c8
-rw-r--r--src/tests/eina/eina_test_slice.c2
-rw-r--r--src/tests/eina/eina_test_slstr.c16
-rw-r--r--src/tests/eina/eina_test_str.c14
-rw-r--r--src/tests/eina/eina_test_strbuf.c26
-rw-r--r--src/tests/eina/eina_test_tiler.c10
-rw-r--r--src/tests/eina/eina_test_tmpstr.c10
-rw-r--r--src/tests/eina/eina_test_trash.c2
-rw-r--r--src/tests/eina/eina_test_ustr.c20
-rw-r--r--src/tests/eina/eina_test_ustringshare.c6
-rw-r--r--src/tests/eina/eina_test_value.c54
-rw-r--r--src/tests/eina/eina_test_vector.c4
-rw-r--r--src/tests/eina/eina_test_vpath.c11
-rw-r--r--src/tests/eina/eina_test_xattr.c6
-rw-r--r--src/tests/eio/eio_suite.c14
-rw-r--r--src/tests/eldbus/eldbus_suite.c14
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_init.c45
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_message.c20
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model.c26
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_connection.c2
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_method.c4
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_object.c2
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_proxy.c2
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_signal.c3
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_object.c20
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_pending_cancel.c21
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_pending_data.c19
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_proxy.c19
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_signal_handler.c22
-rw-r--r--src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c4
-rw-r--r--src/tests/elementary/efl_ui_suite.c12
-rw-r--r--src/tests/elementary/elm_suite.c16
-rw-r--r--src/tests/elementary/elm_test_actionslider.c6
-rw-r--r--src/tests/elementary/elm_test_atspi.c55
-rw-r--r--src/tests/elementary/elm_test_bg.c5
-rw-r--r--src/tests/elementary/elm_test_box.c6
-rw-r--r--src/tests/elementary/elm_test_bubble.c6
-rw-r--r--src/tests/elementary/elm_test_button.c9
-rw-r--r--src/tests/elementary/elm_test_calendar.c6
-rw-r--r--src/tests/elementary/elm_test_check.c12
-rw-r--r--src/tests/elementary/elm_test_clock.c6
-rw-r--r--src/tests/elementary/elm_test_colorselector.c9
-rw-r--r--src/tests/elementary/elm_test_config.c12
-rw-r--r--src/tests/elementary/elm_test_conformant.c6
-rw-r--r--src/tests/elementary/elm_test_ctxpopup.c6
-rw-r--r--src/tests/elementary/elm_test_datetime.c6
-rw-r--r--src/tests/elementary/elm_test_dayselector.c6
-rw-r--r--src/tests/elementary/elm_test_diskselector.c6
-rw-r--r--src/tests/elementary/elm_test_entry.c36
-rw-r--r--src/tests/elementary/elm_test_fileselector.c10
-rw-r--r--src/tests/elementary/elm_test_fileselector_button.c6
-rw-r--r--src/tests/elementary/elm_test_fileselector_entry.c6
-rw-r--r--src/tests/elementary/elm_test_flip.c6
-rw-r--r--src/tests/elementary/elm_test_flipselector.c6
-rw-r--r--src/tests/elementary/elm_test_focus.c96
-rw-r--r--src/tests/elementary/elm_test_focus_sub.c12
-rw-r--r--src/tests/elementary/elm_test_frame.c6
-rw-r--r--src/tests/elementary/elm_test_gengrid.c9
-rw-r--r--src/tests/elementary/elm_test_genlist.c14
-rw-r--r--src/tests/elementary/elm_test_glview.c6
-rw-r--r--src/tests/elementary/elm_test_grid.c6
-rw-r--r--src/tests/elementary/elm_test_hover.c6
-rw-r--r--src/tests/elementary/elm_test_hoversel.c6
-rw-r--r--src/tests/elementary/elm_test_icon.c6
-rw-r--r--src/tests/elementary/elm_test_image.c15
-rw-r--r--src/tests/elementary/elm_test_index.c6
-rw-r--r--src/tests/elementary/elm_test_init.c5
-rw-r--r--src/tests/elementary/elm_test_inwin.c6
-rw-r--r--src/tests/elementary/elm_test_label.c6
-rw-r--r--src/tests/elementary/elm_test_layout.c12
-rw-r--r--src/tests/elementary/elm_test_list.c38
-rw-r--r--src/tests/elementary/elm_test_map.c6
-rw-r--r--src/tests/elementary/elm_test_mapbuf.c6
-rw-r--r--src/tests/elementary/elm_test_menu.c6
-rw-r--r--src/tests/elementary/elm_test_multibuttonentry.c6
-rw-r--r--src/tests/elementary/elm_test_naviframe.c6
-rw-r--r--src/tests/elementary/elm_test_notify.c6
-rw-r--r--src/tests/elementary/elm_test_panel.c6
-rw-r--r--src/tests/elementary/elm_test_panes.c6
-rw-r--r--src/tests/elementary/elm_test_photo.c6
-rw-r--r--src/tests/elementary/elm_test_photocam.c9
-rw-r--r--src/tests/elementary/elm_test_player.c6
-rw-r--r--src/tests/elementary/elm_test_plug.c6
-rw-r--r--src/tests/elementary/elm_test_popup.c6
-rw-r--r--src/tests/elementary/elm_test_prefs.c6
-rw-r--r--src/tests/elementary/elm_test_progressbar.c6
-rw-r--r--src/tests/elementary/elm_test_radio.c6
-rw-r--r--src/tests/elementary/elm_test_scroller.c6
-rw-r--r--src/tests/elementary/elm_test_segmentcontrol.c6
-rw-r--r--src/tests/elementary/elm_test_separator.c6
-rw-r--r--src/tests/elementary/elm_test_slider.c6
-rw-r--r--src/tests/elementary/elm_test_slideshow.c6
-rw-r--r--src/tests/elementary/elm_test_spinner.c6
-rw-r--r--src/tests/elementary/elm_test_table.c6
-rw-r--r--src/tests/elementary/elm_test_thumb.c6
-rw-r--r--src/tests/elementary/elm_test_toolbar.c6
-rw-r--r--src/tests/elementary/elm_test_video.c6
-rw-r--r--src/tests/elementary/elm_test_web.c6
-rw-r--r--src/tests/elementary/elm_test_win.c26
-rw-r--r--src/tests/elput/elput_suite.c13
-rw-r--r--src/tests/elput/elput_test_elput.c7
-rw-r--r--src/tests/elua/elua_lib.c4
-rw-r--r--src/tests/elua/elua_suite.c13
-rw-r--r--src/tests/emile/emile_suite.c13
-rw-r--r--src/tests/emile/emile_test_base.c2
-rw-r--r--src/tests/eo/suite/eo_suite.c13
-rw-r--r--src/tests/eo/suite/eo_test_call_errors.c8
-rw-r--r--src/tests/eo/suite/eo_test_class_behaviour_errors.c4
-rw-r--r--src/tests/eo/suite/eo_test_class_errors.c12
-rw-r--r--src/tests/eo/suite/eo_test_event.c6
-rw-r--r--src/tests/eo/suite/eo_test_general.c50
-rw-r--r--src/tests/eo/suite/eo_test_init.c4
-rw-r--r--src/tests/eo/suite/eo_test_threaded_calls.c2
-rw-r--r--src/tests/eo/suite/eo_test_value.c2
-rw-r--r--src/tests/eolian/eolian_parsing.c44
-rw-r--r--src/tests/eolian/eolian_suite.c13
-rw-r--r--src/tests/evas/evas_suite.c18
-rw-r--r--src/tests/evas/evas_test_callbacks.c1
-rw-r--r--src/tests/evas/evas_test_evasgl.c2
-rw-r--r--src/tests/evas/evas_test_filters.c2
-rw-r--r--src/tests/evas/evas_test_image.c10
-rw-r--r--src/tests/evas/evas_test_mask.c3
-rw-r--r--src/tests/evas/evas_test_mesh.c1
-rw-r--r--src/tests/evas/evas_test_object.c2
-rw-r--r--src/tests/evas/evas_test_object_smart.c1
-rw-r--r--src/tests/evas/evas_test_text.c1
-rw-r--r--src/tests/evas/evas_test_textblock.c1
-rw-r--r--src/tests/evas/evas_tests_helpers.h2
-rw-r--r--src/tests/evil/evil_suite.c14
-rw-r--r--src/tests/evil/evil_test_dlfcn.c4
-rw-r--r--src/tests/evil/evil_test_main.c2
-rw-r--r--src/tests/evil/evil_test_unistd.c6
206 files changed, 289 insertions, 2200 deletions
diff --git a/src/tests/ecore/ecore_suite.c b/src/tests/ecore/ecore_suite.c
index eb81132..4d619f1 100644
--- a/src/tests/ecore/ecore_suite.c
+++ b/src/tests/ecore/ecore_suite.c
@@ -4,6 +4,7 @@
4 4
5#include "ecore_suite.h" 5#include "ecore_suite.h"
6#include "../efl_check.h" 6#include "../efl_check.h"
7#include <Ecore.h>
7 8
8static const Efl_Test_Case etc[] = { 9static const Efl_Test_Case etc[] = {
9 { "Ecore", ecore_test_ecore }, 10 { "Ecore", ecore_test_ecore },
@@ -33,6 +34,16 @@ static const Efl_Test_Case etc[] = {
33 { NULL, NULL } 34 { NULL, NULL }
34}; 35};
35 36
37SUITE_INIT(ecore)
38{
39 ck_assert_int_eq(ecore_init(), 1);
40}
41
42SUITE_SHUTDOWN(ecore)
43{
44 ck_assert_int_eq(ecore_shutdown(), 0);
45}
46
36int 47int
37main(int argc, char **argv) 48main(int argc, char **argv)
38{ 49{
@@ -46,7 +57,7 @@ main(int argc, char **argv)
46#endif 57#endif
47 58
48 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 59 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
49 "Ecore", etc); 60 "Ecore", etc, SUITE_INIT_FN(ecore), SUITE_SHUTDOWN_FN(ecore));
50 61
51 return (failed_count == 0) ? 0 : 255; 62 return (failed_count == 0) ? 0 : 255;
52} 63}
diff --git a/src/tests/ecore/ecore_test_animator.c b/src/tests/ecore/ecore_test_animator.c
index 1ec956a..cbd790e 100644
--- a/src/tests/ecore/ecore_test_animator.c
+++ b/src/tests/ecore/ecore_test_animator.c
@@ -27,8 +27,6 @@ EFL_START_TEST(ecore_test_animators)
27 double interval1 = 0.02; 27 double interval1 = 0.02;
28 double interval2 = 0.01; 28 double interval2 = 0.01;
29 29
30 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
31
32 ecore_animator_frametime_set(interval1); 30 ecore_animator_frametime_set(interval1);
33 animator = ecore_animator_timeline_add(1, _anim_cb, &interval1); 31 animator = ecore_animator_timeline_add(1, _anim_cb, &interval1);
34 32
@@ -43,8 +41,6 @@ EFL_START_TEST(ecore_test_animators)
43 41
44 ecore_main_loop_begin(); 42 ecore_main_loop_begin();
45 43
46 ecore_shutdown();
47
48} 44}
49EFL_END_TEST 45EFL_END_TEST
50 46
@@ -132,8 +128,6 @@ EFL_START_TEST(ecore_test_begin_end_tick)
132 Eina_Bool is_begin_cb_called = EINA_FALSE; 128 Eina_Bool is_begin_cb_called = EINA_FALSE;
133 Eina_Bool is_end_cb_called = EINA_FALSE; 129 Eina_Bool is_end_cb_called = EINA_FALSE;
134 130
135 ecore_init();
136
137 ecore_animator_custom_source_tick_begin_callback_set(_animator_called_cb, &is_begin_cb_called); 131 ecore_animator_custom_source_tick_begin_callback_set(_animator_called_cb, &is_begin_cb_called);
138 ecore_animator_custom_source_tick_end_callback_set(_animator_called_cb, &is_end_cb_called); 132 ecore_animator_custom_source_tick_end_callback_set(_animator_called_cb, &is_end_cb_called);
139 133
@@ -153,8 +147,6 @@ EFL_START_TEST(ecore_test_begin_end_tick)
153 fail_if(!is_begin_cb_called); 147 fail_if(!is_begin_cb_called);
154 fail_if(!is_end_cb_called); 148 fail_if(!is_end_cb_called);
155 fail_if(!is_animator_cb_called); 149 fail_if(!is_animator_cb_called);
156
157 ecore_shutdown();
158} 150}
159EFL_END_TEST 151EFL_END_TEST
160 152
diff --git a/src/tests/ecore/ecore_test_args.c b/src/tests/ecore/ecore_test_args.c
index 75a9b7d..44fc033 100644
--- a/src/tests/ecore/ecore_test_args.c
+++ b/src/tests/ecore/ecore_test_args.c
@@ -26,12 +26,10 @@ _cb_args1(void *data EINA_UNUSED, const Efl_Event *event)
26 26
27EFL_START_TEST(ecore_test_args1) 27EFL_START_TEST(ecore_test_args1)
28{ 28{
29 ecore_init();
30 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, 29 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
31 _cb_args1, NULL); 30 _cb_args1, NULL);
32 ecore_loop_arguments_send(8, args); 31 ecore_loop_arguments_send(8, args);
33 ecore_main_loop_begin(); 32 ecore_main_loop_begin();
34 ecore_shutdown();
35} 33}
36EFL_END_TEST 34EFL_END_TEST
37 35
@@ -51,12 +49,10 @@ EFL_START_TEST(ecore_test_args2)
51 "hello world" 49 "hello world"
52 }; 50 };
53 51
54 ecore_init();
55 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, 52 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
56 _cb_args2, NULL); 53 _cb_args2, NULL);
57 ecore_loop_arguments_send(1, simple_args); 54 ecore_loop_arguments_send(1, simple_args);
58 ecore_main_loop_begin(); 55 ecore_main_loop_begin();
59 ecore_shutdown();
60} 56}
61EFL_END_TEST 57EFL_END_TEST
62 58
@@ -71,12 +67,10 @@ _cb_args3(void *data EINA_UNUSED, const Efl_Event *event)
71 67
72EFL_START_TEST(ecore_test_args3) 68EFL_START_TEST(ecore_test_args3)
73{ 69{
74 ecore_init();
75 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, 70 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
76 _cb_args3, NULL); 71 _cb_args3, NULL);
77 ecore_loop_arguments_send(0, NULL); 72 ecore_loop_arguments_send(0, NULL);
78 ecore_main_loop_begin(); 73 ecore_main_loop_begin();
79 ecore_shutdown();
80} 74}
81EFL_END_TEST 75EFL_END_TEST
82 76
diff --git a/src/tests/ecore/ecore_test_ecore.c b/src/tests/ecore/ecore_test_ecore.c
index acce1cc..a09b094 100644
--- a/src/tests/ecore/ecore_test_ecore.c
+++ b/src/tests/ecore/ecore_test_ecore.c
@@ -33,13 +33,6 @@ _dummy_cb(void *data)
33 33
34EFL_START_TEST(ecore_test_ecore_init) 34EFL_START_TEST(ecore_test_ecore_init)
35{ 35{
36 int ret;
37
38 ret = ecore_init();
39 fail_if(ret < 1);
40
41 ret = ecore_shutdown();
42 fail_if(ret != 0);
43} 36}
44EFL_END_TEST 37EFL_END_TEST
45 38
@@ -47,10 +40,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop)
47{ 40{
48 Eina_Bool did = EINA_FALSE; 41 Eina_Bool did = EINA_FALSE;
49 Ecore_Timer *timer; 42 Ecore_Timer *timer;
50 int ret;
51
52 ret = ecore_init();
53 fail_if(ret < 1);
54 43
55 timer = ecore_timer_add(0.0, _quit_cb, &did); 44 timer = ecore_timer_add(0.0, _quit_cb, &did);
56 fail_if(timer == NULL); 45 fail_if(timer == NULL);
@@ -58,8 +47,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop)
58 ecore_main_loop_begin(); 47 ecore_main_loop_begin();
59 48
60 fail_if(did == EINA_FALSE); 49 fail_if(did == EINA_FALSE);
61
62 ret = ecore_shutdown();
63} 50}
64EFL_END_TEST 51EFL_END_TEST
65 52
@@ -67,10 +54,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idler)
67{ 54{
68 Eina_Bool did = EINA_FALSE; 55 Eina_Bool did = EINA_FALSE;
69 Ecore_Idler *idler; 56 Ecore_Idler *idler;
70 int ret;
71
72 ret = ecore_init();
73 fail_if(ret < 1);
74 57
75 idler = ecore_idler_add(_quit_cb, &did); 58 idler = ecore_idler_add(_quit_cb, &did);
76 fail_if(idler == NULL); 59 fail_if(idler == NULL);
@@ -78,8 +61,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idler)
78 ecore_main_loop_begin(); 61 ecore_main_loop_begin();
79 62
80 fail_if(did == EINA_FALSE); 63 fail_if(did == EINA_FALSE);
81
82 ret = ecore_shutdown();
83} 64}
84EFL_END_TEST 65EFL_END_TEST
85 66
@@ -87,10 +68,7 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_enterer)
87{ 68{
88 Eina_Bool did = EINA_FALSE; 69 Eina_Bool did = EINA_FALSE;
89 Ecore_Idle_Enterer *idle_enterer; 70 Ecore_Idle_Enterer *idle_enterer;
90 int ret;
91 71
92 ret = ecore_init();
93 fail_if(ret < 1);
94 72
95 idle_enterer = ecore_idle_enterer_add(_quit_cb, &did); 73 idle_enterer = ecore_idle_enterer_add(_quit_cb, &did);
96 fail_if(idle_enterer == NULL); 74 fail_if(idle_enterer == NULL);
@@ -99,7 +77,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_enterer)
99 77
100 fail_if(did == EINA_FALSE); 78 fail_if(did == EINA_FALSE);
101 79
102 ret = ecore_shutdown();
103} 80}
104EFL_END_TEST 81EFL_END_TEST
105 82
@@ -107,10 +84,7 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_before_enterer)
107{ 84{
108 Eina_Bool did = EINA_FALSE; 85 Eina_Bool did = EINA_FALSE;
109 Ecore_Idle_Enterer *idle_enterer; 86 Ecore_Idle_Enterer *idle_enterer;
110 int ret;
111 87
112 ret = ecore_init();
113 fail_if(ret < 1);
114 88
115 idle_enterer = ecore_idle_enterer_before_add(_quit_cb, &did); 89 idle_enterer = ecore_idle_enterer_before_add(_quit_cb, &did);
116 fail_if(idle_enterer == NULL); 90 fail_if(idle_enterer == NULL);
@@ -119,7 +93,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_before_enterer)
119 93
120 fail_if(did == EINA_FALSE); 94 fail_if(did == EINA_FALSE);
121 95
122 ret = ecore_shutdown();
123} 96}
124EFL_END_TEST 97EFL_END_TEST
125 98
@@ -128,10 +101,7 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_exiter)
128 Eina_Bool did = EINA_FALSE; 101 Eina_Bool did = EINA_FALSE;
129 Ecore_Timer *timer; 102 Ecore_Timer *timer;
130 Ecore_Idle_Exiter *idle_exiter; 103 Ecore_Idle_Exiter *idle_exiter;
131 int ret;
132 104
133 ret = ecore_init();
134 fail_if(ret < 1);
135 105
136 /* make system exit idle */ 106 /* make system exit idle */
137 timer = ecore_timer_add(0.0, _dummy_cb, (void *)(long)0); 107 timer = ecore_timer_add(0.0, _dummy_cb, (void *)(long)0);
@@ -144,7 +114,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_exiter)
144 114
145 fail_if(did == EINA_FALSE); 115 fail_if(did == EINA_FALSE);
146 116
147 ret = ecore_shutdown();
148} 117}
149EFL_END_TEST 118EFL_END_TEST
150 119
@@ -153,10 +122,7 @@ EFL_START_TEST(ecore_test_ecore_main_loop_timer)
153 Eina_Bool did = EINA_FALSE; 122 Eina_Bool did = EINA_FALSE;
154 Ecore_Timer *timer; 123 Ecore_Timer *timer;
155 double start, end, elapsed; 124 double start, end, elapsed;
156 int ret;
157 125
158 ret = ecore_init();
159 fail_if(ret < 1);
160 126
161 timer = ecore_timer_add(2.0, _quit_cb, &did); 127 timer = ecore_timer_add(2.0, _quit_cb, &did);
162 fail_if(timer == NULL); 128 fail_if(timer == NULL);
@@ -170,7 +136,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_timer)
170 fail_if(elapsed < 2.0); 136 fail_if(elapsed < 2.0);
171 fail_if(elapsed > 3.0); /* 1 second "error margin" */ 137 fail_if(elapsed > 3.0); /* 1 second "error margin" */
172 138
173 ret = ecore_shutdown();
174} 139}
175EFL_END_TEST 140EFL_END_TEST
176 141
@@ -207,12 +172,8 @@ static Eina_Bool _timer1(void *data)
207EFL_START_TEST(ecore_test_ecore_main_loop_timer_inner) 172EFL_START_TEST(ecore_test_ecore_main_loop_timer_inner)
208{ 173{
209 Ecore_Timer *timer; 174 Ecore_Timer *timer;
210 int ret;
211 int times = 0; 175 int times = 0;
212 176
213 ret = ecore_init();
214 fail_if(ret < 1);
215
216 timer = ecore_timer_add(1.0, _timer1, &times); 177 timer = ecore_timer_add(1.0, _timer1, &times);
217 fail_if(timer == NULL); 178 fail_if(timer == NULL);
218 179
@@ -221,8 +182,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_timer_inner)
221 /*END: outer mainloop */ 182 /*END: outer mainloop */
222 183
223 fail_if(times != 1); 184 fail_if(times != 1);
224
225 ecore_shutdown();
226} 185}
227EFL_END_TEST 186EFL_END_TEST
228#endif 187#endif
@@ -245,9 +204,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler)
245 int comm[2]; 204 int comm[2];
246 int ret; 205 int ret;
247 206
248 ret = ecore_init();
249 fail_if(ret < 1);
250
251 ret = pipe(comm); 207 ret = pipe(comm);
252 fail_if(ret != 0); 208 fail_if(ret != 0);
253 209
@@ -265,7 +221,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler)
265 221
266 fail_if(did == EINA_FALSE); 222 fail_if(did == EINA_FALSE);
267 223
268 ret = ecore_shutdown();
269} 224}
270EFL_END_TEST 225EFL_END_TEST
271 226
@@ -275,9 +230,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_valid_flags)
275 int comm[2]; 230 int comm[2];
276 int ret; 231 int ret;
277 232
278 ret = ecore_init();
279 fail_if(ret < 1);
280
281 ret = pipe(comm); 233 ret = pipe(comm);
282 fail_if(ret != 0); 234 fail_if(ret != 0);
283 235
@@ -290,8 +242,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_valid_flags)
290 242
291 close(comm[0]); 243 close(comm[0]);
292 close(comm[1]); 244 close(comm[1]);
293
294 ecore_shutdown();
295} 245}
296EFL_END_TEST 246EFL_END_TEST
297 247
@@ -311,9 +261,6 @@ EFL_START_TEST(ecore_test_efl_loop_fd)
311 int comm[2]; 261 int comm[2];
312 int ret; 262 int ret;
313 263
314 ret = ecore_init();
315 fail_if(ret < 1);
316
317 ret = pipe(comm); 264 ret = pipe(comm);
318 fail_if(ret != 0); 265 fail_if(ret != 0);
319 266
@@ -332,7 +279,6 @@ EFL_START_TEST(ecore_test_efl_loop_fd)
332 279
333 fail_if(did == EINA_FALSE); 280 fail_if(did == EINA_FALSE);
334 281
335 ret = ecore_shutdown();
336} 282}
337EFL_END_TEST 283EFL_END_TEST
338 284
@@ -354,9 +300,6 @@ EFL_START_TEST(ecore_test_efl_loop_fd_lifecycle)
354 300
355 efl_object_init(); 301 efl_object_init();
356 302
357 ret = ecore_init();
358 fail_if(ret < 1);
359
360 ret = pipe(comm); 303 ret = pipe(comm);
361 fail_if(ret != 0); 304 fail_if(ret != 0);
362 305
@@ -378,7 +321,8 @@ EFL_START_TEST(ecore_test_efl_loop_fd_lifecycle)
378 fail_if(did == EINA_FALSE); 321 fail_if(did == EINA_FALSE);
379 fail_if(dead == EINA_TRUE); 322 fail_if(dead == EINA_TRUE);
380 323
381 ret = ecore_shutdown(); 324 ecore_shutdown();
325 ecore_init();
382 326
383 efl_del(fd); 327 efl_del(fd);
384 fail_if(dead == EINA_FALSE); 328 fail_if(dead == EINA_FALSE);
@@ -394,9 +338,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
394 int comm[2]; 338 int comm[2];
395 int ret; 339 int ret;
396 340
397 ret = ecore_init();
398 fail_if(ret < 1);
399
400 ret = pipe(comm); 341 ret = pipe(comm);
401 fail_if(ret != 0); 342 fail_if(ret != 0);
402 343
@@ -416,7 +357,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
416 357
417 fail_if(did != EINA_TRUE); 358 fail_if(did != EINA_TRUE);
418 359
419 ret = ecore_shutdown();
420} 360}
421EFL_END_TEST 361EFL_END_TEST
422 362
@@ -532,15 +472,11 @@ EFL_START_TEST(ecore_test_ecore_main_loop_event)
532 Ecore_Event_Filter *filter_handler; 472 Ecore_Event_Filter *filter_handler;
533 Ecore_Event *event; 473 Ecore_Event *event;
534 Ecore_Event *event2; 474 Ecore_Event *event2;
535 int res_counter;
536 int type, type2; 475 int type, type2;
537 int *ev = NULL; 476 int *ev = NULL;
538 int did = 0; 477 int did = 0;
539 int filter = 0; 478 int filter = 0;
540 479
541 res_counter = ecore_init();
542 fail_if(res_counter < 1);
543
544 /* Create 2 new event types */ 480 /* Create 2 new event types */
545 type = ecore_event_type_new(); 481 type = ecore_event_type_new();
546 fail_if(type < 1); 482 fail_if(type < 1);
@@ -627,8 +563,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_event)
627 563
628 /* Filter counter shouldn't change */ 564 /* Filter counter shouldn't change */
629 fail_if(filter != 0); // 0 565 fail_if(filter != 0); // 0
630
631 res_counter = ecore_shutdown();
632} 566}
633EFL_END_TEST 567EFL_END_TEST
634 568
@@ -678,14 +612,10 @@ EFL_START_TEST(ecore_test_ecore_main_loop_event_recursive)
678 */ 612 */
679 Ecore_Event *e; 613 Ecore_Event *e;
680 int type; 614 int type;
681 int ret;
682 615
683 _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN); 616 _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);
684 617
685 INF("main: begin"); 618 INF("main: begin");
686 ret = ecore_init();
687 fail_if(ret < 1);
688
689 619
690 type = ecore_event_type_new(); 620 type = ecore_event_type_new();
691 ecore_event_handler_add(type, _event_recursive_cb, NULL); 621 ecore_event_handler_add(type, _event_recursive_cb, NULL);
@@ -696,24 +626,18 @@ EFL_START_TEST(ecore_test_ecore_main_loop_event_recursive)
696 INF(" main loop end"); 626 INF(" main loop end");
697 627
698 INF("main: end"); 628 INF("main: end");
699 ecore_shutdown();
700} 629}
701EFL_END_TEST 630EFL_END_TEST
702#endif 631#endif
703 632
704EFL_START_TEST(ecore_test_ecore_app) 633EFL_START_TEST(ecore_test_ecore_app)
705{ 634{
706 int ret;
707
708 int argc_in = 2; 635 int argc_in = 2;
709 const char *argv_in[] = {"arg_str_1", "arg_str2"}; 636 const char *argv_in[] = {"arg_str_1", "arg_str2"};
710 637
711 int argc_out = 0; 638 int argc_out = 0;
712 char **argv_out = NULL; 639 char **argv_out = NULL;
713 640
714 ret = ecore_init();
715 fail_if(ret < 1);
716
717 ecore_app_args_set(argc_in, argv_in); 641 ecore_app_args_set(argc_in, argv_in);
718 ecore_app_args_get(&argc_out, &argv_out); 642 ecore_app_args_get(&argc_out, &argv_out);
719 643
@@ -724,7 +648,6 @@ EFL_START_TEST(ecore_test_ecore_app)
724 fail_if( 0 != strcmp(argv_in[i], argv_out[i]) ); 648 fail_if( 0 != strcmp(argv_in[i], argv_out[i]) );
725 } 649 }
726 650
727 ret = ecore_shutdown();
728} 651}
729EFL_END_TEST 652EFL_END_TEST
730 653
@@ -737,8 +660,6 @@ Eina_Bool _poller_cb(void *data)
737 660
738EFL_START_TEST(ecore_test_ecore_main_loop_poller) 661EFL_START_TEST(ecore_test_ecore_main_loop_poller)
739{ 662{
740 int ret;
741
742 Ecore_Poller *poll1_ptr = NULL; 663 Ecore_Poller *poll1_ptr = NULL;
743 int poll1_interval = 1; 664 int poll1_interval = 1;
744 int poll1_counter = 0; 665 int poll1_counter = 0;
@@ -753,9 +674,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_poller)
753 674
754 Eina_Bool did = EINA_FALSE; 675 Eina_Bool did = EINA_FALSE;
755 676
756 ret = ecore_init();
757 fail_if(ret < 1);
758
759 /* Check ECORE_POLLER_CORE poll interval */ 677 /* Check ECORE_POLLER_CORE poll interval */
760 double interval = 1.0; 678 double interval = 1.0;
761 ecore_poller_poll_interval_set(ECORE_POLLER_CORE, interval); 679 ecore_poller_poll_interval_set(ECORE_POLLER_CORE, interval);
@@ -789,7 +707,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_poller)
789 707
790 fail_if(did == EINA_FALSE); 708 fail_if(did == EINA_FALSE);
791 709
792 ret = ecore_shutdown();
793} 710}
794EFL_END_TEST 711EFL_END_TEST
795 712
@@ -828,13 +745,10 @@ Eina_Bool _poller_loop(void *data)
828 745
829EFL_START_TEST(ecore_test_ecore_main_loop_poller_add_del) 746EFL_START_TEST(ecore_test_ecore_main_loop_poller_add_del)
830{ 747{
831 int ret, count_res = 0; 748 int count_res = 0;
832 749
833 Eina_Bool did = EINA_FALSE; 750 Eina_Bool did = EINA_FALSE;
834 751
835 ret = ecore_init();
836 fail_if(ret < 1);
837
838 /* Create renewable main poller */ 752 /* Create renewable main poller */
839 Ecore_Poller *poll_ptr = ecore_poller_add(ECORE_POLLER_CORE, 1, _poller_loop, &count_res); 753 Ecore_Poller *poll_ptr = ecore_poller_add(ECORE_POLLER_CORE, 1, _poller_loop, &count_res);
840 754
@@ -853,7 +767,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_poller_add_del)
853 767
854 fail_if(did == EINA_FALSE); 768 fail_if(did == EINA_FALSE);
855 769
856 ret = ecore_shutdown();
857} 770}
858EFL_END_TEST 771EFL_END_TEST
859 772
diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c
index 6447e91..69bbaf6 100644
--- a/src/tests/ecore/ecore_test_ecore_audio.c
+++ b/src/tests/ecore/ecore_test_ecore_audio.c
@@ -601,12 +601,6 @@ void setup(void)
601{ 601{
602 int ret; 602 int ret;
603 603
604 ret = eina_init();
605 ck_assert_int_eq(ret, 1);
606
607 ret = ecore_init();
608 fail_if(ret < 1);
609
610 ret = ecore_audio_init(); 604 ret = ecore_audio_init();
611 ck_assert_int_eq(ret, 1); 605 ck_assert_int_eq(ret, 1);
612} 606}
@@ -614,8 +608,6 @@ void setup(void)
614void teardown(void) 608void teardown(void)
615{ 609{
616 ecore_audio_shutdown(); 610 ecore_audio_shutdown();
617 ecore_shutdown();
618 eina_shutdown();
619} 611}
620 612
621void 613void
diff --git a/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c b/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
index a787b97..13120e4 100644
--- a/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
+++ b/src/tests/ecore/ecore_test_ecore_thread_eina_thread_queue.c
@@ -73,9 +73,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
73{ 73{
74 int val = 99; 74 int val = 99;
75 75
76 eina_init();
77 ecore_init();
78
79 thq1 = eina_thread_queue_new(); 76 thq1 = eina_thread_queue_new();
80 if (!thq1) fail(); 77 if (!thq1) fail();
81 thq2 = eina_thread_queue_new(); 78 thq2 = eina_thread_queue_new();
@@ -101,8 +98,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
101 if (val == 1000) break; 98 if (val == 1000) break;
102 } 99 }
103 100
104 ecore_shutdown();
105 eina_shutdown();
106} 101}
107EFL_END_TEST 102EFL_END_TEST
108 103
@@ -144,9 +139,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t2)
144 int i, mcount; 139 int i, mcount;
145 Ecore_Thread *th; 140 Ecore_Thread *th;
146 141
147 eina_init();
148 ecore_init();
149
150 thq1 = eina_thread_queue_new(); 142 thq1 = eina_thread_queue_new();
151 if (!thq1) fail(); 143 if (!thq1) fail();
152 th = ecore_thread_feedback_run(thspeed2_do, NULL, NULL, NULL, NULL, EINA_TRUE); 144 th = ecore_thread_feedback_run(thspeed2_do, NULL, NULL, NULL, NULL, EINA_TRUE);
@@ -166,8 +158,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t2)
166 } 158 }
167 printf("%i messages sent\n", i); 159 printf("%i messages sent\n", i);
168 160
169 ecore_shutdown();
170 eina_shutdown();
171} 161}
172EFL_END_TEST 162EFL_END_TEST
173 163
@@ -221,9 +211,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
221 int val1 = 99, val2 = 99, cnt = 0; 211 int val1 = 99, val2 = 99, cnt = 0;
222 Eina_Thread_Queue *parent; 212 Eina_Thread_Queue *parent;
223 213
224 eina_init();
225 ecore_init();
226
227 thq1 = eina_thread_queue_new(); 214 thq1 = eina_thread_queue_new();
228 if (!thq1) fail(); 215 if (!thq1) fail();
229 thq2 = eina_thread_queue_new(); 216 thq2 = eina_thread_queue_new();
@@ -282,8 +269,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
282 } 269 }
283 printf("enough msgs\n"); 270 printf("enough msgs\n");
284 271
285 ecore_shutdown();
286 eina_shutdown();
287} 272}
288EFL_END_TEST 273EFL_END_TEST
289 274
@@ -335,9 +320,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t4)
335{ 320{
336 int cnt = 0; 321 int cnt = 0;
337 int val1 = 99, val2 = 9999; 322 int val1 = 99, val2 = 9999;
338
339 eina_init();
340 ecore_init();
341 thq1 = eina_thread_queue_new(); 323 thq1 = eina_thread_queue_new();
342 if (!thq1) fail(); 324 if (!thq1) fail();
343 ecore_thread_feedback_run(th41_do, NULL, NULL, NULL, NULL, EINA_TRUE); 325 ecore_thread_feedback_run(th41_do, NULL, NULL, NULL, NULL, EINA_TRUE);
@@ -372,8 +354,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t4)
372 } 354 }
373 printf("msgs ok\n"); 355 printf("msgs ok\n");
374 356
375 ecore_shutdown();
376 eina_shutdown();
377} 357}
378EFL_END_TEST 358EFL_END_TEST
379 359
@@ -439,7 +419,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
439{ 419{
440 int val = 99; 420 int val = 99;
441 421
442 ecore_init();
443 eina_semaphore_new(&th4_sem, 0); 422 eina_semaphore_new(&th4_sem, 0);
444 423
445 thq1 = eina_thread_queue_new(); 424 thq1 = eina_thread_queue_new();
@@ -481,8 +460,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
481 eina_semaphore_free(&th4_sem); 460 eina_semaphore_free(&th4_sem);
482 eina_thread_queue_free(thq1); 461 eina_thread_queue_free(thq1);
483 eina_thread_queue_free(thq2); 462 eina_thread_queue_free(thq2);
484
485 ecore_shutdown();
486} 463}
487EFL_END_TEST 464EFL_END_TEST
488 465
@@ -588,9 +565,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
588 565
589 if (DEBUG) setbuf(stdout, NULL); 566 if (DEBUG) setbuf(stdout, NULL);
590 567
591 eina_init();
592 ecore_init();
593
594 eina_semaphore_new(&th6_sem, 0); 568 eina_semaphore_new(&th6_sem, 0);
595 eina_spinlock_new(&msgnum_lock); 569 eina_spinlock_new(&msgnum_lock);
596 thq1 = eina_thread_queue_new(); 570 thq1 = eina_thread_queue_new();
@@ -628,8 +602,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
628 eina_thread_queue_free(thq1); 602 eina_thread_queue_free(thq1);
629 eina_spinlock_free(&msgnum_lock); 603 eina_spinlock_free(&msgnum_lock);
630 604
631 ecore_shutdown();
632 eina_shutdown();
633} 605}
634EFL_END_TEST 606EFL_END_TEST
635 607
@@ -662,9 +634,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
662 void *ref; 634 void *ref;
663 int msgcnt = 0, ret; 635 int msgcnt = 0, ret;
664 636
665 eina_init();
666 ecore_init();
667
668 thq1 = eina_thread_queue_new(); 637 thq1 = eina_thread_queue_new();
669 if (!thq1) fail(); 638 if (!thq1) fail();
670 if (pipe(p) != 0) 639 if (pipe(p) != 0)
@@ -694,8 +663,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
694 } 663 }
695 printf("msg fd ok\n"); 664 printf("msg fd ok\n");
696 665
697 ecore_shutdown();
698 eina_shutdown();
699} 666}
700EFL_END_TEST 667EFL_END_TEST
701 668
diff --git a/src/tests/ecore/ecore_test_job.c b/src/tests/ecore/ecore_test_job.c
index 496b449..5a2d6f3 100644
--- a/src/tests/ecore/ecore_test_job.c
+++ b/src/tests/ecore/ecore_test_job.c
@@ -19,16 +19,12 @@ EFL_START_TEST(ecore_test_job)
19 Eina_Bool bob = EINA_FALSE; 19 Eina_Bool bob = EINA_FALSE;
20 Ecore_Job *job; 20 Ecore_Job *job;
21 21
22 ecore_init();
23
24 job = ecore_job_add(&_ecore_quit, &bob); 22 job = ecore_job_add(&_ecore_quit, &bob);
25 fail_if(!job); 23 fail_if(!job);
26 24
27 ecore_main_loop_begin(); 25 ecore_main_loop_begin();
28 26
29 fail_if(bob != EINA_TRUE); 27 fail_if(bob != EINA_TRUE);
30
31 ecore_shutdown();
32} 28}
33EFL_END_TEST 29EFL_END_TEST
34 30
diff --git a/src/tests/ecore/ecore_test_promise.c b/src/tests/ecore/ecore_test_promise.c
index 90b96f3..83c34b6 100644
--- a/src/tests/ecore/ecore_test_promise.c
+++ b/src/tests/ecore/ecore_test_promise.c
@@ -64,8 +64,6 @@ EFL_START_TEST(efl_test_promise_future_success)
64 int progress = 7; 64 int progress = 7;
65 int value = 42; 65 int value = 42;
66 66
67 ecore_init();
68
69 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 67 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
70 fail_if(!p); 68 fail_if(!p);
71 69
@@ -91,7 +89,6 @@ EFL_START_TEST(efl_test_promise_future_success)
91 89
92 fail_if(!deadp); 90 fail_if(!deadp);
93 91
94 ecore_shutdown();
95} 92}
96EFL_END_TEST 93EFL_END_TEST
97 94
@@ -104,8 +101,6 @@ EFL_START_TEST(efl_test_promise_future_success_before_get)
104 Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE; 101 Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
105 int value = 42; 102 int value = 42;
106 103
107 ecore_init();
108
109 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 104 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
110 fail_if(!p); 105 fail_if(!p);
111 106
@@ -131,7 +126,6 @@ EFL_START_TEST(efl_test_promise_future_success_before_get)
131 126
132 fail_if(!deadp); 127 fail_if(!deadp);
133 128
134 ecore_shutdown();
135} 129}
136EFL_END_TEST 130EFL_END_TEST
137 131
@@ -144,8 +138,6 @@ EFL_START_TEST(efl_test_promise_future_cancel)
144 int progress = 7; 138 int progress = 7;
145 int value = 42; 139 int value = 42;
146 140
147 ecore_init();
148
149 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 141 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
150 fail_if(!p); 142 fail_if(!p);
151 143
@@ -175,7 +167,6 @@ EFL_START_TEST(efl_test_promise_future_cancel)
175 167
176 fail_if(!deadp); 168 fail_if(!deadp);
177 169
178 ecore_shutdown();
179} 170}
180EFL_END_TEST 171EFL_END_TEST
181 172
@@ -189,8 +180,6 @@ EFL_START_TEST(efl_test_promise_before_future_success)
189 int progress = 7; 180 int progress = 7;
190 int value = 42; 181 int value = 42;
191 182
192 ecore_init();
193
194 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 183 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
195 fail_if(!p); 184 fail_if(!p);
196 185
@@ -214,7 +203,6 @@ EFL_START_TEST(efl_test_promise_before_future_success)
214 203
215 fail_if(!deadp); 204 fail_if(!deadp);
216 205
217 ecore_shutdown();
218} 206}
219EFL_END_TEST 207EFL_END_TEST
220 208
@@ -227,8 +215,6 @@ EFL_START_TEST(efl_test_promise_before_future_cancel)
227 int progress = 7; 215 int progress = 7;
228 int value = 42; 216 int value = 42;
229 217
230 ecore_init();
231
232 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 218 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
233 fail_if(!p); 219 fail_if(!p);
234 220
@@ -257,7 +243,6 @@ EFL_START_TEST(efl_test_promise_before_future_cancel)
257 243
258 fail_if(!deadp); 244 fail_if(!deadp);
259 245
260 ecore_shutdown();
261} 246}
262EFL_END_TEST 247EFL_END_TEST
263 248
@@ -308,8 +293,6 @@ EFL_START_TEST(efl_test_promise_future_chain_success)
308 int progress = 7; 293 int progress = 7;
309 int value = 42; 294 int value = 42;
310 295
311 ecore_init();
312
313 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 296 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
314 fail_if(!p); 297 fail_if(!p);
315 298
@@ -341,7 +324,6 @@ EFL_START_TEST(efl_test_promise_future_chain_success)
341 324
342 fail_if(!deadp); 325 fail_if(!deadp);
343 326
344 ecore_shutdown();
345} 327}
346EFL_END_TEST 328EFL_END_TEST
347 329
@@ -355,8 +337,6 @@ EFL_START_TEST(efl_test_promise_future_chain_cancel)
355 int progress = 7; 337 int progress = 7;
356 int value = 42; 338 int value = 42;
357 339
358 ecore_init();
359
360 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 340 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
361 fail_if(!p); 341 fail_if(!p);
362 342
@@ -392,7 +372,6 @@ EFL_START_TEST(efl_test_promise_future_chain_cancel)
392 372
393 fail_if(!deadp); 373 fail_if(!deadp);
394 374
395 ecore_shutdown();
396} 375}
397EFL_END_TEST 376EFL_END_TEST
398 377
@@ -407,8 +386,6 @@ EFL_START_TEST(efl_test_promise_future_multi_success)
407 int progress = 7; 386 int progress = 7;
408 int value = 42; 387 int value = 42;
409 388
410 ecore_init();
411
412 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 389 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
413 fail_if(!p); 390 fail_if(!p);
414 391
@@ -438,7 +415,6 @@ EFL_START_TEST(efl_test_promise_future_multi_success)
438 415
439 fail_if(!deadp); 416 fail_if(!deadp);
440 417
441 ecore_shutdown();
442} 418}
443EFL_END_TEST 419EFL_END_TEST
444 420
@@ -452,8 +428,6 @@ EFL_START_TEST(efl_test_promise_future_multi_success_noref)
452 int progress = 7; 428 int progress = 7;
453 int value = 42; 429 int value = 42;
454 430
455 ecore_init();
456
457 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 431 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
458 fail_if(!p); 432 fail_if(!p);
459 433
@@ -481,7 +455,6 @@ EFL_START_TEST(efl_test_promise_future_multi_success_noref)
481 455
482 fail_if(!deadp); 456 fail_if(!deadp);
483 457
484 ecore_shutdown();
485} 458}
486EFL_END_TEST 459EFL_END_TEST
487 460
@@ -495,8 +468,6 @@ EFL_START_TEST(efl_test_promise_future_multi_cancel)
495 int progress = 7; 468 int progress = 7;
496 int value = 42; 469 int value = 42;
497 470
498 ecore_init();
499
500 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 471 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
501 fail_if(!p); 472 fail_if(!p);
502 473
@@ -528,7 +499,6 @@ EFL_START_TEST(efl_test_promise_future_multi_cancel)
528 499
529 fail_if(!deadp); 500 fail_if(!deadp);
530 501
531 ecore_shutdown();
532} 502}
533EFL_END_TEST 503EFL_END_TEST
534 504
@@ -543,8 +513,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_success)
543 int progress = 7; 513 int progress = 7;
544 int value = 42; 514 int value = 42;
545 515
546 ecore_init();
547
548 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 516 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
549 fail_if(!p); 517 fail_if(!p);
550 518
@@ -572,7 +540,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_success)
572 540
573 fail_if(!deadp); 541 fail_if(!deadp);
574 542
575 ecore_shutdown();
576} 543}
577EFL_END_TEST 544EFL_END_TEST
578 545
@@ -586,8 +553,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_success_noref)
586 int progress = 7; 553 int progress = 7;
587 int value = 42; 554 int value = 42;
588 555
589 ecore_init();
590
591 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 556 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
592 fail_if(!p); 557 fail_if(!p);
593 558
@@ -613,7 +578,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_success_noref)
613 578
614 fail_if(!deadp); 579 fail_if(!deadp);
615 580
616 ecore_shutdown();
617} 581}
618EFL_END_TEST 582EFL_END_TEST
619 583
@@ -628,8 +592,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_cancel)
628 int progress = 7; 592 int progress = 7;
629 int value = 42; 593 int value = 42;
630 594
631 ecore_init();
632
633 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 595 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
634 fail_if(!p); 596 fail_if(!p);
635 597
@@ -665,7 +627,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_cancel)
665 627
666 fail_if(!deadp); 628 fail_if(!deadp);
667 629
668 ecore_shutdown();
669} 630}
670EFL_END_TEST 631EFL_END_TEST
671 632
@@ -680,8 +641,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_cancel_noref)
680 int progress = 7; 641 int progress = 7;
681 int value = 42; 642 int value = 42;
682 643
683 ecore_init();
684
685 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 644 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
686 fail_if(!p); 645 fail_if(!p);
687 646
@@ -717,7 +676,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_cancel_noref)
717 676
718 fail_if(!deadp); 677 fail_if(!deadp);
719 678
720 ecore_shutdown();
721} 679}
722EFL_END_TEST 680EFL_END_TEST
723 681
@@ -740,8 +698,6 @@ EFL_START_TEST(efl_test_promise_future_optional_success)
740 698
741 cleanup = EINA_FALSE; 699 cleanup = EINA_FALSE;
742 700
743 ecore_init();
744
745 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 701 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
746 fail_if(!p); 702 fail_if(!p);
747 703
@@ -766,7 +722,6 @@ EFL_START_TEST(efl_test_promise_future_optional_success)
766 722
767 fail_if(!deadp || !cleanup); 723 fail_if(!deadp || !cleanup);
768 724
769 ecore_shutdown();
770} 725}
771EFL_END_TEST 726EFL_END_TEST
772 727
@@ -780,8 +735,6 @@ EFL_START_TEST(efl_test_promise_future_optional_cancel)
780 735
781 cleanup = EINA_FALSE; 736 cleanup = EINA_FALSE;
782 737
783 ecore_init();
784
785 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 738 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
786 fail_if(!p); 739 fail_if(!p);
787 740
@@ -810,7 +763,6 @@ EFL_START_TEST(efl_test_promise_future_optional_cancel)
810 763
811 fail_if(!deadp); 764 fail_if(!deadp);
812 765
813 ecore_shutdown();
814} 766}
815EFL_END_TEST 767EFL_END_TEST
816 768
@@ -841,8 +793,6 @@ EFL_START_TEST(efl_test_promise_all)
841 Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; 793 Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
842 Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; 794 Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
843 795
844 ecore_init();
845
846 p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 796 p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
847 p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 797 p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
848 p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 798 p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
@@ -881,7 +831,6 @@ EFL_START_TEST(efl_test_promise_all)
881 efl_del(p2); 831 efl_del(p2);
882 efl_del(p3); 832 efl_del(p3);
883 833
884 ecore_shutdown();
885} 834}
886EFL_END_TEST 835EFL_END_TEST
887 836
@@ -891,8 +840,6 @@ EFL_START_TEST(efl_test_promise_all_after_value_set)
891 Efl_Future *all = NULL, *f1, *f2, *f3; 840 Efl_Future *all = NULL, *f1, *f2, *f3;
892 Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; 841 Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
893 842
894 ecore_init();
895
896 p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 843 p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
897 p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 844 p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
898 p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 845 p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
@@ -925,7 +872,6 @@ EFL_START_TEST(efl_test_promise_all_after_value_set)
925 efl_del(p2); 872 efl_del(p2);
926 efl_del(p3); 873 efl_del(p3);
927 874
928 ecore_shutdown();
929} 875}
930EFL_END_TEST 876EFL_END_TEST
931 877
@@ -949,8 +895,6 @@ EFL_START_TEST(efl_test_promise_race)
949 Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; 895 Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
950 Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; 896 Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
951 897
952 ecore_init();
953
954 p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 898 p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
955 p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 899 p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
956 p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 900 p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
@@ -977,7 +921,6 @@ EFL_START_TEST(efl_test_promise_race)
977 efl_del(p2); 921 efl_del(p2);
978 efl_del(p3); 922 efl_del(p3);
979 923
980 ecore_shutdown();
981} 924}
982EFL_END_TEST 925EFL_END_TEST
983 926
@@ -987,8 +930,6 @@ EFL_START_TEST(efl_test_future_link)
987 Efl_Future *f; 930 Efl_Future *f;
988 Eo *o; 931 Eo *o;
989 932
990 ecore_init();
991
992 o = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(), 933 o = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
993 efl_loop_timer_interval_set(efl_added, 0.0)); 934 efl_loop_timer_interval_set(efl_added, 0.0));
994 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 935 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
@@ -1007,7 +948,6 @@ EFL_START_TEST(efl_test_future_link)
1007 efl_del(o); 948 efl_del(o);
1008 efl_del(p); 949 efl_del(p);
1009 950
1010 ecore_shutdown();
1011} 951}
1012EFL_END_TEST 952EFL_END_TEST
1013 953
@@ -1024,8 +964,6 @@ EFL_START_TEST(efl_test_recursive_mess)
1024 Efl_Promise *p; 964 Efl_Promise *p;
1025 Future_Ok done = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; 965 Future_Ok done = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
1026 966
1027 ecore_init();
1028
1029 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); 967 p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
1030 efl_future_use(&recursive_future, efl_promise_future_get(p)); 968 efl_future_use(&recursive_future, efl_promise_future_get(p));
1031 efl_future_then(recursive_future, _then_cleanup, _cancel, NULL, &done); 969 efl_future_then(recursive_future, _then_cleanup, _cancel, NULL, &done);
@@ -1036,7 +974,6 @@ EFL_START_TEST(efl_test_recursive_mess)
1036 974
1037 efl_del(p); 975 efl_del(p);
1038 976
1039 ecore_shutdown();
1040} 977}
1041EFL_END_TEST 978EFL_END_TEST
1042 979
diff --git a/src/tests/ecore/ecore_test_promise2.c b/src/tests/ecore/ecore_test_promise2.c
index 5cc28ae..d93a3e2 100644
--- a/src/tests/ecore/ecore_test_promise2.c
+++ b/src/tests/ecore/ecore_test_promise2.c
@@ -1316,9 +1316,23 @@ EFL_END_TEST
1316 1316
1317#endif 1317#endif
1318 1318
1319static void
1320promise_init(void)
1321{
1322 /* enable ecore init count manipulation for these tests */
1323 ecore_shutdown();
1324}
1325
1326static void
1327promise_shutdown(void)
1328{
1329 /* enable ecore init count manipulation for these tests */
1330 ecore_init();
1331}
1319 1332
1320void ecore_test_ecore_promise2(TCase *tc) 1333void ecore_test_ecore_promise2(TCase *tc)
1321{ 1334{
1335 tcase_add_checked_fixture(tc, promise_init, promise_shutdown);
1322 tcase_add_test(tc, efl_test_timeout); 1336 tcase_add_test(tc, efl_test_timeout);
1323 tcase_add_test(tc, efl_test_job); 1337 tcase_add_test(tc, efl_test_job);
1324 tcase_add_test(tc, efl_test_idle); 1338 tcase_add_test(tc, efl_test_idle);
diff --git a/src/tests/ecore/ecore_test_timer.c b/src/tests/ecore/ecore_test_timer.c
index 760a287..0004c0f 100644
--- a/src/tests/ecore/ecore_test_timer.c
+++ b/src/tests/ecore/ecore_test_timer.c
@@ -162,8 +162,6 @@ EFL_START_TEST(ecore_test_timers)
162 .precision = {0.01, 0.02, 0.03} 162 .precision = {0.01, 0.02, 0.03}
163 }; 163 };
164 164
165 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
166
167 timer.timer1 = ecore_timer_add(TIMEOUT_1, _timer1_cb, &timer); 165 timer.timer1 = ecore_timer_add(TIMEOUT_1, _timer1_cb, &timer);
168 timer.timer2 = ecore_timer_add(TIMEOUT_2, _timer2_cb, &timer); 166 timer.timer2 = ecore_timer_add(TIMEOUT_2, _timer2_cb, &timer);
169 timer.add_timer2++; 167 timer.add_timer2++;
@@ -185,9 +183,6 @@ EFL_START_TEST(ecore_test_timers)
185 ecore_timer_del(timer.timer4); 183 ecore_timer_del(timer.timer4);
186 if (timer.timer5) 184 if (timer.timer5)
187 ecore_timer_del(timer.timer5); 185 ecore_timer_del(timer.timer5);
188
189 ecore_shutdown();
190
191} 186}
192EFL_END_TEST 187EFL_END_TEST
193 188
@@ -216,17 +211,12 @@ EFL_START_TEST(ecore_test_timer_inside_call)
216{ 211{
217 Test_Inside_Call c; 212 Test_Inside_Call c;
218 213
219 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
220
221 c.start = ecore_time_get(); 214 c.start = ecore_time_get();
222 c.t = ecore_timer_add(0.01, _timeri_cb, &c); 215 c.t = ecore_timer_add(0.01, _timeri_cb, &c);
223 216
224 fail_if(!c.t, "Error add timer\n"); 217 fail_if(!c.t, "Error add timer\n");
225 218
226 ecore_main_loop_begin(); 219 ecore_main_loop_begin();
227
228 ecore_shutdown();
229
230} 220}
231EFL_END_TEST 221EFL_END_TEST
232 222
@@ -262,7 +252,6 @@ EFL_START_TEST(ecore_test_timer_lifecycle)
262 Eo *et; 252 Eo *et;
263 253
264 efl_object_init(); 254 efl_object_init();
265 ecore_init();
266 255
267 t = ecore_timer_add(1.0, _test_time_cb, &rl); 256 t = ecore_timer_add(1.0, _test_time_cb, &rl);
268 efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl); 257 efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
@@ -273,8 +262,6 @@ EFL_START_TEST(ecore_test_timer_lifecycle)
273 efl_loop_timer_interval_set(efl_added, 1.0)); 262 efl_loop_timer_interval_set(efl_added, 1.0));
274 efl_ref(et); 263 efl_ref(et);
275 264
276 ecore_shutdown();
277
278 fail_if(re == EINA_TRUE && rl == EINA_TRUE); 265 fail_if(re == EINA_TRUE && rl == EINA_TRUE);
279 fail_if(dl == EINA_FALSE); 266 fail_if(dl == EINA_FALSE);
280 fail_if(de == EINA_TRUE); 267 fail_if(de == EINA_TRUE);
@@ -289,10 +276,8 @@ EFL_END_TEST
289 276
290EFL_START_TEST(ecore_test_timer_valid_callbackfunc) 277EFL_START_TEST(ecore_test_timer_valid_callbackfunc)
291{ 278{
292 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
293 Ecore_Timer *t = NULL; 279 Ecore_Timer *t = NULL;
294 fail_if((t = ecore_timer_add(0.5, NULL, NULL)), "ERROR: Invalid callback func!\n"); 280 fail_if((t = ecore_timer_add(0.5, NULL, NULL)), "ERROR: Invalid callback func!\n");
295 ecore_shutdown();
296} 281}
297EFL_END_TEST 282EFL_END_TEST
298 283
diff --git a/src/tests/ecore/efl_app_suite.c b/src/tests/ecore/efl_app_suite.c
index 7523bda..93c9723 100644
--- a/src/tests/ecore/efl_app_suite.c
+++ b/src/tests/ecore/efl_app_suite.c
@@ -97,7 +97,7 @@ main(int argc, char **argv)
97#endif 97#endif
98 98
99 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 99 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
100 "Efl_App", etc); 100 "Efl_App", etc, NULL, NULL);
101 101
102 return (failed_count == 0) ? 0 : 255; 102 return (failed_count == 0) ? 0 : 255;
103} 103}
diff --git a/src/tests/ecore_con/ecore_con_suite.c b/src/tests/ecore_con/ecore_con_suite.c
index 1ef8b84..7f96297 100644
--- a/src/tests/ecore_con/ecore_con_suite.c
+++ b/src/tests/ecore_con/ecore_con_suite.c
@@ -4,6 +4,7 @@
4 4
5#include "ecore_con_suite.h" 5#include "ecore_con_suite.h"
6#include "../efl_check.h" 6#include "../efl_check.h"
7#include <Ecore_Con.h>
7 8
8static const Efl_Test_Case etc[] = { 9static const Efl_Test_Case etc[] = {
9 { "Ecore_Con", ecore_con_test_ecore_con }, 10 { "Ecore_Con", ecore_con_test_ecore_con },
@@ -13,6 +14,16 @@ static const Efl_Test_Case etc[] = {
13 { NULL, NULL } 14 { NULL, NULL }
14}; 15};
15 16
17SUITE_INIT(ecore_con)
18{
19 ck_assert_int_eq(ecore_con_init(), 1);
20}
21
22SUITE_SHUTDOWN(ecore_con)
23{
24 ck_assert_int_eq(ecore_con_shutdown(), 0);
25}
26
16int 27int
17main(int argc, char **argv) 28main(int argc, char **argv)
18{ 29{
@@ -26,7 +37,7 @@ main(int argc, char **argv)
26#endif 37#endif
27 38
28 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 39 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
29 "Ecore_Con", etc); 40 "Ecore_Con", etc, SUITE_INIT_FN(ecore_con), SUITE_SHUTDOWN_FN(ecore_con));
30 41
31 return (failed_count == 0) ? 0 : 255; 42 return (failed_count == 0) ? 0 : 255;
32} 43}
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con.c b/src/tests/ecore_con/ecore_con_test_ecore_con.c
index df481bc..86323a4 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con.c
@@ -200,11 +200,6 @@ void _ecore_con_server_client_tests(Ecore_Con_Type compl_type, const char *name,
200 void *del_ret; 200 void *del_ret;
201 const char *server_name; 201 const char *server_name;
202 202
203 ret = eina_init();
204 fail_if(ret != 1);
205 ret = ecore_con_init();
206 fail_if(ret != 1);
207
208 handlers[0] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, 203 handlers[0] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD,
209 _add, (void *) 1); 204 _add, (void *) 1);
210 fail_if(handlers[0] == NULL); 205 fail_if(handlers[0] == NULL);
@@ -316,10 +311,6 @@ void _ecore_con_server_client_tests(Ecore_Con_Type compl_type, const char *name,
316 fail_if (del_ret != (void *) 2); 311 fail_if (del_ret != (void *) 2);
317 del_ret = ecore_event_handler_del (handlers[5]); 312 del_ret = ecore_event_handler_del (handlers[5]);
318 fail_if (del_ret != (void *) 2); 313 fail_if (del_ret != (void *) 2);
319
320 ret = ecore_con_shutdown();
321 fail_if(ret != 0);
322 ret = eina_shutdown();
323} 314}
324 315
325EFL_START_TEST(ecore_test_ecore_con_local_user) 316EFL_START_TEST(ecore_test_ecore_con_local_user)
@@ -470,30 +461,12 @@ EFL_START_TEST(ecore_test_ecore_con_ssl_available)
470} 461}
471EFL_END_TEST 462EFL_END_TEST
472 463
473EFL_START_TEST(ecore_test_ecore_con_init)
474{
475 int ret;
476
477 ret = ecore_con_init();
478 fail_if(ret != 1);
479
480 ret = ecore_con_shutdown();
481 fail_if(ret != 0);
482}
483EFL_END_TEST
484
485EFL_START_TEST(ecore_test_ecore_con_dns) 464EFL_START_TEST(ecore_test_ecore_con_dns)
486{ 465{
487 Ecore_Con_Server *client; 466 Ecore_Con_Server *client;
488 Ecore_Event_Handler *e_err; 467 Ecore_Event_Handler *e_err;
489 Ecore_Event_Handler *e_add; 468 Ecore_Event_Handler *e_add;
490 Eina_Bool err_check = EINA_FALSE; 469 Eina_Bool err_check = EINA_FALSE;
491 int ret;
492
493 ret = eina_init();
494 fail_if(ret != 1);
495 ret = ecore_con_init();
496 fail_if(ret != 1);
497 470
498 e_add = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, _dns_add_del, (void *) &err_check); 471 e_add = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, _dns_add_del, (void *) &err_check);
499 e_err = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR, _dns_err, (void *) &err_check); 472 e_err = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR, _dns_err, (void *) &err_check);
@@ -509,27 +482,16 @@ EFL_START_TEST(ecore_test_ecore_con_dns)
509 fail_if (err_check == EINA_FALSE); 482 fail_if (err_check == EINA_FALSE);
510 fail_if (ecore_event_handler_del(e_err) != (void *) &err_check); 483 fail_if (ecore_event_handler_del(e_err) != (void *) &err_check);
511 fail_if (ecore_event_handler_del(e_add) != (void *) &err_check); 484 fail_if (ecore_event_handler_del(e_add) != (void *) &err_check);
512
513 ret = ecore_con_shutdown();
514 fail_if(ret != 0);
515 ret = eina_shutdown();
516} 485}
517EFL_END_TEST 486EFL_END_TEST
518 487
519EFL_START_TEST(ecore_test_ecore_con_shutdown_bef_init) 488EFL_START_TEST(ecore_test_ecore_con_shutdown_bef_init)
520{ 489{
521 int ret; 490 int ret = ecore_con_shutdown();
522
523 eina_init();
524 ret = ecore_con_shutdown();
525 fail_if(ret != 0); 491 fail_if(ret != 0);
526 492
527 ret = ecore_con_init();
528 fail_if(ret != 1);
529
530 ret = ecore_con_shutdown(); 493 ret = ecore_con_shutdown();
531 fail_if(ret != 0); 494 fail_if(ret != 0);
532 eina_shutdown();
533} 495}
534EFL_END_TEST 496EFL_END_TEST
535 497
@@ -549,19 +511,15 @@ _lookup_done_cb(const char *canonname, const char *ip, struct sockaddr *addr, in
549EFL_START_TEST(ecore_test_ecore_con_dns_lookup) 511EFL_START_TEST(ecore_test_ecore_con_dns_lookup)
550{ 512{
551 const char link[] = "www.google.com"; 513 const char link[] = "www.google.com";
552 ecore_con_init();
553 514
554 fail_unless(ecore_con_lookup(link, _lookup_done_cb, link)); 515 fail_unless(ecore_con_lookup(link, _lookup_done_cb, link));
555 516
556 ecore_main_loop_begin(); 517 ecore_main_loop_begin();
557
558 ecore_con_shutdown();
559} 518}
560EFL_END_TEST 519EFL_END_TEST
561 520
562void ecore_con_test_ecore_con(TCase *tc) 521void ecore_con_test_ecore_con(TCase *tc)
563{ 522{
564 tcase_add_test(tc, ecore_test_ecore_con_init);
565 tcase_add_test(tc, ecore_test_ecore_con_local_user); 523 tcase_add_test(tc, ecore_test_ecore_con_local_user);
566 tcase_add_test(tc, ecore_test_ecore_con_local_user_home); 524 tcase_add_test(tc, ecore_test_ecore_con_local_user_home);
567 tcase_add_test(tc, ecore_test_ecore_con_local_user_tmp); 525 tcase_add_test(tc, ecore_test_ecore_con_local_user_tmp);
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c b/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
index bc27f52..8cedac0 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
@@ -118,9 +118,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_cl)
118 int *cb_data = (int *) malloc(sizeof(int)); 118 int *cb_data = (int *) malloc(sizeof(int));
119 *cb_data = 1; 119 *cb_data = 1;
120 120
121 eina_init();
122 eet_init(); 121 eet_init();
123 ecore_con_init();
124 _ece_test_descriptor_init(); 122 _ece_test_descriptor_init();
125 123
126 svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 124 svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1",
@@ -165,9 +163,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_cl)
165 free(cb_data); 163 free(cb_data);
166 _ece_test_descriptor_shutdown(); 164 _ece_test_descriptor_shutdown();
167 ecore_con_server_del(svr); 165 ecore_con_server_del(svr);
168 ecore_con_shutdown();
169 eet_shutdown(); 166 eet_shutdown();
170 eina_shutdown();
171} 167}
172EFL_END_TEST 168EFL_END_TEST
173 169
@@ -200,9 +196,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_del)
200 int *cb_data = (int *) malloc(sizeof(int)); 196 int *cb_data = (int *) malloc(sizeof(int));
201 *cb_data = 0; 197 *cb_data = 0;
202 198
203 eina_init();
204 eet_init(); 199 eet_init();
205 ecore_con_init();
206 _ece_test_descriptor_init(); 200 _ece_test_descriptor_init();
207 201
208 svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 202 svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1",
@@ -235,9 +229,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_del)
235 229
236 free(cb_data); 230 free(cb_data);
237 _ece_test_descriptor_shutdown(); 231 _ece_test_descriptor_shutdown();
238 ecore_con_shutdown();
239 eet_shutdown(); 232 eet_shutdown();
240 eina_shutdown();
241} 233}
242EFL_END_TEST 234EFL_END_TEST
243 235
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
index c1da064..bdf26f0 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
@@ -172,8 +172,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
172 char link[] = ECORE_CON_FTP_TEST_URL; 172 char link[] = ECORE_CON_FTP_TEST_URL;
173 char url[4096], *username, *password, *file = NULL, *dir = NULL; 173 char url[4096], *username, *password, *file = NULL, *dir = NULL;
174 174
175 ret = eina_init();
176 fail_if(ret != 1);
177 ret = ecore_con_url_init(); 175 ret = ecore_con_url_init();
178 fail_if(ret != 1); 176 fail_if(ret != 1);
179 177
@@ -196,7 +194,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
196 194
197 ret = ecore_con_url_shutdown(); 195 ret = ecore_con_url_shutdown();
198 fail_if(ret != 0); 196 fail_if(ret != 0);
199 ret = eina_shutdown();
200} 197}
201EFL_END_TEST 198EFL_END_TEST
202#endif 199#endif
@@ -212,8 +209,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_post)
212 char *username = NULL, *password = NULL; 209 char *username = NULL, *password = NULL;
213 char url[4096]; 210 char url[4096];
214 211
215 ret = eina_init();
216 fail_if(ret != 1);
217 ret = ecore_con_url_init(); 212 ret = ecore_con_url_init();
218 fail_if(ret != 1); 213 fail_if(ret != 1);
219 214
@@ -240,7 +235,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_post)
240 235
241 ret = ecore_con_url_shutdown(); 236 ret = ecore_con_url_shutdown();
242 fail_if(ret != 0); 237 fail_if(ret != 0);
243 ret = eina_shutdown();
244} 238}
245EFL_END_TEST 239EFL_END_TEST
246#endif 240#endif
@@ -257,8 +251,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_download)
257#endif 251#endif
258 char url_data[] = "test"; 252 char url_data[] = "test";
259 253
260 ret = eina_init();
261 fail_if(ret != 1);
262 ret = ecore_con_url_init(); 254 ret = ecore_con_url_init();
263 fail_if(ret != 1); 255 fail_if(ret != 1);
264 256
@@ -290,7 +282,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_download)
290 282
291 ret = ecore_con_url_shutdown(); 283 ret = ecore_con_url_shutdown();
292 fail_if(ret != 0); 284 fail_if(ret != 0);
293 ret = eina_shutdown();
294} 285}
295EFL_END_TEST 286EFL_END_TEST
296 287
@@ -299,8 +290,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_create)
299 Ecore_Con_Url *url; 290 Ecore_Con_Url *url;
300 int ret; 291 int ret;
301 292
302 ret = eina_init();
303 fail_if(ret != 1);
304 ret = ecore_con_url_init(); 293 ret = ecore_con_url_init();
305 fail_if(ret != 1); 294 fail_if(ret != 1);
306 295
@@ -311,7 +300,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_create)
311 300
312 ret = ecore_con_url_shutdown(); 301 ret = ecore_con_url_shutdown();
313 fail_if(ret != 0); 302 fail_if(ret != 0);
314 ret = eina_shutdown();
315} 303}
316EFL_END_TEST 304EFL_END_TEST
317 305
@@ -359,8 +347,6 @@ _ecore_con_url_cookies_test_init()
359 const char link[] = DEFAULT_LINK; 347 const char link[] = DEFAULT_LINK;
360#endif 348#endif
361 349
362 eina_init();
363 ecore_con_init();
364 ecore_con_url_init(); 350 ecore_con_url_init();
365 351
366 ec_url = ecore_con_url_new(link); 352 ec_url = ecore_con_url_new(link);
@@ -385,8 +371,6 @@ _ecore_con_url_cookies_test_shutdown(Ecore_Con_Url *ec_url, int tmpfd, Eina_Tmps
385 eina_tmpstr_del(*path); 371 eina_tmpstr_del(*path);
386 ecore_con_url_free(ec_url); 372 ecore_con_url_free(ec_url);
387 ecore_con_url_shutdown(); 373 ecore_con_url_shutdown();
388 ecore_con_shutdown();
389 eina_shutdown();
390} 374}
391 375
392EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_clear) 376EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_clear)
diff --git a/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c b/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
index 477b242..a32f6ee 100644
--- a/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
+++ b/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
@@ -303,8 +303,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_ok)
303 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; 303 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
304 Eo *o; 304 Eo *o;
305 305
306 ecore_con_init();
307
308 addr.sin_port = htons(12345); 306 addr.sin_port = htons(12345);
309 addr.sin_addr.s_addr = htonl(0xabcdefafU); 307 addr.sin_addr.s_addr = htonl(0xabcdefafU);
310 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(), 308 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(),
@@ -330,8 +328,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_ok)
330 efl_net_ip_address_set(efl_added, slice)); 328 efl_net_ip_address_set(efl_added, slice));
331 _ipv4_check(o, &addr); 329 _ipv4_check(o, &addr);
332 efl_del(o); 330 efl_del(o);
333
334 ecore_con_shutdown();
335} 331}
336EFL_END_TEST 332EFL_END_TEST
337 333
@@ -345,8 +341,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
345 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; 341 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
346 Eo *o; 342 Eo *o;
347 343
348 ecore_con_init();
349
350 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true"); 344 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true");
351 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get()); 345 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get());
352 ck_assert_ptr_eq(o, NULL); 346 ck_assert_ptr_eq(o, NULL);
@@ -418,8 +412,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
418 TRAP_ERRORS_FINISH(1); 412 TRAP_ERRORS_FINISH(1);
419 413
420 efl_del(o); 414 efl_del(o);
421
422 ecore_con_shutdown();
423} 415}
424EFL_END_TEST 416EFL_END_TEST
425 417
@@ -431,8 +423,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
431 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; 423 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
432 Eo *o; 424 Eo *o;
433 425
434 ecore_con_init();
435
436 addr.sin_port = htons(12345); 426 addr.sin_port = htons(12345);
437 addr.sin_addr.s_addr = htonl(0xabcdefafU); 427 addr.sin_addr.s_addr = htonl(0xabcdefafU);
438 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 428 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
@@ -457,7 +447,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
457 _ipv4_check(o, &addr); 447 _ipv4_check(o, &addr);
458 efl_unref(o); 448 efl_unref(o);
459 449
460 ecore_con_shutdown();
461} 450}
462EFL_END_TEST 451EFL_END_TEST
463 452
@@ -467,8 +456,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
467 Eina_Slice wrong_slice = { .mem = &c, .len = 1 }; 456 Eina_Slice wrong_slice = { .mem = &c, .len = 1 };
468 Eo *o; 457 Eo *o;
469 458
470 ecore_con_init();
471
472 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true"); 459 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true");
473 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 460 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
474 1234, 461 1234,
@@ -476,7 +463,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
476 ck_assert_ptr_eq(o, NULL); 463 ck_assert_ptr_eq(o, NULL);
477 TRAP_ERRORS_FINISH(1); 464 TRAP_ERRORS_FINISH(1);
478 465
479 ecore_con_shutdown();
480} 466}
481EFL_END_TEST 467EFL_END_TEST
482 468
@@ -487,8 +473,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok)
487 }; 473 };
488 Eo *o; 474 Eo *o;
489 475
490 ecore_con_init();
491
492 addr.sin_port = htons(12345); 476 addr.sin_port = htons(12345);
493 addr.sin_addr.s_addr = htonl(0xabcdefafU); 477 addr.sin_addr.s_addr = htonl(0xabcdefafU);
494 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 478 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr);
@@ -503,7 +487,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok)
503 _ipv4_check(o, &addr); 487 _ipv4_check(o, &addr);
504 efl_unref(o); 488 efl_unref(o);
505 489
506 ecore_con_shutdown();
507} 490}
508EFL_END_TEST 491EFL_END_TEST
509 492
@@ -514,8 +497,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
514 }; 497 };
515 Eo *o; 498 Eo *o;
516 499
517 ecore_con_init();
518
519 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL"); 500 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL");
520 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL); 501 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL);
521 ck_assert_ptr_eq(o, NULL); 502 ck_assert_ptr_eq(o, NULL);
@@ -526,7 +507,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
526 ck_assert_ptr_eq(o, NULL); 507 ck_assert_ptr_eq(o, NULL);
527 TRAP_ERRORS_FINISH(1); 508 TRAP_ERRORS_FINISH(1);
528 509
529 ecore_con_shutdown();
530} 510}
531EFL_END_TEST 511EFL_END_TEST
532 512
@@ -534,8 +514,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok)
534{ 514{
535 Eo *o; 515 Eo *o;
536 516
537 ecore_con_init();
538
539 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345"); 517 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345");
540 ck_assert_ptr_ne(o, NULL); 518 ck_assert_ptr_ne(o, NULL);
541 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1:12345"); 519 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1:12345");
@@ -556,7 +534,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok)
556 ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80"); 534 ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80");
557 efl_unref(o); 535 efl_unref(o);
558 536
559 ecore_con_shutdown();
560} 537}
561EFL_END_TEST 538EFL_END_TEST
562 539
@@ -564,8 +541,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
564{ 541{
565 Eo *o; 542 Eo *o;
566 543
567 ecore_con_init();
568
569 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL"); 544 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL");
570 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL); 545 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL);
571 ck_assert_ptr_eq(o, NULL); 546 ck_assert_ptr_eq(o, NULL);
@@ -594,7 +569,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
594 ck_assert_ptr_eq(o, NULL); 569 ck_assert_ptr_eq(o, NULL);
595 TRAP_ERRORS_FINISH(0); /* no error messages! */ 570 TRAP_ERRORS_FINISH(0); /* no error messages! */
596 571
597 ecore_con_shutdown();
598} 572}
599EFL_END_TEST 573EFL_END_TEST
600 574
@@ -602,8 +576,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
602{ 576{
603 struct resolve_ctx ctx = { }; 577 struct resolve_ctx ctx = { };
604 578
605 ecore_con_init();
606
607 _resolve(&ctx, "localhost:http", 0, 0); 579 _resolve(&ctx, "localhost:http", 0, 0);
608 _assert_found(&ctx, "127.0.0.1:80", EINA_TRUE, 0); 580 _assert_found(&ctx, "127.0.0.1:80", EINA_TRUE, 0);
609 _resolve_cleanup(&ctx); 581 _resolve_cleanup(&ctx);
@@ -632,7 +604,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
632 _assert_found(&ctx, "[::1]:80", EINA_FALSE, 0); 604 _assert_found(&ctx, "[::1]:80", EINA_FALSE, 0);
633 _resolve_cleanup(&ctx); 605 _resolve_cleanup(&ctx);
634 606
635 ecore_con_shutdown();
636} 607}
637EFL_END_TEST 608EFL_END_TEST
638 609
@@ -640,8 +611,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
640{ 611{
641 struct resolve_ctx ctx = { }; 612 struct resolve_ctx ctx = { };
642 613
643 ecore_con_init();
644
645 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL"); 614 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL");
646 ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, 615 ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS,
647 NULL, 0, 0); 616 NULL, 0, 0);
@@ -662,7 +631,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
662 _assert_found(&ctx, "[::1]:http", EINA_FALSE, EFL_NET_ERROR_COULDNT_RESOLVE_HOST); 631 _assert_found(&ctx, "[::1]:http", EINA_FALSE, EFL_NET_ERROR_COULDNT_RESOLVE_HOST);
663 _resolve_cleanup(&ctx); 632 _resolve_cleanup(&ctx);
664 633
665 ecore_con_shutdown();
666} 634}
667EFL_END_TEST 635EFL_END_TEST
668 636
@@ -691,8 +659,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
691#undef TEST 659#undef TEST
692 }; 660 };
693 661
694 ecore_con_init();
695
696 for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++) 662 for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++)
697 { 663 {
698 struct sockaddr_in a = { 664 struct sockaddr_in a = {
@@ -719,7 +685,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
719 efl_unref(o); 685 efl_unref(o);
720 } 686 }
721 687
722 ecore_con_shutdown();
723} 688}
724EFL_END_TEST 689EFL_END_TEST
725 690
@@ -769,8 +734,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_ok)
769 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; 734 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
770 Eo *o; 735 Eo *o;
771 736
772 ecore_con_init();
773
774 addr.sin6_port = htons(12345); 737 addr.sin6_port = htons(12345);
775 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 738 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
776 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(), 739 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(),
@@ -789,7 +752,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_ok)
789 _ipv6_check(o, &addr); 752 _ipv6_check(o, &addr);
790 efl_del(o); 753 efl_del(o);
791 754
792 ecore_con_shutdown();
793} 755}
794EFL_END_TEST 756EFL_END_TEST
795 757
@@ -803,8 +765,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
803 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; 765 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
804 Eo *o; 766 Eo *o;
805 767
806 ecore_con_init();
807
808 /* generic errors checked at ecore_test_efl_net_ip_address_ipv4_manual_fail */ 768 /* generic errors checked at ecore_test_efl_net_ip_address_ipv4_manual_fail */
809 769
810 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: rw_slice.len != address.len is true"); 770 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: rw_slice.len != address.len is true");
@@ -849,7 +809,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
849 809
850 efl_del(o); 810 efl_del(o);
851 811
852 ecore_con_shutdown();
853} 812}
854EFL_END_TEST 813EFL_END_TEST
855 814
@@ -861,8 +820,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
861 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; 820 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
862 Eo *o; 821 Eo *o;
863 822
864 ecore_con_init();
865
866 addr.sin6_port = htons(12365); 823 addr.sin6_port = htons(12365);
867 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 824 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
868 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 825 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
@@ -887,7 +844,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
887 _ipv6_check(o, &addr); 844 _ipv6_check(o, &addr);
888 efl_unref(o); 845 efl_unref(o);
889 846
890 ecore_con_shutdown();
891} 847}
892EFL_END_TEST 848EFL_END_TEST
893 849
@@ -898,8 +854,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok)
898 }; 854 };
899 Eo *o; 855 Eo *o;
900 856
901 ecore_con_init();
902
903 addr.sin6_port = htons(12345); 857 addr.sin6_port = htons(12345);
904 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 858 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
905 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 859 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr);
@@ -914,7 +868,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok)
914 _ipv6_check(o, &addr); 868 _ipv6_check(o, &addr);
915 efl_unref(o); 869 efl_unref(o);
916 870
917 ecore_con_shutdown();
918} 871}
919EFL_END_TEST 872EFL_END_TEST
920 873
@@ -922,8 +875,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok)
922{ 875{
923 Eo *o; 876 Eo *o;
924 877
925 ecore_con_init();
926
927 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345"); 878 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345");
928 ck_assert_ptr_ne(o, NULL); 879 ck_assert_ptr_ne(o, NULL);
929 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345"); 880 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345");
@@ -1008,7 +959,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok)
1008 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]"); 959 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]");
1009 efl_unref(o); 960 efl_unref(o);
1010 961
1011 ecore_con_shutdown();
1012} 962}
1013EFL_END_TEST 963EFL_END_TEST
1014 964
@@ -1016,8 +966,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
1016{ 966{
1017 Eo *o; 967 Eo *o;
1018 968
1019 ecore_con_init();
1020
1021 /* generic error (null ptr) checked in ipv4_parse_fail */ 969 /* generic error (null ptr) checked in ipv4_parse_fail */
1022 970
1023 /* incomplete numbers */ 971 /* incomplete numbers */
@@ -1037,7 +985,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
1037 ck_assert_ptr_eq(o, NULL); 985 ck_assert_ptr_eq(o, NULL);
1038 TRAP_ERRORS_FINISH(0); /* no error messages! */ 986 TRAP_ERRORS_FINISH(0); /* no error messages! */
1039 987
1040 ecore_con_shutdown();
1041} 988}
1042EFL_END_TEST 989EFL_END_TEST
1043 990
@@ -1136,8 +1083,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
1136 char buf[4096]; 1083 char buf[4096];
1137 const char *localhost_str; 1084 const char *localhost_str;
1138 1085
1139 ecore_con_init();
1140
1141 localhost_str = _ipv6_localhost_check(); 1086 localhost_str = _ipv6_localhost_check();
1142 1087
1143 if (localhost_str) 1088 if (localhost_str)
@@ -1183,7 +1128,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
1183 _resolve_cleanup(&ctx); 1128 _resolve_cleanup(&ctx);
1184 } 1129 }
1185 1130
1186 ecore_con_shutdown();
1187} 1131}
1188EFL_END_TEST 1132EFL_END_TEST
1189 1133
@@ -1191,8 +1135,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
1191{ 1135{
1192 struct resolve_ctx ctx = { }; 1136 struct resolve_ctx ctx = { };
1193 1137
1194 ecore_con_init();
1195
1196 /* generic checks at ipv4_resolve_fail */ 1138 /* generic checks at ipv4_resolve_fail */
1197 1139
1198#if defined(AI_V4MAPPED) && (AI_V4MAPPED > 0) 1140#if defined(AI_V4MAPPED) && (AI_V4MAPPED > 0)
@@ -1201,7 +1143,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
1201 _resolve_cleanup(&ctx); 1143 _resolve_cleanup(&ctx);
1202#endif 1144#endif
1203 1145
1204 ecore_con_shutdown();
1205} 1146}
1206EFL_END_TEST 1147EFL_END_TEST
1207 1148
@@ -1221,8 +1162,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
1221#undef TEST 1162#undef TEST
1222 }; 1163 };
1223 1164
1224 ecore_con_init();
1225
1226 for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++) 1165 for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++)
1227 { 1166 {
1228 struct sockaddr_in6 a = { 1167 struct sockaddr_in6 a = {
@@ -1256,7 +1195,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
1256 efl_unref(o); 1195 efl_unref(o);
1257 } 1196 }
1258 1197
1259 ecore_con_shutdown();
1260} 1198}
1261EFL_END_TEST 1199EFL_END_TEST
1262 1200
diff --git a/src/tests/ector/suite/ector_suite.c b/src/tests/ector/suite/ector_suite.c
index 9f04a64..d2d3d92 100644
--- a/src/tests/ector/suite/ector_suite.c
+++ b/src/tests/ector/suite/ector_suite.c
@@ -22,12 +22,23 @@
22 22
23#include "ector_suite.h" 23#include "ector_suite.h"
24#include "../efl_check.h" 24#include "../efl_check.h"
25#include <Ector.h>
25 26
26static const Efl_Test_Case etc[] = { 27static const Efl_Test_Case etc[] = {
27 { "init", ector_test_init }, 28 { "init", ector_test_init },
28 { NULL, NULL } 29 { NULL, NULL }
29}; 30};
30 31
32SUITE_INIT(ector)
33{
34 ck_assert_int_eq(ector_init(), 1);
35}
36
37SUITE_SHUTDOWN(ector)
38{
39 ck_assert_int_eq(ector_shutdown(), 0);
40}
41
31int 42int
32main(int argc, char *argv[]) 43main(int argc, char *argv[])
33{ 44{
@@ -41,7 +52,7 @@ main(int argc, char *argv[])
41#endif 52#endif
42 53
43 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 54 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
44 "Ector", etc); 55 "Ector", etc, SUITE_INIT_FN(ector), SUITE_SHUTDOWN_FN(ector));
45 56
46 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 57 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
47} 58}
diff --git a/src/tests/ector/suite/ector_test_init.c b/src/tests/ector/suite/ector_test_init.c
index fd19c3d..6a1dddf 100644
--- a/src/tests/ector/suite/ector_test_init.c
+++ b/src/tests/ector/suite/ector_test_init.c
@@ -26,8 +26,6 @@
26 26
27EFL_START_TEST(ector_init_simple) 27EFL_START_TEST(ector_init_simple)
28{ 28{
29 fail_if(ector_init() != 1);
30 fail_if(ector_shutdown() != 0);
31} 29}
32EFL_END_TEST 30EFL_END_TEST
33 31
diff --git a/src/tests/edje/edje_suite.c b/src/tests/edje/edje_suite.c
index 0ec7d5c..80cb84a 100644
--- a/src/tests/edje/edje_suite.c
+++ b/src/tests/edje/edje_suite.c
@@ -4,12 +4,23 @@
4 4
5#include "edje_suite.h" 5#include "edje_suite.h"
6#include "../efl_check.h" 6#include "../efl_check.h"
7#include <Edje.h>
7 8
8static const Efl_Test_Case etc[] = { 9static const Efl_Test_Case etc[] = {
9 { "Edje", edje_test_edje }, 10 { "Edje", edje_test_edje },
10 { NULL, NULL } 11 { NULL, NULL }
11}; 12};
12 13
14SUITE_INIT(edje)
15{
16 ck_assert_int_eq(edje_init(), 1);
17}
18
19SUITE_SHUTDOWN(edje)
20{
21 ck_assert_int_eq(edje_shutdown(), 0);
22}
23
13int 24int
14main(int argc, char **argv) 25main(int argc, char **argv)
15{ 26{
@@ -23,7 +34,7 @@ main(int argc, char **argv)
23#endif 34#endif
24 35
25 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 36 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
26 "Edje", etc); 37 "Edje", etc, SUITE_INIT_FN(edje), SUITE_SHUTDOWN_FN(edje));
27 38
28 return (failed_count == 0) ? 0 : 255; 39 return (failed_count == 0) ? 0 : 255;
29} 40}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 2a36674..6ad1be7 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -18,13 +18,6 @@
18 18
19EFL_START_TEST(edje_test_edje_init) 19EFL_START_TEST(edje_test_edje_init)
20{ 20{
21 int ret;
22
23 ret = edje_init();
24 fail_if(ret != 1);
25
26 ret = edje_shutdown();
27 fail_if(ret != 0);
28} 21}
29EFL_END_TEST 22EFL_END_TEST
30 23
diff --git a/src/tests/eet/eet_suite.c b/src/tests/eet/eet_suite.c
index a1d7840..60cc8ce 100644
--- a/src/tests/eet/eet_suite.c
+++ b/src/tests/eet/eet_suite.c
@@ -6,6 +6,7 @@
6 6
7#include "eet_suite.h" 7#include "eet_suite.h"
8#include "../efl_check.h" 8#include "../efl_check.h"
9#include <Eet.h>
9 10
10char argv0[PATH_MAX]; 11char argv0[PATH_MAX];
11 12
@@ -25,6 +26,16 @@ static const Efl_Test_Case etc[] = {
25 { NULL, NULL } 26 { NULL, NULL }
26}; 27};
27 28
29SUITE_INIT(eet)
30{
31 ck_assert_int_eq(eet_init(), 1);
32}
33
34SUITE_SHUTDOWN(eet)
35{
36 ck_assert_int_eq(eet_shutdown(), 0);
37}
38
28int 39int
29main(int argc, char *argv[]) 40main(int argc, char *argv[])
30{ 41{
@@ -40,7 +51,7 @@ main(int argc, char *argv[])
40 memcpy(argv0, argv[0], strlen(argv[0]) + 1); 51 memcpy(argv0, argv[0], strlen(argv[0]) + 1);
41 52
42 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 53 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
43 "Eet", etc); 54 "Eet", etc, SUITE_INIT_FN(eet), SUITE_SHUTDOWN_FN(eet));
44 55
45 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 56 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
46} 57}
diff --git a/src/tests/eet/eet_test_cache.c b/src/tests/eet/eet_test_cache.c
index 02a51ed..6dee391 100644
--- a/src/tests/eet/eet_test_cache.c
+++ b/src/tests/eet/eet_test_cache.c
@@ -57,7 +57,6 @@ EFL_START_TEST(eet_test_cache_concurrency)
57 57
58 file = strdup("/tmp/eet_suite_testXXXXXX"); 58 file = strdup("/tmp/eet_suite_testXXXXXX");
59 59
60 eet_init();
61 eina_threads_init(); 60 eina_threads_init();
62 61
63 eina_lock_new(&open_worker_mutex); 62 eina_lock_new(&open_worker_mutex);
@@ -95,7 +94,6 @@ EFL_START_TEST(eet_test_cache_concurrency)
95 fail_if(unlink(file) != 0); 94 fail_if(unlink(file) != 0);
96 95
97 eina_threads_shutdown(); 96 eina_threads_shutdown();
98 eet_shutdown();
99} 97}
100EFL_END_TEST 98EFL_END_TEST
101 99
diff --git a/src/tests/eet/eet_test_cipher.c b/src/tests/eet/eet_test_cipher.c
index eacc8e0..c06c505 100644
--- a/src/tests/eet/eet_test_cipher.c
+++ b/src/tests/eet/eet_test_cipher.c
@@ -23,8 +23,6 @@ EFL_START_TEST(eet_test_cipher_decipher_simple)
23 int size; 23 int size;
24 int tmpfd; 24 int tmpfd;
25 25
26 eet_init();
27
28 fail_if(-1 == (tmpfd = mkstemp(file))); 26 fail_if(-1 == (tmpfd = mkstemp(file)));
29 fail_if(!!close(tmpfd)); 27 fail_if(!!close(tmpfd));
30 28
@@ -61,8 +59,6 @@ EFL_START_TEST(eet_test_cipher_decipher_simple)
61 eet_close(ef); 59 eet_close(ef);
62 60
63 fail_if(unlink(file) != 0); 61 fail_if(unlink(file) != 0);
64
65 eet_shutdown();
66} 62}
67EFL_END_TEST 63EFL_END_TEST
68 64
diff --git a/src/tests/eet/eet_test_connection.c b/src/tests/eet/eet_test_connection.c
index a839f51..173fa5a 100644
--- a/src/tests/eet/eet_test_connection.c
+++ b/src/tests/eet/eet_test_connection.c
@@ -95,8 +95,6 @@ EFL_START_TEST(eet_test_connection_check)
95 Eet_Test_Ex_Type etbt; 95 Eet_Test_Ex_Type etbt;
96 Eina_Bool on_going; 96 Eina_Bool on_going;
97 97
98 eet_init();
99
100 eet_test_ex_set(&etbt, 0); 98 eet_test_ex_set(&etbt, 0);
101 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 99 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
102 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 100 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@@ -139,8 +137,6 @@ EFL_START_TEST(eet_test_connection_check)
139 fail_if(!eet_connection_close(ecd.conn, &on_going)); 137 fail_if(!eet_connection_close(ecd.conn, &on_going));
140 138
141 fail_if(on_going); 139 fail_if(on_going);
142
143 eet_shutdown();
144} 140}
145EFL_END_TEST 141EFL_END_TEST
146 142
diff --git a/src/tests/eet/eet_test_data.c b/src/tests/eet/eet_test_data.c
index f657201..ae5d013 100644
--- a/src/tests/eet/eet_test_data.c
+++ b/src/tests/eet/eet_test_data.c
@@ -288,8 +288,6 @@ EFL_START_TEST(eet_test_data_basic_type_encoding_decoding)
288 void *transfert; 288 void *transfert;
289 int size; 289 int size;
290 290
291 eet_init();
292
293 eet_test_basic_set(&etbt, 0); 291 eet_test_basic_set(&etbt, 0);
294 292
295 eet_test_setup_eddc(&eddc); 293 eet_test_setup_eddc(&eddc);
@@ -313,8 +311,6 @@ EFL_START_TEST(eet_test_data_basic_type_encoding_decoding)
313 free(result); 311 free(result);
314 312
315 eet_data_descriptor_free(edd); 313 eet_data_descriptor_free(edd);
316
317 eet_shutdown();
318} 314}
319EFL_END_TEST 315EFL_END_TEST
320 316
@@ -328,8 +324,6 @@ EFL_START_TEST(eet_test_data_type_encoding_decoding)
328 int size; 324 int size;
329 int test; 325 int test;
330 326
331 eet_init();
332
333 eet_test_ex_set(&etbt, 0); 327 eet_test_ex_set(&etbt, 0);
334 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 328 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
335 etbt.hash = eina_hash_string_superfast_new(NULL); 329 etbt.hash = eina_hash_string_superfast_new(NULL);
@@ -379,8 +373,6 @@ EFL_START_TEST(eet_test_data_type_encoding_decoding)
379 eina_hash_foreach(result->ihash, func7, &test); 373 eina_hash_foreach(result->ihash, func7, &test);
380 374
381 fail_if(test != 0); 375 fail_if(test != 0);
382
383 eet_shutdown();
384} 376}
385EFL_END_TEST 377EFL_END_TEST
386 378
@@ -398,8 +390,6 @@ EFL_START_TEST(eet_test_data_type_dump_undump)
398 int size2; 390 int size2;
399 int test; 391 int test;
400 392
401 eet_init();
402
403 eet_test_ex_set(&etbt, 0); 393 eet_test_ex_set(&etbt, 0);
404 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 394 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
405 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 395 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@@ -470,7 +460,6 @@ EFL_START_TEST(eet_test_data_type_dump_undump)
470 460
471 fail_if(test != 0); 461 fail_if(test != 0);
472 462
473 eet_shutdown();
474} 463}
475EFL_END_TEST 464EFL_END_TEST
476 465
@@ -488,8 +477,6 @@ EFL_START_TEST(eet_test_data_type_escape_dump_undump)
488 " value \"\\\\My\\\\NewLine\\\\\" string: \"\\n\";\n" 477 " value \"\\\\My\\\\NewLine\\\\\" string: \"\\n\";\n"
489 "}\n"; 478 "}\n";
490 479
491 eet_init();
492
493 blob = eet_data_text_undump(inputstr, strlen(inputstr), &blob_len); 480 blob = eet_data_text_undump(inputstr, strlen(inputstr), &blob_len);
494 fail_if(!blob); 481 fail_if(!blob);
495 482
@@ -504,7 +491,6 @@ EFL_START_TEST(eet_test_data_type_escape_dump_undump)
504 eina_strbuf_free(strbuf); 491 eina_strbuf_free(strbuf);
505 free(blob); 492 free(blob);
506 493
507 eet_shutdown();
508} 494}
509EFL_END_TEST 495EFL_END_TEST
510 496
@@ -519,8 +505,6 @@ EFL_START_TEST(eet_test_data_fp)
519 void *blob; 505 void *blob;
520 int size; 506 int size;
521 507
522 eet_init();
523
524 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP); 508 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP);
525 edd_5FP = eet_data_descriptor_stream_new(&eddc); 509 edd_5FP = eet_data_descriptor_stream_new(&eddc);
526 510
@@ -566,7 +550,6 @@ EFL_START_TEST(eet_test_data_fp)
566 fail_if(convert->f1 != 1); 550 fail_if(convert->f1 != 1);
567 fail_if(convert->f0 != 0); 551 fail_if(convert->f0 != 0);
568 552
569 eet_shutdown();
570} 553}
571EFL_END_TEST 554EFL_END_TEST
572 555
@@ -582,9 +565,6 @@ EFL_START_TEST(eet_test_data_union)
582 int size; 565 int size;
583 int i; 566 int i;
584 567
585 eina_init();
586 eet_init();
587
588 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Union_Test); 568 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Union_Test);
589 edd = eet_data_descriptor_stream_new(&eddc); 569 edd = eet_data_descriptor_stream_new(&eddc);
590 570
@@ -642,9 +622,6 @@ EFL_START_TEST(eet_test_data_union)
642 EUT_CMP(2); 622 EUT_CMP(2);
643 EUT_CMP(3); 623 EUT_CMP(3);
644 } 624 }
645
646 eet_shutdown();
647 eina_shutdown();
648} 625}
649EFL_END_TEST 626EFL_END_TEST
650 627
@@ -663,9 +640,6 @@ EFL_START_TEST(eet_test_data_variant)
663 int size; 640 int size;
664 int i; 641 int i;
665 642
666 eina_init();
667 eet_init();
668
669 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Variant_Test); 643 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Variant_Test);
670 edd = eet_data_descriptor_stream_new(&eddc); 644 edd = eet_data_descriptor_stream_new(&eddc);
671 645
@@ -753,8 +727,6 @@ EFL_START_TEST(eet_test_data_variant)
753 EVT_CMP(3); 727 EVT_CMP(3);
754 } 728 }
755 729
756 eet_shutdown();
757 eina_shutdown();
758} /* EFL_START_TEST */ 730} /* EFL_START_TEST */
759EFL_END_TEST 731EFL_END_TEST
760 732
@@ -770,9 +742,6 @@ EFL_START_TEST(eet_test_data_hash_value)
770 double d; 742 double d;
771 char *s; 743 char *s;
772 744
773 eina_init();
774 eet_init();
775
776 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Hash); 745 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Hash);
777 edd = eet_data_descriptor_stream_new(&eddc); 746 edd = eet_data_descriptor_stream_new(&eddc);
778 747
@@ -810,9 +779,6 @@ EFL_START_TEST(eet_test_data_hash_value)
810 val = (Eina_Value *)eina_hash_find(h->hash, "val/string"); 779 val = (Eina_Value *)eina_hash_find(h->hash, "val/string");
811 eina_value_get(val, &s); 780 eina_value_get(val, &s);
812 fail_if((!val) || strcmp(s, EET_TEST_STRING)); 781 fail_if((!val) || strcmp(s, EET_TEST_STRING));
813
814 eet_shutdown();
815 eina_shutdown();
816} /* EFL_START_TEST */ 782} /* EFL_START_TEST */
817EFL_END_TEST 783EFL_END_TEST
818 784
diff --git a/src/tests/eet/eet_test_file.c b/src/tests/eet/eet_test_file.c
index c5e386f..6d77a7d 100644
--- a/src/tests/eet/eet_test_file.c
+++ b/src/tests/eet/eet_test_file.c
@@ -26,8 +26,6 @@ EFL_START_TEST(eet_test_file_simple_write)
26 26
27 file = strdup("/tmp/eet_suite_testXXXXXX"); 27 file = strdup("/tmp/eet_suite_testXXXXXX");
28 28
29 eet_init();
30
31 fail_if(-1 == (tmpfd = mkstemp(file))); 29 fail_if(-1 == (tmpfd = mkstemp(file)));
32 fail_if(!!close(tmpfd)); 30 fail_if(!!close(tmpfd));
33 31
@@ -120,7 +118,6 @@ EFL_START_TEST(eet_test_file_simple_write)
120 118
121 fail_if(unlink(file) != 0); 119 fail_if(unlink(file) != 0);
122 120
123 eet_shutdown();
124} 121}
125EFL_END_TEST 122EFL_END_TEST
126 123
@@ -140,8 +137,6 @@ EFL_START_TEST(eet_test_file_data)
140 137
141 file = strdup("/tmp/eet_suite_testXXXXXX"); 138 file = strdup("/tmp/eet_suite_testXXXXXX");
142 139
143 eet_init();
144
145 eet_test_ex_set(&etbt, 0); 140 eet_test_ex_set(&etbt, 0);
146 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 141 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
147 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 142 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@@ -280,7 +275,6 @@ EFL_START_TEST(eet_test_file_data)
280 275
281 fail_if(unlink(file) != 0); 276 fail_if(unlink(file) != 0);
282 277
283 eet_shutdown();
284} 278}
285EFL_END_TEST 279EFL_END_TEST
286 280
@@ -298,8 +292,6 @@ EFL_START_TEST(eet_test_file_data_dump)
298 292
299 file = strdup("/tmp/eet_suite_testXXXXXX"); 293 file = strdup("/tmp/eet_suite_testXXXXXX");
300 294
301 eet_init();
302
303 eet_test_ex_set(&etbt, 0); 295 eet_test_ex_set(&etbt, 0);
304 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 296 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
305 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 297 etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@@ -382,7 +374,6 @@ EFL_START_TEST(eet_test_file_data_dump)
382 374
383 fail_if(unlink(file) != 0); 375 fail_if(unlink(file) != 0);
384 376
385 eet_shutdown();
386} 377}
387EFL_END_TEST 378EFL_END_TEST
388 379
@@ -400,8 +391,6 @@ EFL_START_TEST(eet_test_file_fp)
400 391
401 file = strdup("/tmp/eet_suite_testXXXXXX"); 392 file = strdup("/tmp/eet_suite_testXXXXXX");
402 393
403 eet_init();
404
405 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP); 394 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP);
406 edd_5FP = eet_data_descriptor_file_new(&eddc); 395 edd_5FP = eet_data_descriptor_file_new(&eddc);
407 396
@@ -456,7 +445,6 @@ EFL_START_TEST(eet_test_file_fp)
456 445
457 fail_if(unlink(file) != 0); 446 fail_if(unlink(file) != 0);
458 447
459 eet_shutdown();
460} 448}
461EFL_END_TEST 449EFL_END_TEST
462 450
diff --git a/src/tests/eet/eet_test_identity.c b/src/tests/eet/eet_test_identity.c
index 19ffa92..641a53f 100644
--- a/src/tests/eet/eet_test_identity.c
+++ b/src/tests/eet/eet_test_identity.c
@@ -66,8 +66,6 @@ EFL_START_TEST(eet_test_identity_simple)
66 66
67 file = strdup("/tmp/eet_suite_testXXXXXX"); 67 file = strdup("/tmp/eet_suite_testXXXXXX");
68 68
69 eet_init();
70
71 fail_if(-1 == (fd = mkstemp(file))); 69 fail_if(-1 == (fd = mkstemp(file)));
72 fail_if(!!close(fd)); 70 fail_if(!!close(fd));
73 fail_if(!(noread = fopen("/dev/null", "wb"))); 71 fail_if(!(noread = fopen("/dev/null", "wb")));
@@ -129,7 +127,6 @@ EFL_START_TEST(eet_test_identity_simple)
129 127
130 fail_if(unlink(file) != 0); 128 fail_if(unlink(file) != 0);
131 129
132 eet_shutdown();
133} 130}
134EFL_END_TEST 131EFL_END_TEST
135 132
@@ -137,15 +134,12 @@ EFL_START_TEST(eet_test_identity_open_simple)
137{ 134{
138 Eet_Key *k = NULL; 135 Eet_Key *k = NULL;
139 136
140 eet_init();
141
142 k = eet_identity_open(_cert_pem, _key_pem, NULL); 137 k = eet_identity_open(_cert_pem, _key_pem, NULL);
143 fail_if(!k); 138 fail_if(!k);
144 139
145 if (k) 140 if (k)
146 eet_identity_close(k); 141 eet_identity_close(k);
147 142
148 eet_shutdown();
149} 143}
150EFL_END_TEST 144EFL_END_TEST
151 145
@@ -153,15 +147,12 @@ EFL_START_TEST(eet_test_identity_open_pkcs8)
153{ 147{
154 Eet_Key *k = NULL; 148 Eet_Key *k = NULL;
155 149
156 eet_init();
157
158 k = eet_identity_open(_cert_pem, _key_enc_none_pem, NULL); 150 k = eet_identity_open(_cert_pem, _key_enc_none_pem, NULL);
159 fail_if(!k); 151 fail_if(!k);
160 152
161 if (k) 153 if (k)
162 eet_identity_close(k); 154 eet_identity_close(k);
163 155
164 eet_shutdown();
165} 156}
166EFL_END_TEST 157EFL_END_TEST
167 158
@@ -169,8 +160,6 @@ EFL_START_TEST(eet_test_identity_open_pkcs8_enc)
169{ 160{
170 Eet_Key *k = NULL; 161 Eet_Key *k = NULL;
171 162
172 eet_init();
173
174 k = eet_identity_open(_cert_pem, _key_enc_pem, NULL); 163 k = eet_identity_open(_cert_pem, _key_enc_pem, NULL);
175 fail_if(k); 164 fail_if(k);
176 165
@@ -189,7 +178,6 @@ EFL_START_TEST(eet_test_identity_open_pkcs8_enc)
189 if (k) 178 if (k)
190 eet_identity_close(k); 179 eet_identity_close(k);
191 180
192 eet_shutdown();
193} 181}
194EFL_END_TEST 182EFL_END_TEST
195 183
diff --git a/src/tests/eet/eet_test_image.c b/src/tests/eet/eet_test_image.c
index 9214c2b..5e35e67 100644
--- a/src/tests/eet/eet_test_image.c
+++ b/src/tests/eet/eet_test_image.c
@@ -85,8 +85,6 @@ EFL_START_TEST(eet_test_image_normal)
85 85
86 file = strdup("/tmp/eet_suite_testXXXXXX"); 86 file = strdup("/tmp/eet_suite_testXXXXXX");
87 87
88 eet_init();
89
90 fail_if(-1 == (tmpfd = mkstemp(file))); 88 fail_if(-1 == (tmpfd = mkstemp(file)));
91 fail_if(!!close(tmpfd)); 89 fail_if(!!close(tmpfd));
92 90
@@ -428,7 +426,6 @@ EFL_START_TEST(eet_test_image_normal)
428 426
429 fail_if(unlink(file) != 0); 427 fail_if(unlink(file) != 0);
430 428
431 eet_shutdown();
432} 429}
433EFL_END_TEST 430EFL_END_TEST
434 431
@@ -454,8 +451,6 @@ EFL_START_TEST(eet_test_image_small)
454 image[2] = IM2; 451 image[2] = IM2;
455 image[3] = IM3; 452 image[3] = IM3;
456 453
457 eet_init();
458
459 fail_if(-1 == (tmpfd = mkstemp(file))); 454 fail_if(-1 == (tmpfd = mkstemp(file)));
460 fail_if(!!close(tmpfd)); 455 fail_if(!!close(tmpfd));
461 456
@@ -491,7 +486,6 @@ EFL_START_TEST(eet_test_image_small)
491 486
492 free(data); 487 free(data);
493 488
494 eet_shutdown();
495} 489}
496EFL_END_TEST 490EFL_END_TEST
497 491
diff --git a/src/tests/eet/eet_test_init.c b/src/tests/eet/eet_test_init.c
index f9a9cd9..bce13cb 100644
--- a/src/tests/eet/eet_test_init.c
+++ b/src/tests/eet/eet_test_init.c
@@ -8,13 +8,6 @@
8 8
9EFL_START_TEST(_eet_test_init) 9EFL_START_TEST(_eet_test_init)
10{ 10{
11 int ret;
12
13 ret = eet_init();
14 fail_if(ret != 1);
15
16 ret = eet_shutdown();
17 fail_if(ret != 0);
18} 11}
19EFL_END_TEST 12EFL_END_TEST
20 13
diff --git a/src/tests/eeze/eeze_suite.c b/src/tests/eeze/eeze_suite.c
index d96ab91..3b34930 100644
--- a/src/tests/eeze/eeze_suite.c
+++ b/src/tests/eeze/eeze_suite.c
@@ -4,6 +4,7 @@
4 4
5#include "eeze_suite.h" 5#include "eeze_suite.h"
6#include "../efl_check.h" 6#include "../efl_check.h"
7#include <Eeze.h>
7 8
8static const Efl_Test_Case etc[] = { 9static const Efl_Test_Case etc[] = {
9 { "Init", eeze_test_init }, 10 { "Init", eeze_test_init },
@@ -13,6 +14,16 @@ static const Efl_Test_Case etc[] = {
13 { NULL, NULL } 14 { NULL, NULL }
14}; 15};
15 16
17SUITE_INIT(eeze)
18{
19 ck_assert_int_eq(eeze_init(), 1);
20}
21
22SUITE_SHUTDOWN(eeze)
23{
24 ck_assert_int_eq(eeze_shutdown(), 0);
25}
26
16int 27int
17main(int argc, char *argv[]) 28main(int argc, char *argv[])
18{ 29{
@@ -26,7 +37,7 @@ main(int argc, char *argv[])
26#endif 37#endif
27 38
28 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 39 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
29 "Eeze", etc); 40 "Eeze", etc, SUITE_INIT_FN(eeze), SUITE_SHUTDOWN_FN(eeze));
30 41
31 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 42 return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
32} 43}
diff --git a/src/tests/eeze/eeze_test_init.c b/src/tests/eeze/eeze_test_init.c
index 3ffdc2c..0bdbe89 100644
--- a/src/tests/eeze/eeze_test_init.c
+++ b/src/tests/eeze/eeze_test_init.c
@@ -8,13 +8,6 @@
8 8
9EFL_START_TEST(eeze_test_eeze_init) 9EFL_START_TEST(eeze_test_eeze_init)
10{ 10{
11 int ret;
12
13 ret = eeze_init();
14 fail_if(ret != 1);
15
16 ret = eeze_shutdown();
17 fail_if(ret != 0);
18} 11}
19EFL_END_TEST 12EFL_END_TEST
20 13
diff --git a/src/tests/eeze/eeze_test_net.c b/src/tests/eeze/eeze_test_net.c
index f95a889..a3eca6a 100644
--- a/src/tests/eeze/eeze_test_net.c
+++ b/src/tests/eeze/eeze_test_net.c
@@ -9,30 +9,19 @@
9 9
10EFL_START_TEST(eeze_test_net_list) 10EFL_START_TEST(eeze_test_net_list)
11{ 11{
12 int ret;
13 Eina_List *list = NULL; 12 Eina_List *list = NULL;
14 13
15 ret = eeze_init();
16 fail_if(ret != 1);
17
18 list = eeze_net_list(); 14 list = eeze_net_list();
19 fail_if(list == NULL); 15 fail_if(list == NULL);
20
21 ret = eeze_shutdown();
22 fail_if(ret != 0);
23} 16}
24EFL_END_TEST 17EFL_END_TEST
25 18
26EFL_START_TEST(eeze_test_net_attr) 19EFL_START_TEST(eeze_test_net_attr)
27{ 20{
28 int ret;
29 int idx = 0; 21 int idx = 0;
30 Eeze_Net *net = NULL; 22 Eeze_Net *net = NULL;
31 const char *tmp = NULL; 23 const char *tmp = NULL;
32 24
33 ret = eeze_init();
34 fail_if(ret != 1);
35
36 net = eeze_net_new("lo"); 25 net = eeze_net_new("lo");
37 fail_if(net == NULL); 26 fail_if(net == NULL);
38 27
@@ -65,9 +54,6 @@ EFL_START_TEST(eeze_test_net_attr)
65 fail_if(tmp == NULL); 54 fail_if(tmp == NULL);
66 55
67 eeze_net_free(net); 56 eeze_net_free(net);
68
69 ret = eeze_shutdown();
70 fail_if(ret != 0);
71} 57}
72EFL_END_TEST 58EFL_END_TEST
73 59
@@ -75,13 +61,9 @@ EFL_END_TEST
75#ifdef HAVE_IPV6 61#ifdef HAVE_IPV6
76EFL_START_TEST(eeze_test_net_attr_ipv6) 62EFL_START_TEST(eeze_test_net_attr_ipv6)
77{ 63{
78 int ret;
79 Eeze_Net *net = NULL; 64 Eeze_Net *net = NULL;
80 const char *tmp = NULL; 65 const char *tmp = NULL;
81 66
82 ret = eeze_init();
83 fail_if(ret != 1);
84
85 net = eeze_net_new("lo"); 67 net = eeze_net_new("lo");
86 fail_if(net == NULL); 68 fail_if(net == NULL);
87 69
@@ -104,9 +86,6 @@ EFL_START_TEST(eeze_test_net_attr_ipv6)
104 86
105cleanup: 87cleanup:
106 eeze_net_free(net); 88 eeze_net_free(net);
107
108 ret = eeze_shutdown();
109 fail_if(ret != 0);
110} 89}
111EFL_END_TEST 90EFL_END_TEST
112#endif 91#endif
diff --git a/src/tests/eeze/eeze_test_sensor.c b/src/tests/eeze/eeze_test_sensor.c
index 920aeb5..0677eb1 100644
--- a/src/tests/eeze/eeze_test_sensor.c
+++ b/src/tests/eeze/eeze_test_sensor.c
@@ -36,16 +36,11 @@ event_cb(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
36EFL_START_TEST(eeze_test_sensor_read) 36EFL_START_TEST(eeze_test_sensor_read)
37{ 37{
38 Eeze_Sensor_Obj *sens = NULL; 38 Eeze_Sensor_Obj *sens = NULL;
39 int ret = 0;
40 float x, y, z; 39 float x, y, z;
41 int acc; 40 int acc;
42 double timestamp; 41 double timestamp;
43 Eina_Bool rc = EINA_FALSE; 42 Eina_Bool rc = EINA_FALSE;
44 43
45 ecore_init();
46 ret = eeze_init();
47 fail_if(ret != 1);
48
49 sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER); 44 sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER);
50 fail_if(sens == NULL); 45 fail_if(sens == NULL);
51 rc = eeze_sensor_read(sens); 46 rc = eeze_sensor_read(sens);
@@ -162,9 +157,6 @@ EFL_START_TEST(eeze_test_sensor_read)
162 157
163 /* Try free on NULL */ 158 /* Try free on NULL */
164 eeze_sensor_free(NULL); 159 eeze_sensor_free(NULL);
165
166 ret = eeze_shutdown();
167 fail_if(ret != 0);
168} 160}
169EFL_END_TEST 161EFL_END_TEST
170 162
@@ -173,13 +165,8 @@ EFL_START_TEST(eeze_test_sensor_async_read)
173 Ecore_Event_Handler *handler; 165 Ecore_Event_Handler *handler;
174 166
175 Eeze_Sensor_Obj *sens = NULL; 167 Eeze_Sensor_Obj *sens = NULL;
176 int ret = 0;
177 Eina_Bool rc = EINA_FALSE; 168 Eina_Bool rc = EINA_FALSE;
178 169
179 ecore_init();
180 ret = eeze_init();
181 fail_if(ret != 1);
182
183 handler = ecore_event_handler_add(EEZE_SENSOR_EVENT_ACCELEROMETER, event_cb, NULL); 170 handler = ecore_event_handler_add(EEZE_SENSOR_EVENT_ACCELEROMETER, event_cb, NULL);
184 fail_if(handler == NULL); 171 fail_if(handler == NULL);
185 sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER); 172 sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER);
@@ -238,20 +225,12 @@ EFL_START_TEST(eeze_test_sensor_async_read)
238 fail_if(rc != EINA_FALSE); 225 fail_if(rc != EINA_FALSE);
239 226
240 ecore_main_loop_begin(); 227 ecore_main_loop_begin();
241
242 ret = eeze_shutdown();
243 fail_if(ret != 0);
244} 228}
245EFL_END_TEST 229EFL_END_TEST
246 230
247EFL_START_TEST(eeze_test_sensor_obj_get) 231EFL_START_TEST(eeze_test_sensor_obj_get)
248{ 232{
249 Eeze_Sensor_Obj *obj = NULL, *obj_tmp = NULL; 233 Eeze_Sensor_Obj *obj = NULL, *obj_tmp = NULL;
250 int ret = 0;
251
252 ecore_init();
253 ret = eeze_init();
254 fail_if(ret != 1);
255 234
256 obj = calloc(1, sizeof(Eeze_Sensor_Obj)); 235 obj = calloc(1, sizeof(Eeze_Sensor_Obj));
257 fail_if(obj == NULL); 236 fail_if(obj == NULL);
@@ -266,9 +245,6 @@ EFL_START_TEST(eeze_test_sensor_obj_get)
266 /* Try to get non existing obj */ 245 /* Try to get non existing obj */
267 obj_tmp = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_LAST + 1); 246 obj_tmp = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_LAST + 1);
268 fail_if(obj_tmp != NULL); 247 fail_if(obj_tmp != NULL);
269
270 ret = eeze_shutdown();
271 fail_if(ret != 0);
272} 248}
273EFL_END_TEST 249EFL_END_TEST
274 250
diff --git a/src/tests/eeze/eeze_test_udev.c b/src/tests/eeze/eeze_test_udev.c
index d225bad..713d3d8 100644
--- a/src/tests/eeze/eeze_test_udev.c
+++ b/src/tests/eeze/eeze_test_udev.c
@@ -20,8 +20,6 @@ EFL_START_TEST(eeze_test_udev_types)
20{ 20{
21 Eina_List *type; 21 Eina_List *type;
22 22
23 eeze_init();
24
25 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_NONE, NULL); 23 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_NONE, NULL);
26 type = eeze_udev_find_unlisted_similar(type); 24 type = eeze_udev_find_unlisted_similar(type);
27 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL); 25 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL);
@@ -54,7 +52,6 @@ EFL_START_TEST(eeze_test_udev_types)
54 type = eeze_udev_find_by_type(0, NULL); 52 type = eeze_udev_find_by_type(0, NULL);
55 type = eeze_udev_find_unlisted_similar(type); 53 type = eeze_udev_find_unlisted_similar(type);
56 54
57 eeze_shutdown();
58} 55}
59EFL_END_TEST 56EFL_END_TEST
60#endif 57#endif
@@ -63,9 +60,6 @@ EFL_START_TEST(eeze_test_udev_watch)
63{ 60{
64 Eeze_Udev_Watch *watch; 61 Eeze_Udev_Watch *watch;
65 62
66 ecore_init();
67 eeze_init();
68
69 /* watch never gets triggered as this is run without user interaction */ 63 /* watch never gets triggered as this is run without user interaction */
70 watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL); 64 watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
71 watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_DRIVE_INTERNAL, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL); 65 watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_DRIVE_INTERNAL, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
@@ -77,9 +71,6 @@ EFL_START_TEST(eeze_test_udev_watch)
77 watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_GPIO, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL); 71 watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_GPIO, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
78 watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_NONE, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL); 72 watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_NONE, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
79 eeze_udev_watch_del(watch); 73 eeze_udev_watch_del(watch);
80
81 eeze_shutdown();
82 ecore_shutdown();
83} 74}
84EFL_END_TEST 75EFL_END_TEST
85 76
@@ -89,8 +80,6 @@ EFL_START_TEST(eeze_test_udev_syspath)
89 const char *name; 80 const char *name;
90 Eina_Bool r; 81 Eina_Bool r;
91 82
92 eeze_init();
93
94 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL); 83 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL);
95 type = eeze_udev_find_unlisted_similar(type); 84 type = eeze_udev_find_unlisted_similar(type);
96 EINA_LIST_FOREACH(type, l, name) 85 EINA_LIST_FOREACH(type, l, name)
@@ -147,8 +136,6 @@ EFL_START_TEST(eeze_test_udev_syspath)
147 } 136 }
148 137
149 eeze_udev_devpath_get_syspath("/dev/null"); 138 eeze_udev_devpath_get_syspath("/dev/null");
150
151 eeze_shutdown();
152} 139}
153EFL_END_TEST 140EFL_END_TEST
154 141
@@ -157,8 +144,6 @@ EFL_START_TEST(eeze_test_udev_attr)
157 Eina_List *type; 144 Eina_List *type;
158 const char *name, *check, *check2; 145 const char *name, *check, *check2;
159 146
160 eeze_init();
161
162 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL); 147 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL);
163 type = eeze_udev_find_unlisted_similar(type); 148 type = eeze_udev_find_unlisted_similar(type);
164 eeze_udev_find_by_filter("backlight", NULL, NULL); 149 eeze_udev_find_by_filter("backlight", NULL, NULL);
@@ -203,8 +188,6 @@ EFL_START_TEST(eeze_test_udev_attr)
203 } 188 }
204 eina_stringshare_del(name); 189 eina_stringshare_del(name);
205 } 190 }
206
207 eeze_shutdown();
208} 191}
209EFL_END_TEST 192EFL_END_TEST
210 193
@@ -215,8 +198,6 @@ EFL_START_TEST(eeze_test_udev_device)
215 _udev_device *device, *device2; 198 _udev_device *device, *device2;
216 const char *name; 199 const char *name;
217 200
218 eeze_init();
219
220 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL); 201 type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL);
221 fail_if(type == NULL); 202 fail_if(type == NULL);
222 type = eeze_udev_find_unlisted_similar(type); 203 type = eeze_udev_find_unlisted_similar(type);
@@ -236,8 +217,6 @@ EFL_START_TEST(eeze_test_udev_device)
236 217
237 device2 = _copy_device(device); 218 device2 = _copy_device(device);
238 fail_if(device2 != NULL); 219 fail_if(device2 != NULL);
239
240 eeze_shutdown();
241} 220}
242EFL_END_TEST 221EFL_END_TEST
243*/ 222*/
diff --git a/src/tests/efl/efl_suite.c b/src/tests/efl/efl_suite.c
index 82cc6df..d8aea76 100644
--- a/src/tests/efl/efl_suite.c
+++ b/src/tests/efl/efl_suite.c
@@ -20,7 +20,7 @@
20# include "config.h" 20# include "config.h"
21#endif 21#endif
22 22
23#include <Eina.h> 23#include <Ecore.h>
24 24
25#include "efl_suite.h" 25#include "efl_suite.h"
26#include "../efl_check.h" 26#include "../efl_check.h"
@@ -31,6 +31,16 @@ static const Efl_Test_Case etc[] = {
31 { NULL, NULL } 31 { NULL, NULL }
32}; 32};
33 33
34SUITE_INIT(efl)
35{
36 ck_assert_int_eq(ecore_init(), 1);
37}
38
39SUITE_SHUTDOWN(efl)
40{
41 ck_assert_int_eq(ecore_shutdown(), 0);
42}
43
34int 44int
35main(int argc, char **argv) 45main(int argc, char **argv)
36{ 46{
@@ -44,7 +54,7 @@ main(int argc, char **argv)
44 eina_init(); 54 eina_init();
45 55
46 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 56 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
47 "Efl", etc); 57 "Efl", etc, SUITE_INIT_FN(efl), SUITE_SHUTDOWN_FN(efl));
48 58
49 eina_shutdown(); 59 eina_shutdown();
50 60
diff --git a/src/tests/efl/efl_test_model_composite.c b/src/tests/efl/efl_test_model_composite.c
index f4c23f3..6d95816 100644
--- a/src/tests/efl/efl_test_model_composite.c
+++ b/src/tests/efl/efl_test_model_composite.c
@@ -178,9 +178,6 @@ EFL_START_TEST(efl_test_model_composite_boolean)
178 Test_Data *tdata; 178 Test_Data *tdata;
179 Efl_Future *future; 179 Efl_Future *future;
180 180
181 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
182 fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
183
184 eina_value_setup(&v, EINA_VALUE_TYPE_INT); 181 eina_value_setup(&v, EINA_VALUE_TYPE_INT);
185 182
186 base_model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get()); 183 base_model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
@@ -207,8 +204,6 @@ EFL_START_TEST(efl_test_model_composite_boolean)
207 while (!tdata->success_flag) ecore_main_loop_iterate(); 204 while (!tdata->success_flag) ecore_main_loop_iterate();
208 205
209 ck_assert(tdata->success_flag); 206 ck_assert(tdata->success_flag);
210
211 ecore_shutdown();
212} 207}
213EFL_END_TEST 208EFL_END_TEST
214 209
@@ -221,9 +216,6 @@ EFL_START_TEST(efl_test_model_composite_selection)
221 Test_Data *tdata; 216 Test_Data *tdata;
222 Efl_Future *future; 217 Efl_Future *future;
223 218
224 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
225 fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
226
227 eina_value_setup(&v, EINA_VALUE_TYPE_INT); 219 eina_value_setup(&v, EINA_VALUE_TYPE_INT);
228 220
229 base_model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get()); 221 base_model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
@@ -249,8 +241,6 @@ EFL_START_TEST(efl_test_model_composite_selection)
249 while (!tdata->success_flag) ecore_main_loop_iterate(); 241 while (!tdata->success_flag) ecore_main_loop_iterate();
250 242
251 ck_assert(tdata->success_flag); 243 ck_assert(tdata->success_flag);
252
253 ecore_shutdown();
254} 244}
255EFL_END_TEST 245EFL_END_TEST
256 246
diff --git a/src/tests/efl/efl_test_model_container.c b/src/tests/efl/efl_test_model_container.c
index cad5281..aee7dab 100644
--- a/src/tests/efl/efl_test_model_container.c
+++ b/src/tests/efl/efl_test_model_container.c
@@ -118,9 +118,6 @@ EFL_START_TEST(efl_test_model_container_values)
118 const char **cmp_str; 118 const char **cmp_str;
119 int i; 119 int i;
120 120
121 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
122 fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
123
124 cmp_int = calloc(8, sizeof(int*)); 121 cmp_int = calloc(8, sizeof(int*));
125 cmp_str = calloc(8, sizeof(const char*)); 122 cmp_str = calloc(8, sizeof(const char*));
126 for (i = 0; i < 7; ++i) 123 for (i = 0; i < 7; ++i)
@@ -158,8 +155,6 @@ EFL_START_TEST(efl_test_model_container_values)
158 155
159 ck_assert(!!test_data.pass_flag); 156 ck_assert(!!test_data.pass_flag);
160 ck_assert(!test_data.fail_flag); 157 ck_assert(!test_data.fail_flag);
161
162 ecore_shutdown();
163} 158}
164EFL_END_TEST 159EFL_END_TEST
165 160
diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h
index 60d4e78..a643d6f 100644
--- a/src/tests/efl_check.h
+++ b/src/tests/efl_check.h
@@ -192,7 +192,7 @@ _timing_end(void)
192#endif 192#endif
193 193
194EINA_UNUSED static int 194EINA_UNUSED static int
195_efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, const Efl_Test_Case *etc) 195_efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, const Efl_Test_Case *etc, SFun init, SFun shutdown)
196{ 196{
197 Suite *s; 197 Suite *s;
198 SRunner *sr; 198 SRunner *sr;
@@ -214,6 +214,8 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
214 continue; 214 continue;
215 215
216 tc = tcase_create(etc[i].test_case); 216 tc = tcase_create(etc[i].test_case);
217 if (init || shutdown)
218 tcase_add_checked_fixture(tc, init, shutdown);
217 219
218 if (_efl_test_fork_has(sr)) 220 if (_efl_test_fork_has(sr))
219 tcase_set_timeout(tc, 0); 221 tcase_set_timeout(tc, 0);
@@ -233,4 +235,9 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
233 return failed_count; 235 return failed_count;
234} 236}
235 237
238#define SUITE_INIT(NAME) static void _##NAME##_suite_init(void)
239#define SUITE_INIT_FN(NAME) _##NAME##_suite_init
240#define SUITE_SHUTDOWN(NAME) static void _##NAME##_suite_shutdown(void)
241#define SUITE_SHUTDOWN_FN(NAME) _##NAME##_suite_shutdown
242
236#endif 243#endif
diff --git a/src/tests/efreet/efreet_suite.c b/src/tests/efreet/efreet_suite.c
index 4632153..ea1161e 100644
--- a/src/tests/efreet/efreet_suite.c
+++ b/src/tests/efreet/efreet_suite.c
@@ -4,6 +4,7 @@
4 4
5#include "efreet_suite.h" 5#include "efreet_suite.h"
6#include "../efl_check.h" 6#include "../efl_check.h"
7#include <Efreet.h>
7 8
8static const Efl_Test_Case etc[] = { 9static const Efl_Test_Case etc[] = {
9 { "Efreet", efreet_test_efreet }, 10 { "Efreet", efreet_test_efreet },
@@ -11,6 +12,16 @@ static const Efl_Test_Case etc[] = {
11 { NULL, NULL } 12 { NULL, NULL }
12}; 13};
13 14
15SUITE_INIT(efreet)
16{
17 ck_assert_int_eq(efreet_init(), 1);
18}
19
20SUITE_SHUTDOWN(efreet)
21{
22 ck_assert_int_eq(efreet_shutdown(), 0);
23}
24
14int 25int
15main(int argc, char **argv) 26main(int argc, char **argv)
16{ 27{
@@ -24,7 +35,7 @@ main(int argc, char **argv)
24#endif 35#endif
25 36
26 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 37 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
27 "Efreet", etc); 38 "Efreet", etc, SUITE_INIT_FN(efreet), SUITE_SHUTDOWN_FN(efreet));
28 39
29 return (failed_count == 0) ? 0 : 255; 40 return (failed_count == 0) ? 0 : 255;
30} 41}
diff --git a/src/tests/efreet/efreet_test_efreet.c b/src/tests/efreet/efreet_test_efreet.c
index 2a74309..eec3b7f 100644
--- a/src/tests/efreet/efreet_test_efreet.c
+++ b/src/tests/efreet/efreet_test_efreet.c
@@ -9,13 +9,6 @@
9 9
10EFL_START_TEST(efreet_test_efreet_init) 10EFL_START_TEST(efreet_test_efreet_init)
11{ 11{
12 int ret;
13
14 ret = efreet_init();
15 fail_if(ret != 1);
16
17 ret = efreet_shutdown();
18 fail_if(ret != 0);
19} 12}
20EFL_END_TEST 13EFL_END_TEST
21 14
diff --git a/src/tests/efreet/efreet_test_efreet_cache.c b/src/tests/efreet/efreet_test_efreet_cache.c
index afb1549..83f882d 100644
--- a/src/tests/efreet/efreet_test_efreet_cache.c
+++ b/src/tests/efreet/efreet_test_efreet_cache.c
@@ -9,13 +9,7 @@
9 9
10EFL_START_TEST(efreet_test_efreet_cache_init) 10EFL_START_TEST(efreet_test_