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>
This commit is contained in:
Mike Blumenkrantz 2018-03-27 13:51:13 -04:00 committed by Stefan Schmidt
parent 730020c7d4
commit 624925fe6e
206 changed files with 289 additions and 2200 deletions

View File

@ -4,6 +4,7 @@
#include "ecore_suite.h" #include "ecore_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Ecore.h>
static const Efl_Test_Case etc[] = { static const Efl_Test_Case etc[] = {
{ "Ecore", ecore_test_ecore }, { "Ecore", ecore_test_ecore },
@ -33,6 +34,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(ecore)
{
ck_assert_int_eq(ecore_init(), 1);
}
SUITE_SHUTDOWN(ecore)
{
ck_assert_int_eq(ecore_shutdown(), 0);
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
@ -46,7 +57,7 @@ main(int argc, char **argv)
#endif #endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Ecore", etc); "Ecore", etc, SUITE_INIT_FN(ecore), SUITE_SHUTDOWN_FN(ecore));
return (failed_count == 0) ? 0 : 255; return (failed_count == 0) ? 0 : 255;
} }

View File

@ -27,8 +27,6 @@ EFL_START_TEST(ecore_test_animators)
double interval1 = 0.02; double interval1 = 0.02;
double interval2 = 0.01; double interval2 = 0.01;
fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
ecore_animator_frametime_set(interval1); ecore_animator_frametime_set(interval1);
animator = ecore_animator_timeline_add(1, _anim_cb, &interval1); animator = ecore_animator_timeline_add(1, _anim_cb, &interval1);
@ -43,8 +41,6 @@ EFL_START_TEST(ecore_test_animators)
ecore_main_loop_begin(); ecore_main_loop_begin();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -132,8 +128,6 @@ EFL_START_TEST(ecore_test_begin_end_tick)
Eina_Bool is_begin_cb_called = EINA_FALSE; Eina_Bool is_begin_cb_called = EINA_FALSE;
Eina_Bool is_end_cb_called = EINA_FALSE; Eina_Bool is_end_cb_called = EINA_FALSE;
ecore_init();
ecore_animator_custom_source_tick_begin_callback_set(_animator_called_cb, &is_begin_cb_called); ecore_animator_custom_source_tick_begin_callback_set(_animator_called_cb, &is_begin_cb_called);
ecore_animator_custom_source_tick_end_callback_set(_animator_called_cb, &is_end_cb_called); ecore_animator_custom_source_tick_end_callback_set(_animator_called_cb, &is_end_cb_called);
@ -153,8 +147,6 @@ EFL_START_TEST(ecore_test_begin_end_tick)
fail_if(!is_begin_cb_called); fail_if(!is_begin_cb_called);
fail_if(!is_end_cb_called); fail_if(!is_end_cb_called);
fail_if(!is_animator_cb_called); fail_if(!is_animator_cb_called);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -26,12 +26,10 @@ _cb_args1(void *data EINA_UNUSED, const Efl_Event *event)
EFL_START_TEST(ecore_test_args1) EFL_START_TEST(ecore_test_args1)
{ {
ecore_init();
efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
_cb_args1, NULL); _cb_args1, NULL);
ecore_loop_arguments_send(8, args); ecore_loop_arguments_send(8, args);
ecore_main_loop_begin(); ecore_main_loop_begin();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -51,12 +49,10 @@ EFL_START_TEST(ecore_test_args2)
"hello world" "hello world"
}; };
ecore_init();
efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
_cb_args2, NULL); _cb_args2, NULL);
ecore_loop_arguments_send(1, simple_args); ecore_loop_arguments_send(1, simple_args);
ecore_main_loop_begin(); ecore_main_loop_begin();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -71,12 +67,10 @@ _cb_args3(void *data EINA_UNUSED, const Efl_Event *event)
EFL_START_TEST(ecore_test_args3) EFL_START_TEST(ecore_test_args3)
{ {
ecore_init();
efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS, efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_ARGUMENTS,
_cb_args3, NULL); _cb_args3, NULL);
ecore_loop_arguments_send(0, NULL); ecore_loop_arguments_send(0, NULL);
ecore_main_loop_begin(); ecore_main_loop_begin();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -33,13 +33,6 @@ _dummy_cb(void *data)
EFL_START_TEST(ecore_test_ecore_init) EFL_START_TEST(ecore_test_ecore_init)
{ {
int ret;
ret = ecore_init();
fail_if(ret < 1);
ret = ecore_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST
@ -47,10 +40,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop)
{ {
Eina_Bool did = EINA_FALSE; Eina_Bool did = EINA_FALSE;
Ecore_Timer *timer; Ecore_Timer *timer;
int ret;
ret = ecore_init();
fail_if(ret < 1);
timer = ecore_timer_add(0.0, _quit_cb, &did); timer = ecore_timer_add(0.0, _quit_cb, &did);
fail_if(timer == NULL); fail_if(timer == NULL);
@ -58,8 +47,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop)
ecore_main_loop_begin(); ecore_main_loop_begin();
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -67,10 +54,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idler)
{ {
Eina_Bool did = EINA_FALSE; Eina_Bool did = EINA_FALSE;
Ecore_Idler *idler; Ecore_Idler *idler;
int ret;
ret = ecore_init();
fail_if(ret < 1);
idler = ecore_idler_add(_quit_cb, &did); idler = ecore_idler_add(_quit_cb, &did);
fail_if(idler == NULL); fail_if(idler == NULL);
@ -78,8 +61,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idler)
ecore_main_loop_begin(); ecore_main_loop_begin();
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -87,10 +68,7 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_enterer)
{ {
Eina_Bool did = EINA_FALSE; Eina_Bool did = EINA_FALSE;
Ecore_Idle_Enterer *idle_enterer; Ecore_Idle_Enterer *idle_enterer;
int ret;
ret = ecore_init();
fail_if(ret < 1);
idle_enterer = ecore_idle_enterer_add(_quit_cb, &did); idle_enterer = ecore_idle_enterer_add(_quit_cb, &did);
fail_if(idle_enterer == NULL); fail_if(idle_enterer == NULL);
@ -99,7 +77,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_enterer)
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -107,10 +84,7 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_before_enterer)
{ {
Eina_Bool did = EINA_FALSE; Eina_Bool did = EINA_FALSE;
Ecore_Idle_Enterer *idle_enterer; Ecore_Idle_Enterer *idle_enterer;
int ret;
ret = ecore_init();
fail_if(ret < 1);
idle_enterer = ecore_idle_enterer_before_add(_quit_cb, &did); idle_enterer = ecore_idle_enterer_before_add(_quit_cb, &did);
fail_if(idle_enterer == NULL); fail_if(idle_enterer == NULL);
@ -119,7 +93,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_before_enterer)
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -128,10 +101,7 @@ EFL_START_TEST(ecore_test_ecore_main_loop_idle_exiter)
Eina_Bool did = EINA_FALSE; Eina_Bool did = EINA_FALSE;
Ecore_Timer *timer; Ecore_Timer *timer;
Ecore_Idle_Exiter *idle_exiter; Ecore_Idle_Exiter *idle_exiter;
int ret;
ret = ecore_init();
fail_if(ret < 1);
/* make system exit idle */ /* make system exit idle */
timer = ecore_timer_add(0.0, _dummy_cb, (void *)(long)0); 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)
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -153,10 +122,7 @@ EFL_START_TEST(ecore_test_ecore_main_loop_timer)
Eina_Bool did = EINA_FALSE; Eina_Bool did = EINA_FALSE;
Ecore_Timer *timer; Ecore_Timer *timer;
double start, end, elapsed; double start, end, elapsed;
int ret;
ret = ecore_init();
fail_if(ret < 1);
timer = ecore_timer_add(2.0, _quit_cb, &did); timer = ecore_timer_add(2.0, _quit_cb, &did);
fail_if(timer == NULL); fail_if(timer == NULL);
@ -170,7 +136,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_timer)
fail_if(elapsed < 2.0); fail_if(elapsed < 2.0);
fail_if(elapsed > 3.0); /* 1 second "error margin" */ fail_if(elapsed > 3.0); /* 1 second "error margin" */
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -207,12 +172,8 @@ static Eina_Bool _timer1(void *data)
EFL_START_TEST(ecore_test_ecore_main_loop_timer_inner) EFL_START_TEST(ecore_test_ecore_main_loop_timer_inner)
{ {
Ecore_Timer *timer; Ecore_Timer *timer;
int ret;
int times = 0; int times = 0;
ret = ecore_init();
fail_if(ret < 1);
timer = ecore_timer_add(1.0, _timer1, &times); timer = ecore_timer_add(1.0, _timer1, &times);
fail_if(timer == NULL); fail_if(timer == NULL);
@ -221,8 +182,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_timer_inner)
/*END: outer mainloop */ /*END: outer mainloop */
fail_if(times != 1); fail_if(times != 1);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif
@ -245,9 +204,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler)
int comm[2]; int comm[2];
int ret; int ret;
ret = ecore_init();
fail_if(ret < 1);
ret = pipe(comm); ret = pipe(comm);
fail_if(ret != 0); fail_if(ret != 0);
@ -265,7 +221,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler)
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -275,9 +230,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_valid_flags)
int comm[2]; int comm[2];
int ret; int ret;
ret = ecore_init();
fail_if(ret < 1);
ret = pipe(comm); ret = pipe(comm);
fail_if(ret != 0); fail_if(ret != 0);
@ -290,8 +242,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_valid_flags)
close(comm[0]); close(comm[0]);
close(comm[1]); close(comm[1]);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -311,9 +261,6 @@ EFL_START_TEST(ecore_test_efl_loop_fd)
int comm[2]; int comm[2];
int ret; int ret;
ret = ecore_init();
fail_if(ret < 1);
ret = pipe(comm); ret = pipe(comm);
fail_if(ret != 0); fail_if(ret != 0);
@ -332,7 +279,6 @@ EFL_START_TEST(ecore_test_efl_loop_fd)
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -354,9 +300,6 @@ EFL_START_TEST(ecore_test_efl_loop_fd_lifecycle)
efl_object_init(); efl_object_init();
ret = ecore_init();
fail_if(ret < 1);
ret = pipe(comm); ret = pipe(comm);
fail_if(ret != 0); fail_if(ret != 0);
@ -378,7 +321,8 @@ EFL_START_TEST(ecore_test_efl_loop_fd_lifecycle)
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
fail_if(dead == EINA_TRUE); fail_if(dead == EINA_TRUE);
ret = ecore_shutdown(); ecore_shutdown();
ecore_init();
efl_del(fd); efl_del(fd);
fail_if(dead == EINA_FALSE); fail_if(dead == EINA_FALSE);
@ -394,9 +338,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
int comm[2]; int comm[2];
int ret; int ret;
ret = ecore_init();
fail_if(ret < 1);
ret = pipe(comm); ret = pipe(comm);
fail_if(ret != 0); fail_if(ret != 0);
@ -416,7 +357,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_fd_handler_activate_modify)
fail_if(did != EINA_TRUE); fail_if(did != EINA_TRUE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -532,15 +472,11 @@ EFL_START_TEST(ecore_test_ecore_main_loop_event)
Ecore_Event_Filter *filter_handler; Ecore_Event_Filter *filter_handler;
Ecore_Event *event; Ecore_Event *event;
Ecore_Event *event2; Ecore_Event *event2;
int res_counter;
int type, type2; int type, type2;
int *ev = NULL; int *ev = NULL;
int did = 0; int did = 0;
int filter = 0; int filter = 0;
res_counter = ecore_init();
fail_if(res_counter < 1);
/* Create 2 new event types */ /* Create 2 new event types */
type = ecore_event_type_new(); type = ecore_event_type_new();
fail_if(type < 1); fail_if(type < 1);
@ -627,8 +563,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_event)
/* Filter counter shouldn't change */ /* Filter counter shouldn't change */
fail_if(filter != 0); // 0 fail_if(filter != 0); // 0
res_counter = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -678,14 +612,10 @@ EFL_START_TEST(ecore_test_ecore_main_loop_event_recursive)
*/ */
Ecore_Event *e; Ecore_Event *e;
int type; int type;
int ret;
_log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN); _log_dom = eina_log_domain_register("test", EINA_COLOR_CYAN);
INF("main: begin"); INF("main: begin");
ret = ecore_init();
fail_if(ret < 1);
type = ecore_event_type_new(); type = ecore_event_type_new();
ecore_event_handler_add(type, _event_recursive_cb, NULL); ecore_event_handler_add(type, _event_recursive_cb, NULL);
@ -696,24 +626,18 @@ EFL_START_TEST(ecore_test_ecore_main_loop_event_recursive)
INF(" main loop end"); INF(" main loop end");
INF("main: end"); INF("main: end");
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif
EFL_START_TEST(ecore_test_ecore_app) EFL_START_TEST(ecore_test_ecore_app)
{ {
int ret;
int argc_in = 2; int argc_in = 2;
const char *argv_in[] = {"arg_str_1", "arg_str2"}; const char *argv_in[] = {"arg_str_1", "arg_str2"};
int argc_out = 0; int argc_out = 0;
char **argv_out = NULL; char **argv_out = NULL;
ret = ecore_init();
fail_if(ret < 1);
ecore_app_args_set(argc_in, argv_in); ecore_app_args_set(argc_in, argv_in);
ecore_app_args_get(&argc_out, &argv_out); ecore_app_args_get(&argc_out, &argv_out);
@ -724,7 +648,6 @@ EFL_START_TEST(ecore_test_ecore_app)
fail_if( 0 != strcmp(argv_in[i], argv_out[i]) ); fail_if( 0 != strcmp(argv_in[i], argv_out[i]) );
} }
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -737,8 +660,6 @@ Eina_Bool _poller_cb(void *data)
EFL_START_TEST(ecore_test_ecore_main_loop_poller) EFL_START_TEST(ecore_test_ecore_main_loop_poller)
{ {
int ret;
Ecore_Poller *poll1_ptr = NULL; Ecore_Poller *poll1_ptr = NULL;
int poll1_interval = 1; int poll1_interval = 1;
int poll1_counter = 0; int poll1_counter = 0;
@ -753,9 +674,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_poller)
Eina_Bool did = EINA_FALSE; Eina_Bool did = EINA_FALSE;
ret = ecore_init();
fail_if(ret < 1);
/* Check ECORE_POLLER_CORE poll interval */ /* Check ECORE_POLLER_CORE poll interval */
double interval = 1.0; double interval = 1.0;
ecore_poller_poll_interval_set(ECORE_POLLER_CORE, interval); ecore_poller_poll_interval_set(ECORE_POLLER_CORE, interval);
@ -789,7 +707,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_poller)
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -828,13 +745,10 @@ Eina_Bool _poller_loop(void *data)
EFL_START_TEST(ecore_test_ecore_main_loop_poller_add_del) EFL_START_TEST(ecore_test_ecore_main_loop_poller_add_del)
{ {
int ret, count_res = 0; int count_res = 0;
Eina_Bool did = EINA_FALSE; Eina_Bool did = EINA_FALSE;
ret = ecore_init();
fail_if(ret < 1);
/* Create renewable main poller */ /* Create renewable main poller */
Ecore_Poller *poll_ptr = ecore_poller_add(ECORE_POLLER_CORE, 1, _poller_loop, &count_res); Ecore_Poller *poll_ptr = ecore_poller_add(ECORE_POLLER_CORE, 1, _poller_loop, &count_res);
@ -853,7 +767,6 @@ EFL_START_TEST(ecore_test_ecore_main_loop_poller_add_del)
fail_if(did == EINA_FALSE); fail_if(did == EINA_FALSE);
ret = ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -601,12 +601,6 @@ void setup(void)
{ {
int ret; int ret;
ret = eina_init();
ck_assert_int_eq(ret, 1);
ret = ecore_init();
fail_if(ret < 1);
ret = ecore_audio_init(); ret = ecore_audio_init();
ck_assert_int_eq(ret, 1); ck_assert_int_eq(ret, 1);
} }
@ -614,8 +608,6 @@ void setup(void)
void teardown(void) void teardown(void)
{ {
ecore_audio_shutdown(); ecore_audio_shutdown();
ecore_shutdown();
eina_shutdown();
} }
void void

View File

@ -73,9 +73,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
{ {
int val = 99; int val = 99;
eina_init();
ecore_init();
thq1 = eina_thread_queue_new(); thq1 = eina_thread_queue_new();
if (!thq1) fail(); if (!thq1) fail();
thq2 = eina_thread_queue_new(); thq2 = eina_thread_queue_new();
@ -101,8 +98,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t1)
if (val == 1000) break; if (val == 1000) break;
} }
ecore_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -144,9 +139,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t2)
int i, mcount; int i, mcount;
Ecore_Thread *th; Ecore_Thread *th;
eina_init();
ecore_init();
thq1 = eina_thread_queue_new(); thq1 = eina_thread_queue_new();
if (!thq1) fail(); if (!thq1) fail();
th = ecore_thread_feedback_run(thspeed2_do, NULL, NULL, NULL, NULL, EINA_TRUE); 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)
} }
printf("%i messages sent\n", i); printf("%i messages sent\n", i);
ecore_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -221,9 +211,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
int val1 = 99, val2 = 99, cnt = 0; int val1 = 99, val2 = 99, cnt = 0;
Eina_Thread_Queue *parent; Eina_Thread_Queue *parent;
eina_init();
ecore_init();
thq1 = eina_thread_queue_new(); thq1 = eina_thread_queue_new();
if (!thq1) fail(); if (!thq1) fail();
thq2 = eina_thread_queue_new(); thq2 = eina_thread_queue_new();
@ -282,8 +269,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t3)
} }
printf("enough msgs\n"); printf("enough msgs\n");
ecore_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -335,9 +320,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t4)
{ {
int cnt = 0; int cnt = 0;
int val1 = 99, val2 = 9999; int val1 = 99, val2 = 9999;
eina_init();
ecore_init();
thq1 = eina_thread_queue_new(); thq1 = eina_thread_queue_new();
if (!thq1) fail(); if (!thq1) fail();
ecore_thread_feedback_run(th41_do, NULL, NULL, NULL, NULL, EINA_TRUE); 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)
} }
printf("msgs ok\n"); printf("msgs ok\n");
ecore_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -439,7 +419,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
{ {
int val = 99; int val = 99;
ecore_init();
eina_semaphore_new(&th4_sem, 0); eina_semaphore_new(&th4_sem, 0);
thq1 = eina_thread_queue_new(); thq1 = eina_thread_queue_new();
@ -481,8 +460,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t5)
eina_semaphore_free(&th4_sem); eina_semaphore_free(&th4_sem);
eina_thread_queue_free(thq1); eina_thread_queue_free(thq1);
eina_thread_queue_free(thq2); eina_thread_queue_free(thq2);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -588,9 +565,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
if (DEBUG) setbuf(stdout, NULL); if (DEBUG) setbuf(stdout, NULL);
eina_init();
ecore_init();
eina_semaphore_new(&th6_sem, 0); eina_semaphore_new(&th6_sem, 0);
eina_spinlock_new(&msgnum_lock); eina_spinlock_new(&msgnum_lock);
thq1 = eina_thread_queue_new(); thq1 = eina_thread_queue_new();
@ -628,8 +602,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t6)
eina_thread_queue_free(thq1); eina_thread_queue_free(thq1);
eina_spinlock_free(&msgnum_lock); eina_spinlock_free(&msgnum_lock);
ecore_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -662,9 +634,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
void *ref; void *ref;
int msgcnt = 0, ret; int msgcnt = 0, ret;
eina_init();
ecore_init();
thq1 = eina_thread_queue_new(); thq1 = eina_thread_queue_new();
if (!thq1) fail(); if (!thq1) fail();
if (pipe(p) != 0) if (pipe(p) != 0)
@ -694,8 +663,6 @@ EFL_START_TEST(ecore_test_ecore_thread_eina_thread_queue_t7)
} }
printf("msg fd ok\n"); printf("msg fd ok\n");
ecore_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -19,16 +19,12 @@ EFL_START_TEST(ecore_test_job)
Eina_Bool bob = EINA_FALSE; Eina_Bool bob = EINA_FALSE;
Ecore_Job *job; Ecore_Job *job;
ecore_init();
job = ecore_job_add(&_ecore_quit, &bob); job = ecore_job_add(&_ecore_quit, &bob);
fail_if(!job); fail_if(!job);
ecore_main_loop_begin(); ecore_main_loop_begin();
fail_if(bob != EINA_TRUE); fail_if(bob != EINA_TRUE);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -64,8 +64,6 @@ EFL_START_TEST(efl_test_promise_future_success)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -91,7 +89,6 @@ EFL_START_TEST(efl_test_promise_future_success)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -104,8 +101,6 @@ EFL_START_TEST(efl_test_promise_future_success_before_get)
Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE; Eina_Bool deadf = EINA_FALSE, deadp = EINA_FALSE;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -131,7 +126,6 @@ EFL_START_TEST(efl_test_promise_future_success_before_get)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -144,8 +138,6 @@ EFL_START_TEST(efl_test_promise_future_cancel)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -175,7 +167,6 @@ EFL_START_TEST(efl_test_promise_future_cancel)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -189,8 +180,6 @@ EFL_START_TEST(efl_test_promise_before_future_success)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -214,7 +203,6 @@ EFL_START_TEST(efl_test_promise_before_future_success)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -227,8 +215,6 @@ EFL_START_TEST(efl_test_promise_before_future_cancel)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -257,7 +243,6 @@ EFL_START_TEST(efl_test_promise_before_future_cancel)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -308,8 +293,6 @@ EFL_START_TEST(efl_test_promise_future_chain_success)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -341,7 +324,6 @@ EFL_START_TEST(efl_test_promise_future_chain_success)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -355,8 +337,6 @@ EFL_START_TEST(efl_test_promise_future_chain_cancel)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -392,7 +372,6 @@ EFL_START_TEST(efl_test_promise_future_chain_cancel)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -407,8 +386,6 @@ EFL_START_TEST(efl_test_promise_future_multi_success)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -438,7 +415,6 @@ EFL_START_TEST(efl_test_promise_future_multi_success)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -452,8 +428,6 @@ EFL_START_TEST(efl_test_promise_future_multi_success_noref)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -481,7 +455,6 @@ EFL_START_TEST(efl_test_promise_future_multi_success_noref)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -495,8 +468,6 @@ EFL_START_TEST(efl_test_promise_future_multi_cancel)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -528,7 +499,6 @@ EFL_START_TEST(efl_test_promise_future_multi_cancel)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -543,8 +513,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_success)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -572,7 +540,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_success)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -586,8 +553,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_success_noref)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -613,7 +578,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_success_noref)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -628,8 +592,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_cancel)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -665,7 +627,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_cancel)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -680,8 +641,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_cancel_noref)
int progress = 7; int progress = 7;
int value = 42; int value = 42;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -717,7 +676,6 @@ EFL_START_TEST(efl_test_promise_before_future_multi_cancel_noref)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -740,8 +698,6 @@ EFL_START_TEST(efl_test_promise_future_optional_success)
cleanup = EINA_FALSE; cleanup = EINA_FALSE;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -766,7 +722,6 @@ EFL_START_TEST(efl_test_promise_future_optional_success)
fail_if(!deadp || !cleanup); fail_if(!deadp || !cleanup);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -780,8 +735,6 @@ EFL_START_TEST(efl_test_promise_future_optional_cancel)
cleanup = EINA_FALSE; cleanup = EINA_FALSE;
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
fail_if(!p); fail_if(!p);
@ -810,7 +763,6 @@ EFL_START_TEST(efl_test_promise_future_optional_cancel)
fail_if(!deadp); fail_if(!deadp);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -841,8 +793,6 @@ EFL_START_TEST(efl_test_promise_all)
Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
ecore_init();
p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
@ -881,7 +831,6 @@ EFL_START_TEST(efl_test_promise_all)
efl_del(p2); efl_del(p2);
efl_del(p3); efl_del(p3);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -891,8 +840,6 @@ EFL_START_TEST(efl_test_promise_all_after_value_set)
Efl_Future *all = NULL, *f1, *f2, *f3; Efl_Future *all = NULL, *f1, *f2, *f3;
Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
ecore_init();
p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
@ -925,7 +872,6 @@ EFL_START_TEST(efl_test_promise_all_after_value_set)
efl_del(p2); efl_del(p2);
efl_del(p3); efl_del(p3);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -949,8 +895,6 @@ EFL_START_TEST(efl_test_promise_race)
Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; Future_Ok donea = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; Future_Ok donep1 = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
ecore_init();
p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p1 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p2 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p3 = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
@ -977,7 +921,6 @@ EFL_START_TEST(efl_test_promise_race)
efl_del(p2); efl_del(p2);
efl_del(p3); efl_del(p3);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -987,8 +930,6 @@ EFL_START_TEST(efl_test_future_link)
Efl_Future *f; Efl_Future *f;
Eo *o; Eo *o;
ecore_init();
o = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(), o = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
efl_loop_timer_interval_set(efl_added, 0.0)); efl_loop_timer_interval_set(efl_added, 0.0));
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
@ -1007,7 +948,6 @@ EFL_START_TEST(efl_test_future_link)
efl_del(o); efl_del(o);
efl_del(p); efl_del(p);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1024,8 +964,6 @@ EFL_START_TEST(efl_test_recursive_mess)
Efl_Promise *p; Efl_Promise *p;
Future_Ok done = { EINA_FALSE, EINA_FALSE, EINA_FALSE }; Future_Ok done = { EINA_FALSE, EINA_FALSE, EINA_FALSE };
ecore_init();
p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()); p = efl_add(EFL_PROMISE_CLASS, efl_main_loop_get());
efl_future_use(&recursive_future, efl_promise_future_get(p)); efl_future_use(&recursive_future, efl_promise_future_get(p));
efl_future_then(recursive_future, _then_cleanup, _cancel, NULL, &done); efl_future_then(recursive_future, _then_cleanup, _cancel, NULL, &done);
@ -1036,7 +974,6 @@ EFL_START_TEST(efl_test_recursive_mess)
efl_del(p); efl_del(p);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -1316,9 +1316,23 @@ EFL_END_TEST
#endif #endif
static void
promise_init(void)
{
/* enable ecore init count manipulation for these tests */
ecore_shutdown();
}
static void
promise_shutdown(void)
{
/* enable ecore init count manipulation for these tests */
ecore_init();
}
void ecore_test_ecore_promise2(TCase *tc) void ecore_test_ecore_promise2(TCase *tc)
{ {
tcase_add_checked_fixture(tc, promise_init, promise_shutdown);
tcase_add_test(tc, efl_test_timeout); tcase_add_test(tc, efl_test_timeout);
tcase_add_test(tc, efl_test_job); tcase_add_test(tc, efl_test_job);
tcase_add_test(tc, efl_test_idle); tcase_add_test(tc, efl_test_idle);

View File

@ -162,8 +162,6 @@ EFL_START_TEST(ecore_test_timers)
.precision = {0.01, 0.02, 0.03} .precision = {0.01, 0.02, 0.03}
}; };
fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
timer.timer1 = ecore_timer_add(TIMEOUT_1, _timer1_cb, &timer); timer.timer1 = ecore_timer_add(TIMEOUT_1, _timer1_cb, &timer);
timer.timer2 = ecore_timer_add(TIMEOUT_2, _timer2_cb, &timer); timer.timer2 = ecore_timer_add(TIMEOUT_2, _timer2_cb, &timer);
timer.add_timer2++; timer.add_timer2++;
@ -185,9 +183,6 @@ EFL_START_TEST(ecore_test_timers)
ecore_timer_del(timer.timer4); ecore_timer_del(timer.timer4);
if (timer.timer5) if (timer.timer5)
ecore_timer_del(timer.timer5); ecore_timer_del(timer.timer5);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -216,17 +211,12 @@ EFL_START_TEST(ecore_test_timer_inside_call)
{ {
Test_Inside_Call c; Test_Inside_Call c;
fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
c.start = ecore_time_get(); c.start = ecore_time_get();
c.t = ecore_timer_add(0.01, _timeri_cb, &c); c.t = ecore_timer_add(0.01, _timeri_cb, &c);
fail_if(!c.t, "Error add timer\n"); fail_if(!c.t, "Error add timer\n");
ecore_main_loop_begin(); ecore_main_loop_begin();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -262,7 +252,6 @@ EFL_START_TEST(ecore_test_timer_lifecycle)
Eo *et; Eo *et;
efl_object_init(); efl_object_init();
ecore_init();
t = ecore_timer_add(1.0, _test_time_cb, &rl); t = ecore_timer_add(1.0, _test_time_cb, &rl);
efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl); efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
@ -273,8 +262,6 @@ EFL_START_TEST(ecore_test_timer_lifecycle)
efl_loop_timer_interval_set(efl_added, 1.0)); efl_loop_timer_interval_set(efl_added, 1.0));
efl_ref(et); efl_ref(et);
ecore_shutdown();
fail_if(re == EINA_TRUE && rl == EINA_TRUE); fail_if(re == EINA_TRUE && rl == EINA_TRUE);
fail_if(dl == EINA_FALSE); fail_if(dl == EINA_FALSE);
fail_if(de == EINA_TRUE); fail_if(de == EINA_TRUE);
@ -289,10 +276,8 @@ EFL_END_TEST
EFL_START_TEST(ecore_test_timer_valid_callbackfunc) EFL_START_TEST(ecore_test_timer_valid_callbackfunc)
{ {
fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
Ecore_Timer *t = NULL; Ecore_Timer *t = NULL;
fail_if((t = ecore_timer_add(0.5, NULL, NULL)), "ERROR: Invalid callback func!\n"); fail_if((t = ecore_timer_add(0.5, NULL, NULL)), "ERROR: Invalid callback func!\n");
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -97,7 +97,7 @@ main(int argc, char **argv)
#endif #endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Efl_App", etc); "Efl_App", etc, NULL, NULL);
return (failed_count == 0) ? 0 : 255; return (failed_count == 0) ? 0 : 255;
} }

View File

@ -4,6 +4,7 @@
#include "ecore_con_suite.h" #include "ecore_con_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Ecore_Con.h>
static const Efl_Test_Case etc[] = { static const Efl_Test_Case etc[] = {
{ "Ecore_Con", ecore_con_test_ecore_con }, { "Ecore_Con", ecore_con_test_ecore_con },
@ -13,6 +14,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(ecore_con)
{
ck_assert_int_eq(ecore_con_init(), 1);
}
SUITE_SHUTDOWN(ecore_con)
{
ck_assert_int_eq(ecore_con_shutdown(), 0);
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
@ -26,7 +37,7 @@ main(int argc, char **argv)
#endif #endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Ecore_Con", etc); "Ecore_Con", etc, SUITE_INIT_FN(ecore_con), SUITE_SHUTDOWN_FN(ecore_con));
return (failed_count == 0) ? 0 : 255; return (failed_count == 0) ? 0 : 255;
} }

View File

@ -200,11 +200,6 @@ void _ecore_con_server_client_tests(Ecore_Con_Type compl_type, const char *name,
void *del_ret; void *del_ret;
const char *server_name; const char *server_name;
ret = eina_init();
fail_if(ret != 1);
ret = ecore_con_init();
fail_if(ret != 1);
handlers[0] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, handlers[0] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD,
_add, (void *) 1); _add, (void *) 1);
fail_if(handlers[0] == NULL); fail_if(handlers[0] == NULL);
@ -316,10 +311,6 @@ void _ecore_con_server_client_tests(Ecore_Con_Type compl_type, const char *name,
fail_if (del_ret != (void *) 2); fail_if (del_ret != (void *) 2);
del_ret = ecore_event_handler_del (handlers[5]); del_ret = ecore_event_handler_del (handlers[5]);
fail_if (del_ret != (void *) 2); fail_if (del_ret != (void *) 2);
ret = ecore_con_shutdown();
fail_if(ret != 0);
ret = eina_shutdown();
} }
EFL_START_TEST(ecore_test_ecore_con_local_user) EFL_START_TEST(ecore_test_ecore_con_local_user)
@ -470,30 +461,12 @@ EFL_START_TEST(ecore_test_ecore_con_ssl_available)
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(ecore_test_ecore_con_init)
{
int ret;
ret = ecore_con_init();
fail_if(ret != 1);
ret = ecore_con_shutdown();
fail_if(ret != 0);
}
EFL_END_TEST
EFL_START_TEST(ecore_test_ecore_con_dns) EFL_START_TEST(ecore_test_ecore_con_dns)
{ {
Ecore_Con_Server *client; Ecore_Con_Server *client;
Ecore_Event_Handler *e_err; Ecore_Event_Handler *e_err;
Ecore_Event_Handler *e_add; Ecore_Event_Handler *e_add;
Eina_Bool err_check = EINA_FALSE; Eina_Bool err_check = EINA_FALSE;
int ret;
ret = eina_init();
fail_if(ret != 1);
ret = ecore_con_init();
fail_if(ret != 1);
e_add = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, _dns_add_del, (void *) &err_check); e_add = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, _dns_add_del, (void *) &err_check);
e_err = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR, _dns_err, (void *) &err_check); 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)
fail_if (err_check == EINA_FALSE); fail_if (err_check == EINA_FALSE);
fail_if (ecore_event_handler_del(e_err) != (void *) &err_check); fail_if (ecore_event_handler_del(e_err) != (void *) &err_check);
fail_if (ecore_event_handler_del(e_add) != (void *) &err_check); fail_if (ecore_event_handler_del(e_add) != (void *) &err_check);
ret = ecore_con_shutdown();
fail_if(ret != 0);
ret = eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(ecore_test_ecore_con_shutdown_bef_init) EFL_START_TEST(ecore_test_ecore_con_shutdown_bef_init)
{ {
int ret; int ret = ecore_con_shutdown();
eina_init();
ret = ecore_con_shutdown();
fail_if(ret != 0); fail_if(ret != 0);
ret = ecore_con_init();
fail_if(ret != 1);
ret = ecore_con_shutdown(); ret = ecore_con_shutdown();
fail_if(ret != 0); fail_if(ret != 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -549,19 +511,15 @@ _lookup_done_cb(const char *canonname, const char *ip, struct sockaddr *addr, in
EFL_START_TEST(ecore_test_ecore_con_dns_lookup) EFL_START_TEST(ecore_test_ecore_con_dns_lookup)
{ {
const char link[] = "www.google.com"; const char link[] = "www.google.com";
ecore_con_init();
fail_unless(ecore_con_lookup(link, _lookup_done_cb, link)); fail_unless(ecore_con_lookup(link, _lookup_done_cb, link));
ecore_main_loop_begin(); ecore_main_loop_begin();
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
void ecore_con_test_ecore_con(TCase *tc) void ecore_con_test_ecore_con(TCase *tc)
{ {
tcase_add_test(tc, ecore_test_ecore_con_init);
tcase_add_test(tc, ecore_test_ecore_con_local_user); tcase_add_test(tc, ecore_test_ecore_con_local_user);
tcase_add_test(tc, ecore_test_ecore_con_local_user_home); tcase_add_test(tc, ecore_test_ecore_con_local_user_home);
tcase_add_test(tc, ecore_test_ecore_con_local_user_tmp); tcase_add_test(tc, ecore_test_ecore_con_local_user_tmp);

View File

@ -118,9 +118,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_cl)
int *cb_data = (int *) malloc(sizeof(int)); int *cb_data = (int *) malloc(sizeof(int));
*cb_data = 1; *cb_data = 1;
eina_init();
eet_init(); eet_init();
ecore_con_init();
_ece_test_descriptor_init(); _ece_test_descriptor_init();
svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 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)
free(cb_data); free(cb_data);
_ece_test_descriptor_shutdown(); _ece_test_descriptor_shutdown();
ecore_con_server_del(svr); ecore_con_server_del(svr);
ecore_con_shutdown();
eet_shutdown(); eet_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -200,9 +196,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_del)
int *cb_data = (int *) malloc(sizeof(int)); int *cb_data = (int *) malloc(sizeof(int));
*cb_data = 0; *cb_data = 0;
eina_init();
eet_init(); eet_init();
ecore_con_init();
_ece_test_descriptor_init(); _ece_test_descriptor_init();
svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 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)
free(cb_data); free(cb_data);
_ece_test_descriptor_shutdown(); _ece_test_descriptor_shutdown();
ecore_con_shutdown();
eet_shutdown(); eet_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -172,8 +172,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
char link[] = ECORE_CON_FTP_TEST_URL; char link[] = ECORE_CON_FTP_TEST_URL;
char url[4096], *username, *password, *file = NULL, *dir = NULL; char url[4096], *username, *password, *file = NULL, *dir = NULL;
ret = eina_init();
fail_if(ret != 1);
ret = ecore_con_url_init(); ret = ecore_con_url_init();
fail_if(ret != 1); fail_if(ret != 1);
@ -196,7 +194,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
ret = ecore_con_url_shutdown(); ret = ecore_con_url_shutdown();
fail_if(ret != 0); fail_if(ret != 0);
ret = eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif
@ -212,8 +209,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_post)
char *username = NULL, *password = NULL; char *username = NULL, *password = NULL;
char url[4096]; char url[4096];
ret = eina_init();
fail_if(ret != 1);
ret = ecore_con_url_init(); ret = ecore_con_url_init();
fail_if(ret != 1); fail_if(ret != 1);
@ -240,7 +235,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_post)
ret = ecore_con_url_shutdown(); ret = ecore_con_url_shutdown();
fail_if(ret != 0); fail_if(ret != 0);
ret = eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif
@ -257,8 +251,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_download)
#endif #endif
char url_data[] = "test"; char url_data[] = "test";
ret = eina_init();
fail_if(ret != 1);
ret = ecore_con_url_init(); ret = ecore_con_url_init();
fail_if(ret != 1); fail_if(ret != 1);
@ -290,7 +282,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_download)
ret = ecore_con_url_shutdown(); ret = ecore_con_url_shutdown();
fail_if(ret != 0); fail_if(ret != 0);
ret = eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -299,8 +290,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_create)
Ecore_Con_Url *url; Ecore_Con_Url *url;
int ret; int ret;
ret = eina_init();
fail_if(ret != 1);
ret = ecore_con_url_init(); ret = ecore_con_url_init();
fail_if(ret != 1); fail_if(ret != 1);
@ -311,7 +300,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_create)
ret = ecore_con_url_shutdown(); ret = ecore_con_url_shutdown();
fail_if(ret != 0); fail_if(ret != 0);
ret = eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -359,8 +347,6 @@ _ecore_con_url_cookies_test_init()
const char link[] = DEFAULT_LINK; const char link[] = DEFAULT_LINK;
#endif #endif
eina_init();
ecore_con_init();
ecore_con_url_init(); ecore_con_url_init();
ec_url = ecore_con_url_new(link); 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
eina_tmpstr_del(*path); eina_tmpstr_del(*path);
ecore_con_url_free(ec_url); ecore_con_url_free(ec_url);
ecore_con_url_shutdown(); ecore_con_url_shutdown();
ecore_con_shutdown();
eina_shutdown();
} }
EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_clear) EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_clear)

View File

@ -303,8 +303,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_ok)
Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
Eo *o; Eo *o;
ecore_con_init();
addr.sin_port = htons(12345); addr.sin_port = htons(12345);
addr.sin_addr.s_addr = htonl(0xabcdefafU); addr.sin_addr.s_addr = htonl(0xabcdefafU);
o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(), 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)
efl_net_ip_address_set(efl_added, slice)); efl_net_ip_address_set(efl_added, slice));
_ipv4_check(o, &addr); _ipv4_check(o, &addr);
efl_del(o); efl_del(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -345,8 +341,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
Eo *o; Eo *o;
ecore_con_init();
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true"); TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true");
o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get()); o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get());
ck_assert_ptr_eq(o, NULL); ck_assert_ptr_eq(o, NULL);
@ -418,8 +412,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
TRAP_ERRORS_FINISH(1); TRAP_ERRORS_FINISH(1);
efl_del(o); efl_del(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -431,8 +423,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
Eo *o; Eo *o;
ecore_con_init();
addr.sin_port = htons(12345); addr.sin_port = htons(12345);
addr.sin_addr.s_addr = htonl(0xabcdefafU); addr.sin_addr.s_addr = htonl(0xabcdefafU);
o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 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)
_ipv4_check(o, &addr); _ipv4_check(o, &addr);
efl_unref(o); efl_unref(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -467,8 +456,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
Eina_Slice wrong_slice = { .mem = &c, .len = 1 }; Eina_Slice wrong_slice = { .mem = &c, .len = 1 };
Eo *o; Eo *o;
ecore_con_init();
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true"); TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true");
o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
1234, 1234,
@ -476,7 +463,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
ck_assert_ptr_eq(o, NULL); ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(1); TRAP_ERRORS_FINISH(1);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -487,8 +473,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok)
}; };
Eo *o; Eo *o;
ecore_con_init();
addr.sin_port = htons(12345); addr.sin_port = htons(12345);
addr.sin_addr.s_addr = htonl(0xabcdefafU); addr.sin_addr.s_addr = htonl(0xabcdefafU);
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 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)
_ipv4_check(o, &addr); _ipv4_check(o, &addr);
efl_unref(o); efl_unref(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -514,8 +497,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
}; };
Eo *o; Eo *o;
ecore_con_init();
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL"); TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL");
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL); o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL);
ck_assert_ptr_eq(o, NULL); ck_assert_ptr_eq(o, NULL);
@ -526,7 +507,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
ck_assert_ptr_eq(o, NULL); ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(1); TRAP_ERRORS_FINISH(1);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -534,8 +514,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok)
{ {
Eo *o; Eo *o;
ecore_con_init();
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345"); o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345");
ck_assert_ptr_ne(o, NULL); ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1:12345"); 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)
ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80"); ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80");
efl_unref(o); efl_unref(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -564,8 +541,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
{ {
Eo *o; Eo *o;
ecore_con_init();
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL"); TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL");
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL); o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL);
ck_assert_ptr_eq(o, NULL); ck_assert_ptr_eq(o, NULL);
@ -594,7 +569,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
ck_assert_ptr_eq(o, NULL); ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(0); /* no error messages! */ TRAP_ERRORS_FINISH(0); /* no error messages! */
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -602,8 +576,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
{ {
struct resolve_ctx ctx = { }; struct resolve_ctx ctx = { };
ecore_con_init();
_resolve(&ctx, "localhost:http", 0, 0); _resolve(&ctx, "localhost:http", 0, 0);
_assert_found(&ctx, "127.0.0.1:80", EINA_TRUE, 0); _assert_found(&ctx, "127.0.0.1:80", EINA_TRUE, 0);
_resolve_cleanup(&ctx); _resolve_cleanup(&ctx);
@ -632,7 +604,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
_assert_found(&ctx, "[::1]:80", EINA_FALSE, 0); _assert_found(&ctx, "[::1]:80", EINA_FALSE, 0);
_resolve_cleanup(&ctx); _resolve_cleanup(&ctx);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -640,8 +611,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
{ {
struct resolve_ctx ctx = { }; struct resolve_ctx ctx = { };
ecore_con_init();
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL"); TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL");
ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS,
NULL, 0, 0); NULL, 0, 0);
@ -662,7 +631,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
_assert_found(&ctx, "[::1]:http", EINA_FALSE, EFL_NET_ERROR_COULDNT_RESOLVE_HOST); _assert_found(&ctx, "[::1]:http", EINA_FALSE, EFL_NET_ERROR_COULDNT_RESOLVE_HOST);
_resolve_cleanup(&ctx); _resolve_cleanup(&ctx);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -691,8 +659,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
#undef TEST #undef TEST
}; };
ecore_con_init();
for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++) for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++)
{ {
struct sockaddr_in a = { struct sockaddr_in a = {
@ -719,7 +685,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
efl_unref(o); efl_unref(o);
} }
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -769,8 +734,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_ok)
Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
Eo *o; Eo *o;
ecore_con_init();
addr.sin6_port = htons(12345); addr.sin6_port = htons(12345);
_ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(), 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)
_ipv6_check(o, &addr); _ipv6_check(o, &addr);
efl_del(o); efl_del(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -803,8 +765,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
Eo *o; Eo *o;
ecore_con_init();
/* generic errors checked at ecore_test_efl_net_ip_address_ipv4_manual_fail */ /* generic errors checked at ecore_test_efl_net_ip_address_ipv4_manual_fail */
TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: rw_slice.len != address.len is true"); 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)
efl_del(o); efl_del(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -861,8 +820,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
Eo *o; Eo *o;
ecore_con_init();
addr.sin6_port = htons(12365); addr.sin6_port = htons(12365);
_ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 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)
_ipv6_check(o, &addr); _ipv6_check(o, &addr);
efl_unref(o); efl_unref(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -898,8 +854,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok)
}; };
Eo *o; Eo *o;
ecore_con_init();
addr.sin6_port = htons(12345); addr.sin6_port = htons(12345);
_ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 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)
_ipv6_check(o, &addr); _ipv6_check(o, &addr);
efl_unref(o); efl_unref(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -922,8 +875,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok)
{ {
Eo *o; Eo *o;
ecore_con_init();
o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345"); o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345");
ck_assert_ptr_ne(o, NULL); ck_assert_ptr_ne(o, NULL);
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345"); 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)
ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]"); ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]");
efl_unref(o); efl_unref(o);
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1016,8 +966,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
{ {
Eo *o; Eo *o;
ecore_con_init();
/* generic error (null ptr) checked in ipv4_parse_fail */ /* generic error (null ptr) checked in ipv4_parse_fail */
/* incomplete numbers */ /* incomplete numbers */
@ -1037,7 +985,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
ck_assert_ptr_eq(o, NULL); ck_assert_ptr_eq(o, NULL);
TRAP_ERRORS_FINISH(0); /* no error messages! */ TRAP_ERRORS_FINISH(0); /* no error messages! */
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1136,8 +1083,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
char buf[4096]; char buf[4096];
const char *localhost_str; const char *localhost_str;
ecore_con_init();
localhost_str = _ipv6_localhost_check(); localhost_str = _ipv6_localhost_check();
if (localhost_str) if (localhost_str)
@ -1183,7 +1128,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
_resolve_cleanup(&ctx); _resolve_cleanup(&ctx);
} }
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1191,8 +1135,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
{ {
struct resolve_ctx ctx = { }; struct resolve_ctx ctx = { };
ecore_con_init();
/* generic checks at ipv4_resolve_fail */ /* generic checks at ipv4_resolve_fail */
#if defined(AI_V4MAPPED) && (AI_V4MAPPED > 0) #if defined(AI_V4MAPPED) && (AI_V4MAPPED > 0)
@ -1201,7 +1143,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
_resolve_cleanup(&ctx); _resolve_cleanup(&ctx);
#endif #endif
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1221,8 +1162,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
#undef TEST #undef TEST
}; };
ecore_con_init();
for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++) for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++)
{ {
struct sockaddr_in6 a = { struct sockaddr_in6 a = {
@ -1256,7 +1195,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
efl_unref(o); efl_unref(o);
} }
ecore_con_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -22,12 +22,23 @@
#include "ector_suite.h" #include "ector_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Ector.h>
static const Efl_Test_Case etc[] = { static const Efl_Test_Case etc[] = {
{ "init", ector_test_init }, { "init", ector_test_init },
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(ector)
{
ck_assert_int_eq(ector_init(), 1);
}
SUITE_SHUTDOWN(ector)
{
ck_assert_int_eq(ector_shutdown(), 0);
}
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
@ -41,7 +52,7 @@ main(int argc, char *argv[])
#endif #endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Ector", etc); "Ector", etc, SUITE_INIT_FN(ector), SUITE_SHUTDOWN_FN(ector));
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE; return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
} }

View File

@ -26,8 +26,6 @@
EFL_START_TEST(ector_init_simple) EFL_START_TEST(ector_init_simple)
{ {
fail_if(ector_init() != 1);
fail_if(ector_shutdown() != 0);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -4,12 +4,23 @@
#include "edje_suite.h" #include "edje_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Edje.h>
static const Efl_Test_Case etc[] = { static const Efl_Test_Case etc[] = {
{ "Edje", edje_test_edje }, { "Edje", edje_test_edje },
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(edje)
{
ck_assert_int_eq(edje_init(), 1);
}
SUITE_SHUTDOWN(edje)
{
ck_assert_int_eq(edje_shutdown(), 0);
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
@ -23,7 +34,7 @@ main(int argc, char **argv)
#endif #endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Edje", etc); "Edje", etc, SUITE_INIT_FN(edje), SUITE_SHUTDOWN_FN(edje));
return (failed_count == 0) ? 0 : 255; return (failed_count == 0) ? 0 : 255;
} }

View File

@ -18,13 +18,6 @@
EFL_START_TEST(edje_test_edje_init) EFL_START_TEST(edje_test_edje_init)
{ {
int ret;
ret = edje_init();
fail_if(ret != 1);
ret = edje_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -6,6 +6,7 @@
#include "eet_suite.h" #include "eet_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Eet.h>
char argv0[PATH_MAX]; char argv0[PATH_MAX];
@ -25,6 +26,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(eet)
{
ck_assert_int_eq(eet_init(), 1);
}
SUITE_SHUTDOWN(eet)
{
ck_assert_int_eq(eet_shutdown(), 0);
}
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
@ -40,7 +51,7 @@ main(int argc, char *argv[])
memcpy(argv0, argv[0], strlen(argv[0]) + 1); memcpy(argv0, argv[0], strlen(argv[0]) + 1);
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Eet", etc); "Eet", etc, SUITE_INIT_FN(eet), SUITE_SHUTDOWN_FN(eet));
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE; return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
} }

View File

@ -57,7 +57,6 @@ EFL_START_TEST(eet_test_cache_concurrency)
file = strdup("/tmp/eet_suite_testXXXXXX"); file = strdup("/tmp/eet_suite_testXXXXXX");
eet_init();
eina_threads_init(); eina_threads_init();
eina_lock_new(&open_worker_mutex); eina_lock_new(&open_worker_mutex);
@ -95,7 +94,6 @@ EFL_START_TEST(eet_test_cache_concurrency)
fail_if(unlink(file) != 0); fail_if(unlink(file) != 0);
eina_threads_shutdown(); eina_threads_shutdown();
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -23,8 +23,6 @@ EFL_START_TEST(eet_test_cipher_decipher_simple)
int size; int size;
int tmpfd; int tmpfd;
eet_init();
fail_if(-1 == (tmpfd = mkstemp(file))); fail_if(-1 == (tmpfd = mkstemp(file)));
fail_if(!!close(tmpfd)); fail_if(!!close(tmpfd));
@ -61,8 +59,6 @@ EFL_START_TEST(eet_test_cipher_decipher_simple)
eet_close(ef); eet_close(ef);
fail_if(unlink(file) != 0); fail_if(unlink(file) != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -95,8 +95,6 @@ EFL_START_TEST(eet_test_connection_check)
Eet_Test_Ex_Type etbt; Eet_Test_Ex_Type etbt;
Eina_Bool on_going; Eina_Bool on_going;
eet_init();
eet_test_ex_set(&etbt, 0); eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@ -139,8 +137,6 @@ EFL_START_TEST(eet_test_connection_check)
fail_if(!eet_connection_close(ecd.conn, &on_going)); fail_if(!eet_connection_close(ecd.conn, &on_going));
fail_if(on_going); fail_if(on_going);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -288,8 +288,6 @@ EFL_START_TEST(eet_test_data_basic_type_encoding_decoding)
void *transfert; void *transfert;
int size; int size;
eet_init();
eet_test_basic_set(&etbt, 0); eet_test_basic_set(&etbt, 0);
eet_test_setup_eddc(&eddc); eet_test_setup_eddc(&eddc);
@ -313,8 +311,6 @@ EFL_START_TEST(eet_test_data_basic_type_encoding_decoding)
free(result); free(result);
eet_data_descriptor_free(edd); eet_data_descriptor_free(edd);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -328,8 +324,6 @@ EFL_START_TEST(eet_test_data_type_encoding_decoding)
int size; int size;
int test; int test;
eet_init();
eet_test_ex_set(&etbt, 0); eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.hash = eina_hash_string_superfast_new(NULL); etbt.hash = eina_hash_string_superfast_new(NULL);
@ -379,8 +373,6 @@ EFL_START_TEST(eet_test_data_type_encoding_decoding)
eina_hash_foreach(result->ihash, func7, &test); eina_hash_foreach(result->ihash, func7, &test);
fail_if(test != 0); fail_if(test != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -398,8 +390,6 @@ EFL_START_TEST(eet_test_data_type_dump_undump)
int size2; int size2;
int test; int test;
eet_init();
eet_test_ex_set(&etbt, 0); eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 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)
fail_if(test != 0); fail_if(test != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -488,8 +477,6 @@ EFL_START_TEST(eet_test_data_type_escape_dump_undump)
" value \"\\\\My\\\\NewLine\\\\\" string: \"\\n\";\n" " value \"\\\\My\\\\NewLine\\\\\" string: \"\\n\";\n"
"}\n"; "}\n";
eet_init();
blob = eet_data_text_undump(inputstr, strlen(inputstr), &blob_len); blob = eet_data_text_undump(inputstr, strlen(inputstr), &blob_len);
fail_if(!blob); fail_if(!blob);
@ -504,7 +491,6 @@ EFL_START_TEST(eet_test_data_type_escape_dump_undump)
eina_strbuf_free(strbuf); eina_strbuf_free(strbuf);
free(blob); free(blob);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -519,8 +505,6 @@ EFL_START_TEST(eet_test_data_fp)
void *blob; void *blob;
int size; int size;
eet_init();
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP); EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP);
edd_5FP = eet_data_descriptor_stream_new(&eddc); edd_5FP = eet_data_descriptor_stream_new(&eddc);
@ -566,7 +550,6 @@ EFL_START_TEST(eet_test_data_fp)
fail_if(convert->f1 != 1); fail_if(convert->f1 != 1);
fail_if(convert->f0 != 0); fail_if(convert->f0 != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -582,9 +565,6 @@ EFL_START_TEST(eet_test_data_union)
int size; int size;
int i; int i;
eina_init();
eet_init();
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Union_Test); EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Union_Test);
edd = eet_data_descriptor_stream_new(&eddc); edd = eet_data_descriptor_stream_new(&eddc);
@ -642,9 +622,6 @@ EFL_START_TEST(eet_test_data_union)
EUT_CMP(2); EUT_CMP(2);
EUT_CMP(3); EUT_CMP(3);
} }
eet_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -663,9 +640,6 @@ EFL_START_TEST(eet_test_data_variant)
int size; int size;
int i; int i;
eina_init();
eet_init();
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Variant_Test); EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Variant_Test);
edd = eet_data_descriptor_stream_new(&eddc); edd = eet_data_descriptor_stream_new(&eddc);
@ -753,8 +727,6 @@ EFL_START_TEST(eet_test_data_variant)
EVT_CMP(3); EVT_CMP(3);
} }
eet_shutdown();
eina_shutdown();
} /* EFL_START_TEST */ } /* EFL_START_TEST */
EFL_END_TEST EFL_END_TEST
@ -770,9 +742,6 @@ EFL_START_TEST(eet_test_data_hash_value)
double d; double d;
char *s; char *s;
eina_init();
eet_init();
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Hash); EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_Hash);
edd = eet_data_descriptor_stream_new(&eddc); edd = eet_data_descriptor_stream_new(&eddc);
@ -810,9 +779,6 @@ EFL_START_TEST(eet_test_data_hash_value)
val = (Eina_Value *)eina_hash_find(h->hash, "val/string"); val = (Eina_Value *)eina_hash_find(h->hash, "val/string");
eina_value_get(val, &s); eina_value_get(val, &s);
fail_if((!val) || strcmp(s, EET_TEST_STRING)); fail_if((!val) || strcmp(s, EET_TEST_STRING));
eet_shutdown();
eina_shutdown();
} /* EFL_START_TEST */ } /* EFL_START_TEST */
EFL_END_TEST EFL_END_TEST

View File

@ -26,8 +26,6 @@ EFL_START_TEST(eet_test_file_simple_write)
file = strdup("/tmp/eet_suite_testXXXXXX"); file = strdup("/tmp/eet_suite_testXXXXXX");
eet_init();
fail_if(-1 == (tmpfd = mkstemp(file))); fail_if(-1 == (tmpfd = mkstemp(file)));
fail_if(!!close(tmpfd)); fail_if(!!close(tmpfd));
@ -120,7 +118,6 @@ EFL_START_TEST(eet_test_file_simple_write)
fail_if(unlink(file) != 0); fail_if(unlink(file) != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -140,8 +137,6 @@ EFL_START_TEST(eet_test_file_data)
file = strdup("/tmp/eet_suite_testXXXXXX"); file = strdup("/tmp/eet_suite_testXXXXXX");
eet_init();
eet_test_ex_set(&etbt, 0); eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
@ -280,7 +275,6 @@ EFL_START_TEST(eet_test_file_data)
fail_if(unlink(file) != 0); fail_if(unlink(file) != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -298,8 +292,6 @@ EFL_START_TEST(eet_test_file_data_dump)
file = strdup("/tmp/eet_suite_testXXXXXX"); file = strdup("/tmp/eet_suite_testXXXXXX");
eet_init();
eet_test_ex_set(&etbt, 0); eet_test_ex_set(&etbt, 0);
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1));
etbt.list = eina_list_prepend(etbt.list, eet_test_ex_set(NULL, 1)); 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)
fail_if(unlink(file) != 0); fail_if(unlink(file) != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -400,8 +391,6 @@ EFL_START_TEST(eet_test_file_fp)
file = strdup("/tmp/eet_suite_testXXXXXX"); file = strdup("/tmp/eet_suite_testXXXXXX");
eet_init();
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP); EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Eet_5FP);
edd_5FP = eet_data_descriptor_file_new(&eddc); edd_5FP = eet_data_descriptor_file_new(&eddc);
@ -456,7 +445,6 @@ EFL_START_TEST(eet_test_file_fp)
fail_if(unlink(file) != 0); fail_if(unlink(file) != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -66,8 +66,6 @@ EFL_START_TEST(eet_test_identity_simple)
file = strdup("/tmp/eet_suite_testXXXXXX"); file = strdup("/tmp/eet_suite_testXXXXXX");
eet_init();
fail_if(-1 == (fd = mkstemp(file))); fail_if(-1 == (fd = mkstemp(file)));
fail_if(!!close(fd)); fail_if(!!close(fd));
fail_if(!(noread = fopen("/dev/null", "wb"))); fail_if(!(noread = fopen("/dev/null", "wb")));
@ -129,7 +127,6 @@ EFL_START_TEST(eet_test_identity_simple)
fail_if(unlink(file) != 0); fail_if(unlink(file) != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -137,15 +134,12 @@ EFL_START_TEST(eet_test_identity_open_simple)
{ {
Eet_Key *k = NULL; Eet_Key *k = NULL;
eet_init();
k = eet_identity_open(_cert_pem, _key_pem, NULL); k = eet_identity_open(_cert_pem, _key_pem, NULL);
fail_if(!k); fail_if(!k);
if (k) if (k)
eet_identity_close(k); eet_identity_close(k);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -153,15 +147,12 @@ EFL_START_TEST(eet_test_identity_open_pkcs8)
{ {
Eet_Key *k = NULL; Eet_Key *k = NULL;
eet_init();
k = eet_identity_open(_cert_pem, _key_enc_none_pem, NULL); k = eet_identity_open(_cert_pem, _key_enc_none_pem, NULL);
fail_if(!k); fail_if(!k);
if (k) if (k)
eet_identity_close(k); eet_identity_close(k);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -169,8 +160,6 @@ EFL_START_TEST(eet_test_identity_open_pkcs8_enc)
{ {
Eet_Key *k = NULL; Eet_Key *k = NULL;
eet_init();
k = eet_identity_open(_cert_pem, _key_enc_pem, NULL); k = eet_identity_open(_cert_pem, _key_enc_pem, NULL);
fail_if(k); fail_if(k);
@ -189,7 +178,6 @@ EFL_START_TEST(eet_test_identity_open_pkcs8_enc)
if (k) if (k)
eet_identity_close(k); eet_identity_close(k);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -85,8 +85,6 @@ EFL_START_TEST(eet_test_image_normal)
file = strdup("/tmp/eet_suite_testXXXXXX"); file = strdup("/tmp/eet_suite_testXXXXXX");
eet_init();
fail_if(-1 == (tmpfd = mkstemp(file))); fail_if(-1 == (tmpfd = mkstemp(file)));
fail_if(!!close(tmpfd)); fail_if(!!close(tmpfd));
@ -428,7 +426,6 @@ EFL_START_TEST(eet_test_image_normal)
fail_if(unlink(file) != 0); fail_if(unlink(file) != 0);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -454,8 +451,6 @@ EFL_START_TEST(eet_test_image_small)
image[2] = IM2; image[2] = IM2;
image[3] = IM3; image[3] = IM3;
eet_init();
fail_if(-1 == (tmpfd = mkstemp(file))); fail_if(-1 == (tmpfd = mkstemp(file)));
fail_if(!!close(tmpfd)); fail_if(!!close(tmpfd));
@ -491,7 +486,6 @@ EFL_START_TEST(eet_test_image_small)
free(data); free(data);
eet_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -8,13 +8,6 @@
EFL_START_TEST(_eet_test_init) EFL_START_TEST(_eet_test_init)
{ {
int ret;
ret = eet_init();
fail_if(ret != 1);
ret = eet_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -4,6 +4,7 @@
#include "eeze_suite.h" #include "eeze_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Eeze.h>
static const Efl_Test_Case etc[] = { static const Efl_Test_Case etc[] = {
{ "Init", eeze_test_init }, { "Init", eeze_test_init },
@ -13,6 +14,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(eeze)
{
ck_assert_int_eq(eeze_init(), 1);
}
SUITE_SHUTDOWN(eeze)
{
ck_assert_int_eq(eeze_shutdown(), 0);
}
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
@ -26,7 +37,7 @@ main(int argc, char *argv[])
#endif #endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Eeze", etc); "Eeze", etc, SUITE_INIT_FN(eeze), SUITE_SHUTDOWN_FN(eeze));
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE; return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
} }

View File

@ -8,13 +8,6 @@
EFL_START_TEST(eeze_test_eeze_init) EFL_START_TEST(eeze_test_eeze_init)
{ {
int ret;
ret = eeze_init();
fail_if(ret != 1);
ret = eeze_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -9,30 +9,19 @@
EFL_START_TEST(eeze_test_net_list) EFL_START_TEST(eeze_test_net_list)
{ {
int ret;
Eina_List *list = NULL; Eina_List *list = NULL;
ret = eeze_init();
fail_if(ret != 1);
list = eeze_net_list(); list = eeze_net_list();
fail_if(list == NULL); fail_if(list == NULL);
ret = eeze_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eeze_test_net_attr) EFL_START_TEST(eeze_test_net_attr)
{ {
int ret;
int idx = 0; int idx = 0;
Eeze_Net *net = NULL; Eeze_Net *net = NULL;
const char *tmp = NULL; const char *tmp = NULL;
ret = eeze_init();
fail_if(ret != 1);
net = eeze_net_new("lo"); net = eeze_net_new("lo");
fail_if(net == NULL); fail_if(net == NULL);
@ -65,9 +54,6 @@ EFL_START_TEST(eeze_test_net_attr)
fail_if(tmp == NULL); fail_if(tmp == NULL);
eeze_net_free(net); eeze_net_free(net);
ret = eeze_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST
@ -75,13 +61,9 @@ EFL_END_TEST
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
EFL_START_TEST(eeze_test_net_attr_ipv6) EFL_START_TEST(eeze_test_net_attr_ipv6)
{ {
int ret;
Eeze_Net *net = NULL; Eeze_Net *net = NULL;
const char *tmp = NULL; const char *tmp = NULL;
ret = eeze_init();
fail_if(ret != 1);
net = eeze_net_new("lo"); net = eeze_net_new("lo");
fail_if(net == NULL); fail_if(net == NULL);
@ -104,9 +86,6 @@ EFL_START_TEST(eeze_test_net_attr_ipv6)
cleanup: cleanup:
eeze_net_free(net); eeze_net_free(net);
ret = eeze_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST
#endif #endif

View File

@ -36,16 +36,11 @@ event_cb(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *event)
EFL_START_TEST(eeze_test_sensor_read) EFL_START_TEST(eeze_test_sensor_read)
{ {
Eeze_Sensor_Obj *sens = NULL; Eeze_Sensor_Obj *sens = NULL;
int ret = 0;
float x, y, z; float x, y, z;
int acc; int acc;
double timestamp; double timestamp;
Eina_Bool rc = EINA_FALSE; Eina_Bool rc = EINA_FALSE;
ecore_init();
ret = eeze_init();
fail_if(ret != 1);
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER); sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER);
fail_if(sens == NULL); fail_if(sens == NULL);
rc = eeze_sensor_read(sens); rc = eeze_sensor_read(sens);
@ -162,9 +157,6 @@ EFL_START_TEST(eeze_test_sensor_read)
/* Try free on NULL */ /* Try free on NULL */
eeze_sensor_free(NULL); eeze_sensor_free(NULL);
ret = eeze_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST
@ -173,13 +165,8 @@ EFL_START_TEST(eeze_test_sensor_async_read)
Ecore_Event_Handler *handler; Ecore_Event_Handler *handler;
Eeze_Sensor_Obj *sens = NULL; Eeze_Sensor_Obj *sens = NULL;
int ret = 0;
Eina_Bool rc = EINA_FALSE; Eina_Bool rc = EINA_FALSE;
ecore_init();
ret = eeze_init();
fail_if(ret != 1);
handler = ecore_event_handler_add(EEZE_SENSOR_EVENT_ACCELEROMETER, event_cb, NULL); handler = ecore_event_handler_add(EEZE_SENSOR_EVENT_ACCELEROMETER, event_cb, NULL);
fail_if(handler == NULL); fail_if(handler == NULL);
sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER); sens = eeze_sensor_new(EEZE_SENSOR_TYPE_ACCELEROMETER);
@ -238,20 +225,12 @@ EFL_START_TEST(eeze_test_sensor_async_read)
fail_if(rc != EINA_FALSE); fail_if(rc != EINA_FALSE);
ecore_main_loop_begin(); ecore_main_loop_begin();
ret = eeze_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eeze_test_sensor_obj_get) EFL_START_TEST(eeze_test_sensor_obj_get)
{ {
Eeze_Sensor_Obj *obj = NULL, *obj_tmp = NULL; Eeze_Sensor_Obj *obj = NULL, *obj_tmp = NULL;
int ret = 0;
ecore_init();
ret = eeze_init();
fail_if(ret != 1);
obj = calloc(1, sizeof(Eeze_Sensor_Obj)); obj = calloc(1, sizeof(Eeze_Sensor_Obj));
fail_if(obj == NULL); fail_if(obj == NULL);
@ -266,9 +245,6 @@ EFL_START_TEST(eeze_test_sensor_obj_get)
/* Try to get non existing obj */ /* Try to get non existing obj */
obj_tmp = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_LAST + 1); obj_tmp = eeze_sensor_obj_get(EEZE_SENSOR_TYPE_LAST + 1);
fail_if(obj_tmp != NULL); fail_if(obj_tmp != NULL);
ret = eeze_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -20,8 +20,6 @@ EFL_START_TEST(eeze_test_udev_types)
{ {
Eina_List *type; Eina_List *type;
eeze_init();
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_NONE, NULL); type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_NONE, NULL);
type = eeze_udev_find_unlisted_similar(type); type = eeze_udev_find_unlisted_similar(type);
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL); type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL);
@ -54,7 +52,6 @@ EFL_START_TEST(eeze_test_udev_types)
type = eeze_udev_find_by_type(0, NULL); type = eeze_udev_find_by_type(0, NULL);
type = eeze_udev_find_unlisted_similar(type); type = eeze_udev_find_unlisted_similar(type);
eeze_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif
@ -63,9 +60,6 @@ EFL_START_TEST(eeze_test_udev_watch)
{ {
Eeze_Udev_Watch *watch; Eeze_Udev_Watch *watch;
ecore_init();
eeze_init();
/* watch never gets triggered as this is run without user interaction */ /* watch never gets triggered as this is run without user interaction */
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL); watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_DRIVE_INTERNAL, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL); 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)
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_GPIO, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL); watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_GPIO, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_NONE, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL); watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_NONE, (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE), catch_events, NULL);
eeze_udev_watch_del(watch); eeze_udev_watch_del(watch);
eeze_shutdown();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -89,8 +80,6 @@ EFL_START_TEST(eeze_test_udev_syspath)
const char *name; const char *name;
Eina_Bool r; Eina_Bool r;
eeze_init();
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL); type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_KEYBOARD, NULL);
type = eeze_udev_find_unlisted_similar(type); type = eeze_udev_find_unlisted_similar(type);
EINA_LIST_FOREACH(type, l, name) EINA_LIST_FOREACH(type, l, name)
@ -147,8 +136,6 @@ EFL_START_TEST(eeze_test_udev_syspath)
} }
eeze_udev_devpath_get_syspath("/dev/null"); eeze_udev_devpath_get_syspath("/dev/null");
eeze_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -157,8 +144,6 @@ EFL_START_TEST(eeze_test_udev_attr)
Eina_List *type; Eina_List *type;
const char *name, *check, *check2; const char *name, *check, *check2;
eeze_init();
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL); type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL);
type = eeze_udev_find_unlisted_similar(type); type = eeze_udev_find_unlisted_similar(type);
eeze_udev_find_by_filter("backlight", NULL, NULL); eeze_udev_find_by_filter("backlight", NULL, NULL);
@ -203,8 +188,6 @@ EFL_START_TEST(eeze_test_udev_attr)
} }
eina_stringshare_del(name); eina_stringshare_del(name);
} }
eeze_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -215,8 +198,6 @@ EFL_START_TEST(eeze_test_udev_device)
_udev_device *device, *device2; _udev_device *device, *device2;
const char *name; const char *name;
eeze_init();
type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL); type = eeze_udev_find_by_type(EEZE_UDEV_TYPE_DRIVE_INTERNAL, NULL);
fail_if(type == NULL); fail_if(type == NULL);
type = eeze_udev_find_unlisted_similar(type); type = eeze_udev_find_unlisted_similar(type);
@ -236,8 +217,6 @@ EFL_START_TEST(eeze_test_udev_device)
device2 = _copy_device(device); device2 = _copy_device(device);
fail_if(device2 != NULL); fail_if(device2 != NULL);
eeze_shutdown();
} }
EFL_END_TEST EFL_END_TEST
*/ */

View File

@ -20,7 +20,7 @@
# include "config.h" # include "config.h"
#endif #endif
#include <Eina.h> #include <Ecore.h>
#include "efl_suite.h" #include "efl_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
@ -31,6 +31,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(efl)
{
ck_assert_int_eq(ecore_init(), 1);
}
SUITE_SHUTDOWN(efl)
{
ck_assert_int_eq(ecore_shutdown(), 0);
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
@ -44,7 +54,7 @@ main(int argc, char **argv)
eina_init(); eina_init();
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Efl", etc); "Efl", etc, SUITE_INIT_FN(efl), SUITE_SHUTDOWN_FN(efl));
eina_shutdown(); eina_shutdown();

View File

@ -178,9 +178,6 @@ EFL_START_TEST(efl_test_model_composite_boolean)
Test_Data *tdata; Test_Data *tdata;
Efl_Future *future; Efl_Future *future;
fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
eina_value_setup(&v, EINA_VALUE_TYPE_INT); eina_value_setup(&v, EINA_VALUE_TYPE_INT);
base_model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get()); base_model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
@ -207,8 +204,6 @@ EFL_START_TEST(efl_test_model_composite_boolean)
while (!tdata->success_flag) ecore_main_loop_iterate(); while (!tdata->success_flag) ecore_main_loop_iterate();
ck_assert(tdata->success_flag); ck_assert(tdata->success_flag);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -221,9 +216,6 @@ EFL_START_TEST(efl_test_model_composite_selection)
Test_Data *tdata; Test_Data *tdata;
Efl_Future *future; Efl_Future *future;
fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
eina_value_setup(&v, EINA_VALUE_TYPE_INT); eina_value_setup(&v, EINA_VALUE_TYPE_INT);
base_model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get()); base_model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
@ -249,8 +241,6 @@ EFL_START_TEST(efl_test_model_composite_selection)
while (!tdata->success_flag) ecore_main_loop_iterate(); while (!tdata->success_flag) ecore_main_loop_iterate();
ck_assert(tdata->success_flag); ck_assert(tdata->success_flag);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -118,9 +118,6 @@ EFL_START_TEST(efl_test_model_container_values)
const char **cmp_str; const char **cmp_str;
int i; int i;
fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
fail_if(!efl_object_init(), "ERROR: Cannot init EO!\n");
cmp_int = calloc(8, sizeof(int*)); cmp_int = calloc(8, sizeof(int*));
cmp_str = calloc(8, sizeof(const char*)); cmp_str = calloc(8, sizeof(const char*));
for (i = 0; i < 7; ++i) for (i = 0; i < 7; ++i)
@ -158,8 +155,6 @@ EFL_START_TEST(efl_test_model_container_values)
ck_assert(!!test_data.pass_flag); ck_assert(!!test_data.pass_flag);
ck_assert(!test_data.fail_flag); ck_assert(!test_data.fail_flag);
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -192,7 +192,7 @@ _timing_end(void)
#endif #endif
EINA_UNUSED static int EINA_UNUSED static int
_efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, const Efl_Test_Case *etc) _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, const Efl_Test_Case *etc, SFun init, SFun shutdown)
{ {
Suite *s; Suite *s;
SRunner *sr; SRunner *sr;
@ -214,6 +214,8 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
continue; continue;
tc = tcase_create(etc[i].test_case); tc = tcase_create(etc[i].test_case);
if (init || shutdown)
tcase_add_checked_fixture(tc, init, shutdown);
if (_efl_test_fork_has(sr)) if (_efl_test_fork_has(sr))
tcase_set_timeout(tc, 0); tcase_set_timeout(tc, 0);
@ -233,4 +235,9 @@ _efl_suite_build_and_run(int argc, const char **argv, const char *suite_name, co
return failed_count; return failed_count;
} }
#define SUITE_INIT(NAME) static void _##NAME##_suite_init(void)
#define SUITE_INIT_FN(NAME) _##NAME##_suite_init
#define SUITE_SHUTDOWN(NAME) static void _##NAME##_suite_shutdown(void)
#define SUITE_SHUTDOWN_FN(NAME) _##NAME##_suite_shutdown
#endif #endif

View File

@ -4,6 +4,7 @@
#include "efreet_suite.h" #include "efreet_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Efreet.h>
static const Efl_Test_Case etc[] = { static const Efl_Test_Case etc[] = {
{ "Efreet", efreet_test_efreet }, { "Efreet", efreet_test_efreet },
@ -11,6 +12,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(efreet)
{
ck_assert_int_eq(efreet_init(), 1);
}
SUITE_SHUTDOWN(efreet)
{
ck_assert_int_eq(efreet_shutdown(), 0);
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
@ -24,7 +35,7 @@ main(int argc, char **argv)
#endif #endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Efreet", etc); "Efreet", etc, SUITE_INIT_FN(efreet), SUITE_SHUTDOWN_FN(efreet));
return (failed_count == 0) ? 0 : 255; return (failed_count == 0) ? 0 : 255;
} }

View File

@ -9,13 +9,6 @@
EFL_START_TEST(efreet_test_efreet_init) EFL_START_TEST(efreet_test_efreet_init)
{ {
int ret;
ret = efreet_init();
fail_if(ret != 1);
ret = efreet_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -9,13 +9,7 @@
EFL_START_TEST(efreet_test_efreet_cache_init) EFL_START_TEST(efreet_test_efreet_cache_init)
{ {
int ret; /* FIXME: this should maybe do something? */
ret = efreet_init();
fail_if(ret != 1);
ret = efreet_shutdown();
fail_if(ret != 0);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -91,35 +91,16 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL } { NULL, NULL }
}; };
/* FIXME this is a copy from eina_test_mempool
* we should remove the duplication
*/
static Eina_Array *_modules; static Eina_Array *_modules;
static void _mempool_init(void)
SUITE_INIT(eina)
{ {
eina_init(); ck_assert_int_eq(eina_init(), 1);
/* force modules to be loaded in case they are not installed */
_modules = eina_module_list_get(NULL,
PACKAGE_BUILD_DIR "/src/modules/eina",
EINA_TRUE,
NULL,
NULL);
eina_module_list_load(_modules);
} }
static void _mempool_shutdown(void) SUITE_SHUTDOWN(eina)
{ {
unsigned int i; ck_assert_int_eq(eina_shutdown(), 0);
Eina_Array_Iterator it;
Eina_Module *module;
eina_module_list_free(_modules);
if (_modules)
{
EINA_ARRAY_ITER_NEXT(_modules, i, module, it)
free(module);
eina_array_free(_modules);
}
eina_shutdown();
} }
int int
@ -134,12 +115,9 @@ main(int argc, char **argv)
putenv("EFL_RUN_IN_TREE=1"); putenv("EFL_RUN_IN_TREE=1");
#endif #endif
_mempool_init();
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Eina", etc); "Eina", etc, SUITE_INIT_FN(eina), SUITE_SHUTDOWN_FN(eina));
_mempool_shutdown();
return (failed_count == 0) ? 0 : 255; return (failed_count == 0) ? 0 : 255;
} }

View File

@ -43,7 +43,6 @@ EFL_START_TEST(eina_unicode_utf8)
{ {
int ind; int ind;
unsigned char ch; unsigned char ch;
eina_init();
/* Valid utf-8 cases */ /* Valid utf-8 cases */
/* First possible sequence of a certain length */ /* First possible sequence of a certain length */
@ -240,19 +239,13 @@ EFL_START_TEST(eina_unicode_utf8)
fail_if((eina_unicode_utf8_get_next("\xFC\x83\xBF\xBF\xBF\xBF", &ind) != 0xDCFC) || fail_if((eina_unicode_utf8_get_next("\xFC\x83\xBF\xBF\xBF\xBF", &ind) != 0xDCFC) ||
(ind != 1)); (ind != 1));
/* Add some more error cases here */ /* Add some more error cases here */
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_alignof) EFL_START_TEST(eina_alignof)
{ {
eina_init();
fail_if(eina_mempool_alignof(6) != 8); fail_if(eina_mempool_alignof(6) != 8);
fail_if((eina_mempool_alignof(10) & 0x7) != 0); fail_if((eina_mempool_alignof(10) & 0x7) != 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -43,8 +43,6 @@ EFL_START_TEST(eina_accessor_array_simple)
int *tmp; int *tmp;
int i; int i;
eina_init();
ea = eina_array_new(11); ea = eina_array_new(11);
fail_if(!ea); fail_if(!ea);
@ -74,7 +72,6 @@ EFL_START_TEST(eina_accessor_array_simple)
eina_array_free(ea); eina_array_free(ea);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -192,8 +189,6 @@ EFL_START_TEST(eina_accessor_list_simple)
int *j; int *j;
int i = 0; int i = 0;
eina_init();
list = eina_list_append(list, &data[0]); list = eina_list_append(list, &data[0]);
fail_if(list == NULL); fail_if(list == NULL);

View File

@ -33,8 +33,6 @@ EFL_START_TEST(eina_array_simple)
Eina_Array_Iterator it; Eina_Array_Iterator it;
unsigned int i; unsigned int i;
eina_init();
ea = eina_array_new(11); ea = eina_array_new(11);
fail_if(!ea); fail_if(!ea);
@ -66,7 +64,6 @@ EFL_START_TEST(eina_array_simple)
eina_array_flush(ea); eina_array_flush(ea);
eina_array_free(ea); eina_array_free(ea);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -77,8 +74,6 @@ EFL_START_TEST(eina_array_static)
Eina_Array_Iterator it; Eina_Array_Iterator it;
unsigned int i; unsigned int i;
eina_init();
eina_array_step_set(&sea, sizeof(sea), 10); eina_array_step_set(&sea, sizeof(sea), 10);
for (i = 0; i < 200; ++i) for (i = 0; i < 200; ++i)
@ -104,7 +99,6 @@ EFL_START_TEST(eina_array_static)
eina_array_clean(&sea); eina_array_clean(&sea);
eina_array_flush(&sea); eina_array_flush(&sea);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -129,8 +123,6 @@ EFL_START_TEST(eina_array_remove_stuff)
Eina_Array_Iterator it; Eina_Array_Iterator it;
unsigned int i; unsigned int i;
eina_init();
ea = eina_array_new(64); ea = eina_array_new(64);
fail_if(!ea); fail_if(!ea);
@ -179,7 +171,6 @@ EFL_START_TEST(eina_array_remove_stuff)
eina_array_free(ea); eina_array_free(ea);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -65,9 +65,6 @@ EFL_START_TEST(eina_barrier_test_simple)
Eina_Bool r; Eina_Bool r;
int i; int i;
i = eina_init();
_ck_assert_int(i, >=, 1);
i = eina_threads_init(); i = eina_threads_init();
_ck_assert_int(i, >=, 1); _ck_assert_int(i, >=, 1);
@ -104,7 +101,6 @@ EFL_START_TEST(eina_barrier_test_simple)
eina_barrier_free(&barrier); eina_barrier_free(&barrier);
eina_threads_shutdown(); eina_threads_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -32,7 +32,6 @@ EFL_START_TEST(eina_bezier_test_values)
Eina_Bezier b; Eina_Bezier b;
double sx, sy, cx1, cy1, cx2, cy2, ex, ey; double sx, sy, cx1, cy1, cx2, cy2, ex, ey;
eina_init();
eina_bezier_values_set(&b, eina_bezier_values_set(&b,
1, 2, 1, 2,
3, 4, 3, 4,
@ -51,7 +50,6 @@ EFL_START_TEST(eina_bezier_test_values)
cy2 != 6 || cy2 != 6 ||
ex != 7 || ex != 7 ||
ey != 8); ey != 8);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -60,7 +58,6 @@ EFL_START_TEST(eina_bezier_test_angle)
Eina_Bezier b; Eina_Bezier b;
double angle; double angle;
eina_init();
eina_bezier_values_set(&b, eina_bezier_values_set(&b,
1, 1, 1, 1,
3, 1, 3, 1,
@ -78,7 +75,6 @@ EFL_START_TEST(eina_bezier_test_angle)
angle = eina_bezier_angle_at(&b, 0.5); angle = eina_bezier_angle_at(&b, 0.5);
fail_if(floor(angle) != 90); fail_if(floor(angle) != 90);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -87,7 +83,6 @@ EFL_START_TEST(eina_bezier_test_length)
Eina_Bezier b; Eina_Bezier b;
double length; double length;
eina_init();
eina_bezier_values_set(&b, eina_bezier_values_set(&b,
1, 1, 1, 1,
3, 1, 3, 1,
@ -104,7 +99,6 @@ EFL_START_TEST(eina_bezier_test_length)
length = eina_bezier_length_get(&b); length = eina_bezier_length_get(&b);
fail_if(length != 0); fail_if(length != 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -113,7 +107,6 @@ EFL_START_TEST(eina_bezier_test_t_at)
Eina_Bezier b; Eina_Bezier b;
double length, t; double length, t;
eina_init();
eina_bezier_values_set(&b, eina_bezier_values_set(&b,
1, 1, 1, 1,
3, 1, 3, 1,
@ -126,7 +119,6 @@ EFL_START_TEST(eina_bezier_test_t_at)
t = eina_bezier_t_at(&b, length); t = eina_bezier_t_at(&b, length);
fail_if(t != 1); fail_if(t != 1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -135,7 +127,6 @@ EFL_START_TEST(eina_bezier_test_point_at)
Eina_Bezier b; Eina_Bezier b;
double x, y; double x, y;
eina_init();
eina_bezier_values_set(&b, eina_bezier_values_set(&b,
1, 2, 1, 2,
3, 4, 3, 4,
@ -150,7 +141,6 @@ EFL_START_TEST(eina_bezier_test_point_at)
fail_if(x != 7 || fail_if(x != 7 ||
y != 8); y != 8);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -159,7 +149,6 @@ EFL_START_TEST(eina_bezier_test_split_at_length)
Eina_Bezier b, l , r; Eina_Bezier b, l , r;
double len, len1, len2; double len, len1, len2;
eina_init();
eina_bezier_values_set(&b, eina_bezier_values_set(&b,
1, 2, 1, 2,
3, 4, 3, 4,
@ -172,7 +161,6 @@ EFL_START_TEST(eina_bezier_test_split_at_length)
fail_if(len != (len1 + len2)); fail_if(len != (len1 + len2));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -181,7 +169,6 @@ EFL_START_TEST(eina_bezier_test_bounds_get)
Eina_Bezier b; Eina_Bezier b;
double x, y, w, h; double x, y, w, h;
eina_init();
eina_bezier_values_set(&b, eina_bezier_values_set(&b,
0, 0, 0, 0,
100, 0, 100, 0,
@ -192,7 +179,6 @@ EFL_START_TEST(eina_bezier_test_bounds_get)
fail_if(x !=0 || y!=0 || w !=100 || h !=100 ); fail_if(x !=0 || y!=0 || w !=100 || h !=100 );
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -201,7 +187,6 @@ EFL_START_TEST(eina_bezier_test_on_interval)
Eina_Bezier b, res; Eina_Bezier b, res;
double px1, px2, py1, py2; double px1, px2, py1, py2;
eina_init();
eina_bezier_values_set(&b, eina_bezier_values_set(&b,
0, 0, 0, 0,
10, 20, 10, 20,
@ -213,7 +198,6 @@ EFL_START_TEST(eina_bezier_test_on_interval)
fail_if(px1 != px2 || py1 != py2); fail_if(px1 != px2 || py1 != py2);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -34,8 +34,6 @@ EFL_START_TEST(binbuf_simple)
Eina_Slice ro_slice; Eina_Slice ro_slice;
Eina_Rw_Slice rw_slice; Eina_Rw_Slice rw_slice;
eina_init();
buf = eina_binbuf_new(); buf = eina_binbuf_new();
fail_if(!buf); fail_if(!buf);
@ -80,7 +78,6 @@ EFL_START_TEST(binbuf_simple)
eina_binbuf_free(buf); eina_binbuf_free(buf);
eina_shutdown();
#undef TEXT #undef TEXT
} }
EFL_END_TEST EFL_END_TEST
@ -91,8 +88,6 @@ EFL_START_TEST(binbuf_remove)
const unsigned char cbuf[] = "12\0 456 78\0 abcthis is some more random junk here!"; const unsigned char cbuf[] = "12\0 456 78\0 abcthis is some more random junk here!";
size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */ size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */
eina_init();
buf = eina_binbuf_new(); buf = eina_binbuf_new();
fail_if(!buf); fail_if(!buf);
@ -112,8 +107,6 @@ EFL_START_TEST(binbuf_remove)
fail_if(0 != eina_binbuf_length_get(buf)); fail_if(0 != eina_binbuf_length_get(buf));
eina_binbuf_free(buf); eina_binbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -130,8 +123,6 @@ EFL_START_TEST(binbuf_manage_simple)
unsigned char *alloc_buf = malloc(size); unsigned char *alloc_buf = malloc(size);
memcpy(alloc_buf, cbuf, size); memcpy(alloc_buf, cbuf, size);
eina_init();
buf = eina_binbuf_manage_new_length(alloc_buf, size); buf = eina_binbuf_manage_new_length(alloc_buf, size);
fail_if(!buf); fail_if(!buf);
@ -144,7 +135,6 @@ EFL_START_TEST(binbuf_manage_simple)
eina_binbuf_free(buf); eina_binbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -155,8 +145,6 @@ EFL_START_TEST(binbuf_manage_read_only_simple)
const unsigned char *cbuf = (const unsigned char *) _cbuf; const unsigned char *cbuf = (const unsigned char *) _cbuf;
size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */ size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */
eina_init();
buf = eina_binbuf_manage_read_only_new_length(cbuf, size); buf = eina_binbuf_manage_read_only_new_length(cbuf, size);
fail_if(!buf); fail_if(!buf);
@ -174,7 +162,6 @@ EFL_START_TEST(binbuf_manage_read_only_simple)
eina_binbuf_free(buf); eina_binbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
@ -184,8 +171,6 @@ EFL_START_TEST(binbuf_insert)
#if 0 #if 0
Eina_Binbuf *buf; Eina_Binbuf *buf;
eina_init();
buf = eina_binbuf_new(); buf = eina_binbuf_new();
fail_if(!buf); fail_if(!buf);
@ -227,7 +212,6 @@ EFL_START_TEST(binbuf_insert)
eina_binbuf_free(buf); eina_binbuf_free(buf);
eina_shutdown();
#endif #endif
} }
EFL_END_TEST EFL_END_TEST
@ -248,8 +232,6 @@ EFL_START_TEST(binbuf_realloc)
} }
pattern[i] = '\0'; pattern[i] = '\0';
eina_init();
buf = eina_binbuf_new(); buf = eina_binbuf_new();
fail_if(!buf); fail_if(!buf);
@ -302,7 +284,6 @@ EFL_START_TEST(binbuf_realloc)
eina_binbuf_free(buf); eina_binbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -316,8 +297,6 @@ EFL_START_TEST(binbuf_expand)
size_t i; size_t i;
Eina_Bool r; Eina_Bool r;
eina_init();
buf = eina_binbuf_new(); buf = eina_binbuf_new();
fail_if(!buf); fail_if(!buf);
@ -369,7 +348,6 @@ EFL_START_TEST(binbuf_expand)
eina_binbuf_free(buf); eina_binbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -39,8 +39,6 @@ EFL_START_TEST(eina_binshare_simple)
const char *t0; const char *t0;
const char *t1; const char *t1;
eina_init();
t0 = eina_binshare_add_length(TEST0, TEST0_SIZE); t0 = eina_binshare_add_length(TEST0, TEST0_SIZE);
t1 = eina_binshare_add_length(TEST1, TEST1_SIZE); t1 = eina_binshare_add_length(TEST1, TEST1_SIZE);
@ -57,7 +55,6 @@ EFL_START_TEST(eina_binshare_simple)
eina_binshare_del(t0); eina_binshare_del(t0);
eina_binshare_del(t1); eina_binshare_del(t1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -66,8 +63,6 @@ EFL_START_TEST(eina_binshare_small)
char buf[4]; char buf[4];
int i; int i;
eina_init();
for (i = 1; i < 3; i++) for (i = 1; i < 3; i++)
{ {
const char *t0, *t1; const char *t0, *t1;
@ -91,7 +86,6 @@ EFL_START_TEST(eina_binshare_small)
eina_binshare_del(t0); eina_binshare_del(t0);
eina_binshare_del(t1); eina_binshare_del(t1);
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -101,8 +95,6 @@ EFL_START_TEST(eina_binshare_test_share)
const char *t0; const char *t0;
const char *t1; const char *t1;
eina_init();
t0 = eina_binshare_add_length(TEST0, TEST0_SIZE); t0 = eina_binshare_add_length(TEST0, TEST0_SIZE);
t1 = eina_binshare_add_length(TEST0, TEST0_SIZE); t1 = eina_binshare_add_length(TEST0, TEST0_SIZE);
@ -115,7 +107,6 @@ EFL_START_TEST(eina_binshare_test_share)
eina_binshare_del(t0); eina_binshare_del(t0);
eina_binshare_del(t1); eina_binshare_del(t1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -124,8 +115,6 @@ EFL_START_TEST(eina_binshare_putstuff)
const char *tmp; const char *tmp;
int i; int i;
eina_init();
for (i = 10000; i > 0; --i) for (i = 10000; i > 0; --i)
{ {
char build[64] = "string_"; char build[64] = "string_";
@ -135,7 +124,6 @@ EFL_START_TEST(eina_binshare_putstuff)
fail_if(tmp != eina_binshare_add_length(build, strlen(build))); fail_if(tmp != eina_binshare_add_length(build, strlen(build)));
fail_if((int)strlen(build) != eina_binshare_length(tmp)); fail_if((int)strlen(build) != eina_binshare_length(tmp));
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -147,8 +135,6 @@ EFL_START_TEST(eina_binshare_collision)
srand(time(NULL)); srand(time(NULL));
eina_init();
ea = eina_array_new(256); ea = eina_array_new(256);
fail_if(!ea); fail_if(!ea);
@ -183,8 +169,6 @@ EFL_START_TEST(eina_binshare_collision)
for (i = 0; i < 1000; ++i) for (i = 0; i < 1000; ++i)
eina_binshare_del(eina_array_pop(ea)); eina_binshare_del(eina_array_pop(ea));
eina_shutdown();
eina_array_free(ea); eina_array_free(ea);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -90,8 +90,6 @@ _eina_convert_check(double test, int length)
long long int m = 0; long long int m = 0;
long e = 0; long e = 0;
eina_init();
_eina_convert_check(EET_TEST_DOUBLE0, 20); _eina_convert_check(EET_TEST_DOUBLE0, 20);
_eina_convert_check(-EET_TEST_DOUBLE0, 21); _eina_convert_check(-EET_TEST_DOUBLE0, 21);
_eina_convert_check(EET_TEST_DOUBLE1, 6); _eina_convert_check(EET_TEST_DOUBLE1, 6);
@ -103,7 +101,6 @@ _eina_convert_check(double test, int length)
fail_if(eina_convert_atod("0xjo", 8, &m, &e) != EINA_FALSE); fail_if(eina_convert_atod("0xjo", 8, &m, &e) != EINA_FALSE);
fail_if(eina_convert_atod("0xp", 8, &m, &e) != EINA_FALSE); fail_if(eina_convert_atod("0xp", 8, &m, &e) != EINA_FALSE);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -71,8 +71,6 @@ EFL_START_TEST(eina_counter_simple)
char *dump; char *dump;
int i; int i;
eina_init();
cnt = eina_counter_new("eina_test"); cnt = eina_counter_new("eina_test");
fail_if(!cnt); fail_if(!cnt);
@ -106,7 +104,6 @@ EFL_START_TEST(eina_counter_simple)
eina_counter_free(cnt); eina_counter_free(cnt);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -114,8 +111,6 @@ EFL_START_TEST(eina_counter_break)
{ {
Eina_Counter *cnt; Eina_Counter *cnt;
eina_init();
cnt = eina_counter_new("eina_test"); cnt = eina_counter_new("eina_test");
fail_if(!cnt); fail_if(!cnt);
@ -182,7 +177,6 @@ EFL_START_TEST(eina_counter_break)
} }
#endif #endif
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -75,8 +75,6 @@ EFL_START_TEST(eina_error_errno)
setenv("EINA_ERROR_LEVEL", "1", 0); setenv("EINA_ERROR_LEVEL", "1", 0);
eina_init();
test = eina_error_msg_register(TEST_TEXT); test = eina_error_msg_register(TEST_TEXT);
fail_if(!eina_error_msg_get(test)); fail_if(!eina_error_msg_get(test));
fail_if(strcmp(eina_error_msg_get(test), TEST_TEXT) != 0); fail_if(strcmp(eina_error_msg_get(test), TEST_TEXT) != 0);
@ -88,7 +86,6 @@ EFL_START_TEST(eina_error_errno)
ck_assert_int_eq(eina_error_get(), EBADF); ck_assert_int_eq(eina_error_get(), EBADF);
ck_assert_str_eq(eina_error_msg_get(EBADF), strerror(EBADF)); ck_assert_str_eq(eina_error_msg_get(EBADF), strerror(EBADF));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -97,8 +94,6 @@ EFL_START_TEST(eina_error_test_find)
int test, r; int test, r;
const char *str; const char *str;
eina_init();
/* Make sure the value isn't already there. */ /* Make sure the value isn't already there. */
r = eina_error_find(TEST_TEXT TEST_TEXT); r = eina_error_find(TEST_TEXT TEST_TEXT);
ck_assert_int_eq(r, 0); ck_assert_int_eq(r, 0);
@ -116,7 +111,6 @@ EFL_START_TEST(eina_error_test_find)
r = eina_error_find(TEST_TEXT TEST_TEXT); r = eina_error_find(TEST_TEXT TEST_TEXT);
ck_assert_int_eq(r, test); ck_assert_int_eq(r, test);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -125,8 +119,6 @@ EFL_START_TEST(eina_error_test_modify)
int test, r; int test, r;
const char *str, smsg[] = "Do not copy this string"; const char *str, smsg[] = "Do not copy this string";
eina_init();
test = eina_error_msg_register("Some Test Error"); test = eina_error_msg_register("Some Test Error");
ck_assert_int_ne(test, 0); ck_assert_int_ne(test, 0);
@ -153,7 +145,6 @@ EFL_START_TEST(eina_error_test_modify)
r = eina_error_find("Change that!"); r = eina_error_find("Change that!");
ck_assert_int_eq(r, test); ck_assert_int_eq(r, test);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -163,8 +154,6 @@ EFL_START_TEST(eina_error_test_lots)
int codes[512]; int codes[512];
unsigned int i; unsigned int i;
eina_init();
for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++)
{ {
snprintf(buf, sizeof(buf), "myerr-%u", i); snprintf(buf, sizeof(buf), "myerr-%u", i);
@ -182,7 +171,6 @@ EFL_START_TEST(eina_error_test_lots)
ck_assert_int_eq(codes[i], found); ck_assert_int_eq(codes[i], found);
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -192,8 +180,6 @@ EFL_START_TEST(eina_error_test_failures)
struct log_ctx ctx; struct log_ctx ctx;
Eina_Error local_error; Eina_Error local_error;
eina_init();
eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx);
#define TEST_MAGIC_SAFETY(fn, _msg) \ #define TEST_MAGIC_SAFETY(fn, _msg) \
@ -249,7 +235,6 @@ EFL_START_TEST(eina_error_test_failures)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif

View File

@ -92,8 +92,6 @@ EFL_START_TEST(eina_file_split_simple)
{ {
Eina_Array *ea; Eina_Array *ea;
eina_init();
#ifdef EINA_SAFETY_CHECKS #ifdef EINA_SAFETY_CHECKS
#ifdef SHOW_LOG #ifdef SHOW_LOG
fprintf(stderr, "you should have a safety check failure below:\n"); fprintf(stderr, "you should have a safety check failure below:\n");
@ -151,7 +149,6 @@ EFL_START_TEST(eina_file_split_simple)
eina_array_free(ea); eina_array_free(ea);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -180,8 +177,6 @@ get_eina_test_file_tmp_dir()
EFL_START_TEST(eina_file_direct_ls_simple) EFL_START_TEST(eina_file_direct_ls_simple)
{ {
eina_init();
/* /*
* Windows: naming conventions * Windows: naming conventions
* https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
@ -238,14 +233,11 @@ EFL_START_TEST(eina_file_direct_ls_simple)
} }
fail_if(rmdir(test_dirname) != 0); fail_if(rmdir(test_dirname) != 0);
eina_tmpstr_del(test_dirname); eina_tmpstr_del(test_dirname);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_file_ls_simple) EFL_START_TEST(eina_file_ls_simple)
{ {
eina_init();
/* /*
* Windows: naming conventions * Windows: naming conventions
* https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
@ -300,7 +292,6 @@ EFL_START_TEST(eina_file_ls_simple)
} }
fail_if(rmdir(test_dirname) != 0); fail_if(rmdir(test_dirname) != 0);
eina_tmpstr_del(test_dirname); eina_tmpstr_del(test_dirname);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -327,8 +318,6 @@ EFL_START_TEST(eina_file_map_new_test)
int test_dirname_size; int test_dirname_size;
int start_point_final, last_chunk_size; int start_point_final, last_chunk_size;
eina_init();
Eina_Tmpstr *test_dirname = get_eina_test_file_tmp_dir(); Eina_Tmpstr *test_dirname = get_eina_test_file_tmp_dir();
fail_if(test_dirname == NULL); fail_if(test_dirname == NULL);
test_dirname_size = strlen((char *)test_dirname); test_dirname_size = strlen((char *)test_dirname);
@ -440,7 +429,6 @@ EFL_START_TEST(eina_file_map_new_test)
free(test_file2_path); free(test_file2_path);
eina_tmpstr_del(test_dirname); eina_tmpstr_del(test_dirname);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -461,8 +449,6 @@ EFL_START_TEST(eina_test_file_virtualize)
void *map; void *map;
unsigned int i = 0; unsigned int i = 0;
eina_init();
f = eina_file_virtualize("gloubi", virtual_file_data, strlen(virtual_file_data), EINA_FALSE); f = eina_file_virtualize("gloubi", virtual_file_data, strlen(virtual_file_data), EINA_FALSE);
fail_if(!f); fail_if(!f);
@ -494,7 +480,6 @@ EFL_START_TEST(eina_test_file_virtualize)
eina_file_close(f); eina_file_close(f);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -519,15 +504,12 @@ EFL_START_TEST(eina_test_file_thread)
Eina_Thread th[4]; Eina_Thread th[4];
unsigned int i; unsigned int i;
fail_if(!eina_init());
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
fail_if(!(eina_thread_create(&th[i], EINA_THREAD_NORMAL, -1, _eina_test_file_thread, NULL))); fail_if(!(eina_thread_create(&th[i], EINA_THREAD_NORMAL, -1, _eina_test_file_thread, NULL)));
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
fail_if(eina_thread_join(th[i]) != NULL); fail_if(eina_thread_join(th[i]) != NULL);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -543,15 +525,12 @@ EFL_START_TEST(eina_test_file_path)
unsigned int i; unsigned int i;
char *path; char *path;
fail_if(!eina_init());
for (i = 0; i < sizeof (sanitize) / sizeof (sanitize[0]); i++) for (i = 0; i < sizeof (sanitize) / sizeof (sanitize[0]); i++)
{ {
path = eina_file_path_sanitize(sanitize[i].test); path = eina_file_path_sanitize(sanitize[i].test);
fail_if(strcmp(path, sanitize[i].result)); fail_if(strcmp(path, sanitize[i].result));
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -580,7 +559,6 @@ EFL_START_TEST(eina_test_file_xattr)
int fd, count=0; int fd, count=0;
Eina_Xattr *xattr; Eina_Xattr *xattr;
eina_init();
test_file_path = get_full_path(XATTR_TEST_DIR, filename); test_file_path = get_full_path(XATTR_TEST_DIR, filename);
fd = open(test_file_path, O_RDONLY | O_BINARY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO); fd = open(test_file_path, O_RDONLY | O_BINARY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
@ -627,7 +605,6 @@ EFL_START_TEST(eina_test_file_xattr)
unlink(test_file_path); unlink(test_file_path);
eina_tmpstr_del(test_file_path); eina_tmpstr_del(test_file_path);
eina_file_close(ef); eina_file_close(ef);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif
@ -644,8 +621,6 @@ EFL_START_TEST(eina_test_file_copy)
Eina_Bool ret; Eina_Bool ret;
void *content1, *content2; void *content1, *content2;
eina_init();
fd1 = eina_file_mkstemp(test_file1_name, &test_file1_path); fd1 = eina_file_mkstemp(test_file1_name, &test_file1_path);
fail_if(fd1 <= 0); fail_if(fd1 <= 0);
@ -694,7 +669,6 @@ EFL_START_TEST(eina_test_file_copy)
eina_tmpstr_del(test_file1_path); eina_tmpstr_del(test_file1_path);
eina_tmpstr_del(test_file2_path); eina_tmpstr_del(test_file2_path);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -708,8 +682,6 @@ EFL_START_TEST(eina_test_file_statat)
int template_size = strlen(template); int template_size = strlen(template);
int fd, ret; int fd, ret;
eina_init();
Eina_Tmpstr *test_dirname = get_eina_test_file_tmp_dir(); Eina_Tmpstr *test_dirname = get_eina_test_file_tmp_dir();
fail_if(test_dirname == NULL); fail_if(test_dirname == NULL);
@ -743,7 +715,6 @@ EFL_START_TEST(eina_test_file_statat)
eina_tmpstr_del(test_file2_path); eina_tmpstr_del(test_file2_path);
eina_tmpstr_del(test_dirname); eina_tmpstr_del(test_dirname);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -868,8 +839,6 @@ EFL_START_TEST(eina_test_file_unlink)
Eina_Tmpstr *test_file_path; Eina_Tmpstr *test_file_path;
const char *tmpfile = "eina_file_test_XXXXXX"; const char *tmpfile = "eina_file_test_XXXXXX";
eina_init();
/*If file was not opened as 'eina'*/ /*If file was not opened as 'eina'*/
fd = create_file_not_empty(tmpfile, &test_file_path, EINA_TRUE); fd = create_file_not_empty(tmpfile, &test_file_path, EINA_TRUE);
fail_if(fd != 0); fail_if(fd != 0);
@ -881,7 +850,6 @@ EFL_START_TEST(eina_test_file_unlink)
fail_if(!eina_file_open(test_file_path, EINA_FALSE)); fail_if(!eina_file_open(test_file_path, EINA_FALSE));
fail_if(!eina_file_unlink(test_file_path)); fail_if(!eina_file_unlink(test_file_path));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -37,8 +37,6 @@ EFL_START_TEST(eina_fp_cos)
double dresult; double dresult;
double delta; double delta;
fail_if(!eina_init());
fl = eina_f32p32_scale(EINA_F32P32_PI, 4); fl = eina_f32p32_scale(EINA_F32P32_PI, 4);
step = eina_f32p32_div(fl, eina_f32p32_int_from(2048)); step = eina_f32p32_div(fl, eina_f32p32_int_from(2048));
@ -52,7 +50,6 @@ EFL_START_TEST(eina_fp_cos)
fail_if(delta > 0.005); fail_if(delta > 0.005);
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -66,8 +63,6 @@ EFL_START_TEST(eina_fp_sin)
double dresult; double dresult;
double delta; double delta;
fail_if(!eina_init());
fl = eina_f32p32_scale(EINA_F32P32_PI, 4); fl = eina_f32p32_scale(EINA_F32P32_PI, 4);
step = eina_f32p32_div(fl, eina_f32p32_int_from(2048)); step = eina_f32p32_div(fl, eina_f32p32_int_from(2048));
@ -82,7 +77,6 @@ EFL_START_TEST(eina_fp_sin)
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -98,8 +92,6 @@ EFL_START_TEST(eina_fp_mul)
double maxdelta = 0; double maxdelta = 0;
double maxdelta_per = 0; double maxdelta_per = 0;
fail_if(!eina_init());
dl1 = 10; dl1 = 10;
step1 = 0.001; step1 = 0.001;
dl2 = 1000; dl2 = 1000;
@ -135,7 +127,6 @@ EFL_START_TEST(eina_fp_mul)
} }
printf("Max delta(multiplication): %f (%f%%)\n", maxdelta, maxdelta_per*100); printf("Max delta(multiplication): %f (%f%%)\n", maxdelta, maxdelta_per*100);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -151,8 +142,6 @@ EFL_START_TEST(eina_fp_div)
double maxdelta = 0; double maxdelta = 0;
double maxdelta_per = 0; double maxdelta_per = 0;
fail_if(!eina_init());
dl1 = 10; dl1 = 10;
step1 = 0.001; step1 = 0.001;
dl2 = 1000; dl2 = 1000;
@ -187,7 +176,6 @@ EFL_START_TEST(eina_fp_div)
} }
printf("Max delta(division): %f (%f%%)\n", maxdelta, maxdelta_per*100); printf("Max delta(division): %f (%f%%)\n", maxdelta, maxdelta_per*100);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -11,8 +11,6 @@ EFL_START_TEST(freeq_simple)
Eina_FreeQ *fq; Eina_FreeQ *fq;
int *p; int *p;
eina_init();
fq = eina_freeq_main_get(); fq = eina_freeq_main_get();
fail_if(fq == NULL); fail_if(fq == NULL);
fail_if(eina_freeq_type_get(fq) != EINA_FREEQ_DEFAULT); fail_if(eina_freeq_type_get(fq) != EINA_FREEQ_DEFAULT);
@ -28,7 +26,6 @@ EFL_START_TEST(freeq_simple)
eina_freeq_free(fq); eina_freeq_free(fq);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -44,8 +41,6 @@ EFL_START_TEST(freeq_tune)
{ {
void *p; void *p;
eina_init();
eina_freeq_count_max_set(eina_freeq_main_get(), 3); eina_freeq_count_max_set(eina_freeq_main_get(), 3);
fail_if(eina_freeq_count_max_get(eina_freeq_main_get()) != 3); fail_if(eina_freeq_count_max_get(eina_freeq_main_get()) != 3);
@ -72,7 +67,6 @@ EFL_START_TEST(freeq_tune)
fail_if(eina_freeq_ptr_pending(eina_freeq_main_get()) == EINA_TRUE); fail_if(eina_freeq_ptr_pending(eina_freeq_main_get()) == EINA_TRUE);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -80,8 +74,6 @@ EFL_START_TEST(freeq_reduce)
{ {
void *p; void *p;
eina_init();
_n++; _n++;
p = malloc(9); p = malloc(9);
eina_freeq_ptr_main_add(p, freefn, 9); eina_freeq_ptr_main_add(p, freefn, 9);
@ -112,7 +104,6 @@ EFL_START_TEST(freeq_reduce)
fail_if(_n > 0); fail_if(_n > 0);
fail_if(eina_freeq_ptr_pending(eina_freeq_main_get()) == EINA_TRUE); fail_if(eina_freeq_ptr_pending(eina_freeq_main_get()) == EINA_TRUE);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -142,7 +133,6 @@ EFL_START_TEST(freeq_postponed)
unsigned int *values[20]; unsigned int *values[20];
size_t k; size_t k;
eina_init();
_n = 0; _n = 0;
fq = eina_freeq_new(EINA_FREEQ_POSTPONED); fq = eina_freeq_new(EINA_FREEQ_POSTPONED);
@ -192,7 +182,6 @@ EFL_START_TEST(freeq_postponed)
eina_freeq_free(fq); eina_freeq_free(fq);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -76,8 +76,6 @@ EFL_START_TEST(eina_hash_simple)
int array[] = { 1, 42, 4, 5, 6 }; int array[] = { 1, 42, 4, 5, 6 };
/* As mempool is already initialized and it use hash, we should have 2 init. */ /* As mempool is already initialized and it use hash, we should have 2 init. */
fail_if(eina_init() != 2);
hash = eina_hash_string_superfast_new(NULL); hash = eina_hash_string_superfast_new(NULL);
fail_if(hash == NULL); fail_if(hash == NULL);
@ -122,8 +120,6 @@ EFL_START_TEST(eina_hash_simple)
eina_hash_free(hash); eina_hash_free(hash);
/* Same comment as eina_init */
fail_if(eina_shutdown() != 1);
} }
EFL_END_TEST EFL_END_TEST
@ -133,8 +129,6 @@ EFL_START_TEST(eina_test_hash_crc)
int *test; int *test;
int array[] = { 1, 42, 4, 5, 6 }; int array[] = { 1, 42, 4, 5, 6 };
fail_if(eina_init() != 2);
hash = eina_hash_new(EINA_KEY_LENGTH(_eina_string_key_length), hash = eina_hash_new(EINA_KEY_LENGTH(_eina_string_key_length),
EINA_KEY_CMP(_eina_string_key_cmp), EINA_KEY_CMP(_eina_string_key_cmp),
EINA_KEY_HASH(eina_hash_crc), EINA_KEY_HASH(eina_hash_crc),
@ -183,8 +177,6 @@ EFL_START_TEST(eina_test_hash_crc)
eina_hash_free(hash); eina_hash_free(hash);
/* Same comment as eina_init */
fail_if(eina_shutdown() != 1);
} }
EFL_END_TEST EFL_END_TEST
@ -193,8 +185,6 @@ EFL_START_TEST(eina_hash_extended)
Eina_Hash *hash = NULL; Eina_Hash *hash = NULL;
int i; int i;
fail_if(eina_init() != 2);
hash = eina_hash_string_djb2_new(NULL); hash = eina_hash_string_djb2_new(NULL);
fail_if(hash == NULL); fail_if(hash == NULL);
@ -212,7 +202,6 @@ EFL_START_TEST(eina_hash_extended)
eina_hash_free(hash); eina_hash_free(hash);
fail_if(eina_shutdown() != 1);
} }
EFL_END_TEST EFL_END_TEST
@ -222,8 +211,6 @@ EFL_START_TEST(eina_hash_double_item)
int i[] = { 7, 7 }; int i[] = { 7, 7 };
int *test; int *test;
fail_if(eina_init() != 2);
hash = eina_hash_string_superfast_new(NULL); hash = eina_hash_string_superfast_new(NULL);
fail_if(hash == NULL); fail_if(hash == NULL);
@ -236,7 +223,6 @@ EFL_START_TEST(eina_hash_double_item)
eina_hash_free(hash); eina_hash_free(hash);
fail_if(eina_shutdown() != 1);
} }
EFL_END_TEST EFL_END_TEST
@ -249,8 +235,6 @@ EFL_START_TEST(eina_hash_all_int)
int *test; int *test;
int it; int it;
fail_if(eina_init() != 2);
hash = eina_hash_int32_new(NULL); hash = eina_hash_int32_new(NULL);
fail_if(hash == NULL); fail_if(hash == NULL);
@ -278,7 +262,6 @@ EFL_START_TEST(eina_hash_all_int)
eina_hash_free(hash); eina_hash_free(hash);
fail_if(eina_shutdown() != 1);
} }
EFL_END_TEST EFL_END_TEST
@ -291,8 +274,6 @@ EFL_START_TEST(eina_hash_int32_fuzze)
unsigned int j; unsigned int j;
unsigned int seed; unsigned int seed;
eina_init();
seed = time(NULL); seed = time(NULL);
srand(seed); srand(seed);
@ -341,7 +322,6 @@ EFL_START_TEST(eina_hash_int32_fuzze)
eina_hash_free(hash); eina_hash_free(hash);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -354,8 +334,6 @@ EFL_START_TEST(eina_hash_string_fuzze)
unsigned int j; unsigned int j;
unsigned int seed; unsigned int seed;
eina_init();
seed = time(NULL); seed = time(NULL);
srand(seed); srand(seed);
@ -405,17 +383,13 @@ EFL_START_TEST(eina_hash_string_fuzze)
eina_hash_free(hash); eina_hash_free(hash);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_hash_seed) EFL_START_TEST(eina_hash_seed)
{ {
eina_init();
fail_if(eina_seed == 0); fail_if(eina_seed == 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -425,8 +399,6 @@ EFL_START_TEST(eina_hash_add_del_by_hash)
int array[] = { 1, 42, 4, 5, 6 }; int array[] = { 1, 42, 4, 5, 6 };
int key_len, key_hash; int key_len, key_hash;
fail_if(eina_init() != 2);
hash = eina_hash_new(EINA_KEY_LENGTH(_eina_string_key_length), hash = eina_hash_new(EINA_KEY_LENGTH(_eina_string_key_length),
EINA_KEY_CMP(_eina_string_key_cmp), EINA_KEY_CMP(_eina_string_key_cmp),
EINA_KEY_HASH(eina_hash_crc), EINA_KEY_HASH(eina_hash_crc),

View File

@ -40,8 +40,6 @@ EFL_START_TEST(eina_inarray_test_simple)
{-1, -1} {-1, -1}
}; };
eina_init();
array = eina_inarray_new(sizeof(int), 2); array = eina_inarray_new(sizeof(int), 2);
fail_unless(array != NULL); fail_unless(array != NULL);
@ -84,7 +82,6 @@ EFL_START_TEST(eina_inarray_test_simple)
} }
eina_inarray_free(array); eina_inarray_free(array);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -95,8 +92,6 @@ EFL_START_TEST(eina_inarray_test_alloc_at)
int *member; int *member;
int i; int i;
eina_init();
array = eina_inarray_new(sizeof(int), 2); array = eina_inarray_new(sizeof(int), 2);
fail_unless(array != NULL); fail_unless(array != NULL);
@ -124,7 +119,6 @@ EFL_START_TEST(eina_inarray_test_alloc_at)
fail_unless(member[i] == i); fail_unless(member[i] == i);
eina_inarray_free(array); eina_inarray_free(array);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -174,8 +168,6 @@ EFL_START_TEST(eina_inarray_test_insert_sort)
Eina_Inarray *array; Eina_Inarray *array;
int i, pos; int i, pos;
eina_init();
array = eina_inarray_new(sizeof(short), 1); array = eina_inarray_new(sizeof(short), 1);
fail_unless(array != NULL); fail_unless(array != NULL);
@ -235,7 +227,6 @@ EFL_START_TEST(eina_inarray_test_insert_sort)
eina_inarray_flush(array); eina_inarray_flush(array);
eina_inarray_free(array); eina_inarray_free(array);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -244,8 +235,6 @@ EFL_START_TEST(eina_inarray_test_sort)
Eina_Inarray *array; Eina_Inarray *array;
int i; int i;
eina_init();
array = eina_inarray_new(sizeof(short), 1); array = eina_inarray_new(sizeof(short), 1);
fail_unless(array != NULL); fail_unless(array != NULL);
@ -257,7 +246,6 @@ EFL_START_TEST(eina_inarray_test_sort)
eina_inarray_sort(array, short_cmp); eina_inarray_sort(array, short_cmp);
fail_unless(check_short_sorted(array)); fail_unless(check_short_sorted(array));
eina_inarray_free(array); eina_inarray_free(array);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -266,8 +254,6 @@ EFL_START_TEST(eina_inarray_test_reverse)
Eina_Inarray *array; Eina_Inarray *array;
int i; int i;
eina_init();
array = eina_inarray_new(sizeof(short), 1); array = eina_inarray_new(sizeof(short), 1);
fail_unless(array != NULL); fail_unless(array != NULL);
@ -285,7 +271,6 @@ EFL_START_TEST(eina_inarray_test_reverse)
} }
eina_inarray_free(array); eina_inarray_free(array);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -319,8 +304,6 @@ EFL_START_TEST(eina_inarray_test_itr)
short *member; short *member;
int i; int i;
eina_init();
array = eina_inarray_new(sizeof(short), 1); array = eina_inarray_new(sizeof(short), 1);
fail_unless(array != NULL); fail_unless(array != NULL);
@ -386,7 +369,6 @@ EFL_START_TEST(eina_inarray_test_itr)
eina_accessor_free(ac); eina_accessor_free(ac);
eina_inarray_free(array); eina_inarray_free(array);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -423,8 +405,6 @@ EFL_START_TEST(eina_inarray_test_search)
unsigned int curr_len; unsigned int curr_len;
Eina_Bool rval; Eina_Bool rval;
eina_init();
iarr = eina_inarray_new(sizeof(int), 0); iarr = eina_inarray_new(sizeof(int), 0);
//search in empty array //search in empty array
@ -490,7 +470,6 @@ EFL_START_TEST(eina_inarray_test_search)
fail_if(iarr->len != curr_len-3); fail_if(iarr->len != curr_len-3);
eina_inarray_free(iarr); eina_inarray_free(iarr);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -96,8 +96,6 @@ EFL_START_TEST(eina_inlist_simple)
struct log_ctx ctx; struct log_ctx ctx;
#endif #endif
fail_if(!eina_init());
tmp = _eina_test_inlist_build(42); tmp = _eina_test_inlist_build(42);
lst = eina_inlist_append(lst, EINA_INLIST_GET(tmp)); lst = eina_inlist_append(lst, EINA_INLIST_GET(tmp));
fail_if(!lst); fail_if(!lst);
@ -296,7 +294,6 @@ EFL_START_TEST(eina_inlist_simple)
while (lst) while (lst)
lst = eina_inlist_remove(lst, lst); lst = eina_inlist_remove(lst, lst);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -337,8 +334,6 @@ EFL_START_TEST(eina_inlist_sorted)
Eina_Inlist *sorted = NULL; Eina_Inlist *sorted = NULL;
int i; int i;
fail_if(!eina_init());
srand(time(NULL)); srand(time(NULL));
for (i = 0; i < 2000; ++i) for (i = 0; i < 2000; ++i)
@ -371,7 +366,6 @@ EFL_START_TEST(eina_inlist_sorted)
_eina_test_inlist_check(sorted); _eina_test_inlist_check(sorted);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -382,8 +376,6 @@ EFL_START_TEST(eina_inlist_sorted_state)
Eina_Inlist *list = NULL; Eina_Inlist *list = NULL;
int i; int i;
fail_if(!eina_init());
state = eina_inlist_sorted_state_new(); state = eina_inlist_sorted_state_new();
fail_if(!state); fail_if(!state);
@ -402,7 +394,6 @@ EFL_START_TEST(eina_inlist_sorted_state)
eina_inlist_sorted_state_free(state); eina_inlist_sorted_state_free(state);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -44,8 +44,6 @@ EFL_START_TEST(eina_iterator_filter_simple)
Eina_Iterator *it, *filtered; Eina_Iterator *it, *filtered;
Eina_Array *ea; Eina_Array *ea;
eina_init();
ea = eina_array_new(11); ea = eina_array_new(11);
fail_if(!ea); fail_if(!ea);
@ -85,7 +83,6 @@ EFL_START_TEST(eina_iterator_filter_simple)
eina_array_free(ea); eina_array_free(ea);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -111,7 +108,6 @@ EFL_START_TEST(eina_iterator_filter_free)
Eina_Iterator *it, *filtered; Eina_Iterator *it, *filtered;
Eina_Array *ea; Eina_Array *ea;
struct Free_test *data; struct Free_test *data;
eina_init();
data = calloc(1, sizeof(struct Free_test)); data = calloc(1, sizeof(struct Free_test));
ea = eina_array_new(11); ea = eina_array_new(11);
@ -127,7 +123,6 @@ EFL_START_TEST(eina_iterator_filter_free)
free(data); free(data);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
static Eina_Bool static Eina_Bool
@ -147,8 +142,6 @@ EFL_START_TEST(eina_iterator_array_simple)
int *tmp; int *tmp;
int i; int i;
eina_init();
ea = eina_array_new(11); ea = eina_array_new(11);
fail_if(!ea); fail_if(!ea);
@ -175,7 +168,6 @@ EFL_START_TEST(eina_iterator_array_simple)
eina_array_free(ea); eina_array_free(ea);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -216,7 +208,6 @@ EFL_START_TEST(eina_iterator_hash_simple)
Eina_Hash *hash; Eina_Hash *hash;
int array[] = { 1, 42, 7, 8, 6 }; int array[] = { 1, 42, 7, 8, 6 };
eina_init();
hash = eina_hash_string_superfast_new(NULL); hash = eina_hash_string_superfast_new(NULL);
fail_if(hash == NULL); fail_if(hash == NULL);
@ -241,7 +232,6 @@ EFL_START_TEST(eina_iterator_hash_simple)
eina_hash_free(hash); eina_hash_free(hash);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -361,7 +351,6 @@ EFL_START_TEST(eina_iterator_list_simple)
int data[] = { 6, 9, 42, 1, 7, 1337, 81, 1664 }; int data[] = { 6, 9, 42, 1, 7, 1337, 81, 1664 };
int i = 0; int i = 0;
eina_init();
list = eina_list_append(list, &data[0]); list = eina_list_append(list, &data[0]);
fail_if(list == NULL); fail_if(list == NULL);
@ -426,7 +415,6 @@ EFL_START_TEST(eina_reverse_iterator_list_simple)
int data[] = { 6, 9, 42, 1, 7, 1337, 81, 1664 }; int data[] = { 6, 9, 42, 1, 7, 1337, 81, 1664 };
int i = 0; int i = 0;
eina_init();
list = eina_list_append(list, &data[0]); list = eina_list_append(list, &data[0]);
fail_if(list == NULL); fail_if(list == NULL);

View File

@ -67,7 +67,6 @@ EFL_START_TEST(eina_test_simple)
int result[] = { 81, 9, 9, 7, 1 }; int result[] = { 81, 9, 9, 7, 1 };
int i; int i;
eina_init();
list = eina_list_append(list, &data[0]); list = eina_list_append(list, &data[0]);
fail_if(list == NULL); fail_if(list == NULL);
@ -215,7 +214,6 @@ EFL_START_TEST(eina_test_simple)
list = eina_list_free(list); list = eina_list_free(list);
fail_if(list != NULL); fail_if(list != NULL);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -229,7 +227,6 @@ EFL_START_TEST(eina_test_merge)
int data[] = { 6, 9, 42, 1, 7, 9, 81, 1664, 1337, 3, 21, 10, 0, 5, 2008 }; int data[] = { 6, 9, 42, 1, 7, 9, 81, 1664, 1337, 3, 21, 10, 0, 5, 2008 };
int i; int i;
eina_init();
l1 = eina_list_append(NULL, &data[0]); l1 = eina_list_append(NULL, &data[0]);
l1 = eina_list_append(l1, &data[1]); l1 = eina_list_append(l1, &data[1]);
@ -300,7 +297,6 @@ EFL_START_TEST(eina_test_merge)
fail_if(!eina_list_sorted_check(l1)); fail_if(!eina_list_sorted_check(l1));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -313,7 +309,6 @@ EFL_START_TEST(eina_test_sorted_insert)
void *d; void *d;
int *res, val = 2009; int *res, val = 2009;
eina_init();
count = sizeof(data) / sizeof(data[0]); count = sizeof(data) / sizeof(data[0]);
@ -356,7 +351,6 @@ EFL_START_TEST(eina_test_sorted_insert)
fail_if(!eina_list_sorted_check(l1)); fail_if(!eina_list_sorted_check(l1));
eina_list_free(l1); eina_list_free(l1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -366,7 +360,6 @@ EFL_START_TEST(eina_test_list_split)
Eina_List *list = NULL; Eina_List *list = NULL;
unsigned int i; unsigned int i;
eina_init();
list = eina_list_append(list, "tigh"); list = eina_list_append(list, "tigh");
list = eina_list_append(list, "adar"); list = eina_list_append(list, "adar");
@ -393,7 +386,6 @@ EFL_START_TEST(eina_test_list_split)
list = eina_list_append(list, "roslin"); list = eina_list_append(list, "roslin");
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -420,7 +412,6 @@ EFL_START_TEST(eina_test_shuffle)
Eina_List *list = NULL; Eina_List *list = NULL;
Eina_List *item = NULL; Eina_List *item = NULL;
eina_init();
for(i = 0; i < SHUFFLE_SZ; i++) for(i = 0; i < SHUFFLE_SZ; i++)
{ {
@ -453,7 +444,6 @@ EFL_START_TEST(eina_test_shuffle)
fail_if(rand_count[i]*d < 0.80f); fail_if(rand_count[i]*d < 0.80f);
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -467,7 +457,6 @@ EFL_START_TEST(eina_test_clone)
Eina_List *clist = NULL; Eina_List *clist = NULL;
Eina_List *rclist = NULL; Eina_List *rclist = NULL;
eina_init();
for(i = 0; i < DATA_SIZE; i++) for(i = 0; i < DATA_SIZE; i++)
{ {
@ -502,7 +491,6 @@ EFL_START_TEST(eina_test_clone)
rclist = eina_list_free(rclist); rclist = eina_list_free(rclist);
fail_if(rclist != NULL); fail_if(rclist != NULL);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -514,7 +502,6 @@ EFL_START_TEST(eina_test_move)
int data2[] = {6, 7, 8, 9, 10}; int data2[] = {6, 7, 8, 9, 10};
int i, *list_data; int i, *list_data;
eina_init();
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
{ {
@ -542,7 +529,6 @@ EFL_START_TEST(eina_test_move)
eina_list_free(list1); eina_list_free(list1);
eina_list_free(list2); eina_list_free(list2);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -85,7 +85,6 @@ EFL_START_TEST(eina_test_spinlock)
{ {
unsigned int i; unsigned int i;
fail_if(!eina_init());
counter = 0; counter = 0;
fail_if(!eina_spinlock_new(&spin)); fail_if(!eina_spinlock_new(&spin));
@ -108,7 +107,6 @@ EFL_START_TEST(eina_test_spinlock)
eina_spinlock_free(&spin); eina_spinlock_free(&spin);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -150,7 +148,6 @@ _eina_test_tls_thread(void *data EINA_UNUSED, Eina_Thread t EINA_UNUSED)
EFL_START_TEST(eina_test_tls) EFL_START_TEST(eina_test_tls)
{ {
fail_if(!eina_init());
fail_if(!eina_tls_cb_new(&key, _eina_test_tls_free)); fail_if(!eina_tls_cb_new(&key, _eina_test_tls_free));
@ -167,7 +164,6 @@ EFL_START_TEST(eina_test_tls)
eina_tls_free(key); eina_tls_free(key);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -202,7 +198,6 @@ EFL_START_TEST(eina_test_rwlock)
struct timespec ts, ts2; struct timespec ts, ts2;
long delay; long delay;
fail_if(!eina_init());
fail_if(!eina_rwlock_new(&mutex)); fail_if(!eina_rwlock_new(&mutex));
fail_if(!eina_lock_new(&mtcond)); fail_if(!eina_lock_new(&mtcond));
@ -251,7 +246,6 @@ EFL_START_TEST(eina_test_rwlock)
eina_lock_free(&mtcond); eina_lock_free(&mtcond);
eina_rwlock_free(&mutex); eina_rwlock_free(&mutex);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -105,7 +105,6 @@ EFL_START_TEST(eina_log_macro)
int oldlevel; int oldlevel;
int maxlevel; int maxlevel;
fail_if(!eina_init());
oldlevel = eina_log_level_get(); oldlevel = eina_log_level_get();
eina_log_level_set(EINA_LOG_LEVEL_DBG); eina_log_level_set(EINA_LOG_LEVEL_DBG);
@ -164,7 +163,6 @@ EFL_START_TEST(eina_log_macro)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
eina_log_level_set(oldlevel); eina_log_level_set(oldlevel);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -174,7 +172,6 @@ EFL_START_TEST(eina_log_domains_macros)
int oldlevel; int oldlevel;
int maxlevel; int maxlevel;
fail_if(!eina_init());
/* make global log level blocker */ /* make global log level blocker */
oldlevel = eina_log_level_get(); oldlevel = eina_log_level_get();
@ -241,13 +238,11 @@ EFL_START_TEST(eina_log_domains_macros)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
eina_log_level_set(oldlevel); eina_log_level_set(oldlevel);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_log_domains_registry) EFL_START_TEST(eina_log_domains_registry)
{ {
fail_if(!eina_init());
int i; int i;
int d[50]; int d[50];
@ -261,13 +256,11 @@ EFL_START_TEST(eina_log_domains_registry)
for (i = 0; i < 50; i++) for (i = 0; i < 50; i++)
eina_log_domain_unregister(d[i]); eina_log_domain_unregister(d[i]);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_log_domains_slot_reuse) EFL_START_TEST(eina_log_domains_slot_reuse)
{ {
fail_if(!eina_init());
fail_if(!eina_threads_init()); fail_if(!eina_threads_init());
// Create 9 domains // Create 9 domains
@ -298,7 +291,6 @@ EFL_START_TEST(eina_log_domains_slot_reuse)
fail_if(new != removed); fail_if(new != removed);
eina_threads_shutdown(); eina_threads_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -307,8 +299,6 @@ EFL_START_TEST(eina_log_level_indexes)
struct log_ctx ctx; struct log_ctx ctx;
int maxlevel; int maxlevel;
fail_if(!eina_init());
fail_if(!eina_threads_init());
fail_if(!eina_threads_init()); fail_if(!eina_threads_init());
int d = eina_log_domain_register("Levels", EINA_COLOR_GREEN); int d = eina_log_domain_register("Levels", EINA_COLOR_GREEN);
@ -369,8 +359,6 @@ EFL_START_TEST(eina_log_level_indexes)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
eina_threads_shutdown(); eina_threads_shutdown();
eina_threads_shutdown();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -382,7 +370,6 @@ EFL_START_TEST(eina_log_customize)
/* please don't define EINA_LOG_LEVELS for it */ /* please don't define EINA_LOG_LEVELS for it */
#define TEST_DOM "_Test_Log_Dom" #define TEST_DOM "_Test_Log_Dom"
fail_if(!eina_init());
#define test_set_get(func, val) \ #define test_set_get(func, val) \
eina_log_ ## func ## _set(val); \ eina_log_ ## func ## _set(val); \
@ -444,7 +431,6 @@ EFL_START_TEST(eina_log_customize)
#undef test_set_get_bool #undef test_set_get_bool
#undef test_set_get #undef test_set_get
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -452,7 +438,6 @@ EFL_START_TEST(eina_log_level_name)
{ {
char name[4]; char name[4];
fail_if(!eina_init());
#define tst(level, str) \ #define tst(level, str) \
eina_log_level_name_get(level, name); \ eina_log_level_name_get(level, name); \
@ -471,7 +456,6 @@ EFL_START_TEST(eina_log_level_name)
#undef tst #undef tst
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -109,7 +109,6 @@ EFL_START_TEST(eina_magic_simple)
Eina_Magic_Struct *ems = NULL; Eina_Magic_Struct *ems = NULL;
struct log_ctx ctx; struct log_ctx ctx;
eina_init();
eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx);
@ -189,7 +188,6 @@ EFL_START_TEST(eina_magic_simple)
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -28,30 +28,21 @@
EFL_START_TEST(eina_simple) EFL_START_TEST(eina_simple)
{ {
fail_if(eina_init() != 2); /* one init by test suite */
fail_if(eina_shutdown() != 1);
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_cpu) EFL_START_TEST(eina_cpu)
{ {
fail_if(eina_init() != 2); /* one init by test suite */
fail_if(eina_cpu_count() <= 0); fail_if(eina_cpu_count() <= 0);
eina_cpu_features_get(); eina_cpu_features_get();
fail_if(eina_shutdown() != 1);
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_hamster) EFL_START_TEST(eina_hamster)
{ {
fail_if(eina_init() != 2); /* one init by test suite */
fail_if(eina_hamster_count() <= 0); fail_if(eina_hamster_count() <= 0);
fail_if(eina_shutdown() != 1);
} }
EFL_END_TEST EFL_END_TEST

View File

@ -35,7 +35,6 @@ EFL_START_TEST(eina_matrix2)
Eina_Matrix2 n; Eina_Matrix2 n;
double xx, xy, yx, yy; double xx, xy, yx, yy;
eina_init();
eina_matrix2_values_set(&m, eina_matrix2_values_set(&m,
1, 0, 1, 0,
@ -54,7 +53,6 @@ EFL_START_TEST(eina_matrix2)
fail_if(!EINA_DBL_EQ(xy, yx) || fail_if(!EINA_DBL_EQ(xy, yx) ||
!EINA_DBL_EQ(xy, 0)); !EINA_DBL_EQ(xy, 0));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -130,7 +128,6 @@ EFL_START_TEST(eina_matrix4)
zx, zy, zz, zw, zx, zy, zz, zw,
wx, wy, wz, ww; wx, wy, wz, ww;
eina_init();
eina_matrix4_values_set(&m, eina_matrix4_values_set(&m,
1, 0, 0, 0, 1, 0, 0, 0,
@ -192,7 +189,6 @@ EFL_START_TEST(eina_matrix4)
!EINA_DBL_EQ(n.wz, 12) || !EINA_DBL_EQ(n.wz, 12) ||
!EINA_DBL_EQ(n.ww, 16)); !EINA_DBL_EQ(n.ww, 16));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -323,7 +319,6 @@ EFL_START_TEST(eina_matrix4_2_3)
Eina_Matrix4 m4; Eina_Matrix4 m4;
Eina_Matrix3 m3, m3b; Eina_Matrix3 m3, m3b;
eina_init();
eina_matrix3_values_set(&m3, eina_matrix3_values_set(&m3,
1, 3, 2, 1, 3, 2,
@ -335,7 +330,6 @@ EFL_START_TEST(eina_matrix4_2_3)
fail_if(memcmp(&m3, &m3b, sizeof (Eina_Matrix3)) != 0); fail_if(memcmp(&m3, &m3b, sizeof (Eina_Matrix3)) != 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -347,7 +341,6 @@ EFL_START_TEST(eina_matrix3)
yx, yy, yz, yx, yy, yz,
zx, zy, zz; zx, zy, zz;
eina_init();
eina_matrix3_values_set(&m, eina_matrix3_values_set(&m,
1, 0, 0, 1, 0, 0,
@ -385,7 +378,6 @@ EFL_START_TEST(eina_matrix3)
ret = eina_matrix3_equal(&m1, &m2); ret = eina_matrix3_equal(&m1, &m2);
fail_if(ret != EINA_FALSE); fail_if(ret != EINA_FALSE);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -664,7 +656,6 @@ EFL_START_TEST(eina_matrix3_f16p16)
zx, zy, zz; zx, zy, zz;
Eina_Matrix3_F16p16 m3; Eina_Matrix3_F16p16 m3;
eina_init();
eina_matrix3_values_set(&m2, eina_matrix3_values_set(&m2,
1, 0, 0, 1, 0, 0,
@ -715,7 +706,6 @@ EFL_START_TEST(eina_matrix3_f16p16)
m3.zy != m3.zz || m3.zy != m3.zz ||
m3.zz != 196608); m3.zz != 196608);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -727,7 +717,6 @@ EFL_START_TEST(eina_matrix3_map_transform)
Eina_Quad q; Eina_Quad q;
Eina_Bool ret; Eina_Bool ret;
eina_init();
eina_matrix3_values_set(&m, eina_matrix3_values_set(&m,
0, 1, 0, 0, 1, 0,
@ -779,7 +768,6 @@ EFL_START_TEST(eina_matrix3_map_transform)
!EINA_DBL_EQ(q.x3, 0) || !EINA_DBL_EQ(q.x3, 0) ||
!EINA_DBL_EQ(q.y3, 3)); !EINA_DBL_EQ(q.y3, 3));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -791,7 +779,6 @@ EFL_START_TEST(eina_normal3_test)
yx, yy, yz, yx, yy, yz,
zx, zy, zz; zx, zy, zz;
eina_init();
eina_matrix4_values_set(&m, eina_matrix4_values_set(&m,
1, 0, 0, 0, 1, 0, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0,
@ -826,7 +813,6 @@ EFL_START_TEST(eina_normal3_test)
(fabs(yz)) > DBL_EPSILON || (fabs(yz)) > DBL_EPSILON ||
(fabs(zy)) > DBL_EPSILON (fabs(zy)) > DBL_EPSILON
); );
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -105,7 +105,6 @@ EFL_START_TEST(eina_test_simple)
value3 = -3; value3 = -3;
value4 = -4; value4 = -4;
eina_init();
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS, matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data); eina_matrixsparse_free_cell_cb, data);
@ -266,7 +265,6 @@ EFL_START_TEST(eina_test_simple)
matrixsparse_check(matrix, data, MAX_ROWS, MAX_COLS); matrixsparse_check(matrix, data, MAX_ROWS, MAX_COLS);
eina_matrixsparse_free(matrix); eina_matrixsparse_free(matrix);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -283,7 +281,6 @@ EFL_START_TEST(eina_test_resize)
for (j = 0; j < MAX_COLS; j++) for (j = 0; j < MAX_COLS; j++)
data[i][j] = 0; data[i][j] = 0;
eina_init();
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS, matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data); eina_matrixsparse_free_cell_cb, data);
@ -378,7 +375,6 @@ EFL_START_TEST(eina_test_resize)
eina_matrixsparse_free(matrix); eina_matrixsparse_free(matrix);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -405,7 +401,6 @@ EFL_START_TEST(eina_test_iterators)
printf("\n"); printf("\n");
} }
eina_init();
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS, matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data); eina_matrixsparse_free_cell_cb, data);
@ -477,7 +472,6 @@ EFL_START_TEST(eina_test_iterators)
eina_matrixsparse_free(matrix); eina_matrixsparse_free(matrix);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -52,9 +52,8 @@ EFL_START_TEST(eina_module_load_unload)
Eina_Array_Iterator it; Eina_Array_Iterator it;
Eina_Module *module; Eina_Module *module;
eina_init();
_modules = eina_module_list_get(NULL, _modules = eina_module_list_get(NULL,
PACKAGE_BUILD_DIR "/src/tests/", PACKAGE_BUILD_DIR "/src/tests/eina",
EINA_TRUE, EINA_TRUE,
&list_cb, &list_cb,
NULL); NULL);
@ -65,7 +64,6 @@ EFL_START_TEST(eina_module_load_unload)
EINA_ARRAY_ITER_NEXT(_modules, i, module, it) EINA_ARRAY_ITER_NEXT(_modules, i, module, it)
free(module); free(module);
eina_array_free(_modules); eina_array_free(_modules);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -73,15 +71,13 @@ EFL_START_TEST(eina_module_find_test)
{ {
Eina_Array *_modules; Eina_Array *_modules;
eina_init();
_modules = eina_module_list_get(NULL, _modules = eina_module_list_get(NULL,
PACKAGE_BUILD_DIR "/src/tests/", PACKAGE_BUILD_DIR "/src/tests/eina",
EINA_TRUE, EINA_TRUE,
&list_cb, &list_cb,
NULL); NULL);
fail_if(!_modules); fail_if(!_modules);
fail_if(eina_module_find(_modules, NULL) != NULL); fail_if(eina_module_find(_modules, NULL) != NULL);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -16,7 +16,6 @@ EFL_START_TEST(eina_quad_simple)
double x0, x1, x2, x3; double x0, x1, x2, x3;
double y0, y1, y2, y3; double y0, y1, y2, y3;
fail_if(!eina_init());
eina_quad_coords_set(&r2, eina_quad_coords_set(&r2,
0.0, 5.0, 0.0, 5.0,
@ -66,7 +65,6 @@ EFL_START_TEST(eina_quad_simple)
!EINA_FLT_EQ(r2.x3, 5.0) || !EINA_FLT_EQ(r2.x3, 5.0) ||
!EINA_FLT_EQ(r2.y3, 40.0)); !EINA_FLT_EQ(r2.y3, 40.0));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -94,7 +94,6 @@ EFL_START_TEST(eina_quadtree_collision)
int count; int count;
int i; int i;
fail_if(!eina_init());
q = eina_quadtree_new(640, 480, q = eina_quadtree_new(640, 480,
_eina_quadtree_rectangle_vert, _eina_quadtree_rectangle_vert,
@ -185,7 +184,6 @@ EFL_START_TEST(eina_quadtree_collision)
eina_quadtree_free(q); eina_quadtree_free(q);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -97,11 +97,9 @@ EFL_START_TEST(eina_test_quaternion_norm)
static const Eina_Quaternion q = { 1, 3, 4, 5 }; static const Eina_Quaternion q = { 1, 3, 4, 5 };
double result = eina_quaternion_norm(&q); double result = eina_quaternion_norm(&q);
eina_init();
fail_if(!EINA_FLT_EQ(result, sqrt(51))); fail_if(!EINA_FLT_EQ(result, sqrt(51)));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -111,7 +109,6 @@ EFL_START_TEST(eina_test_quaternion_conjugate)
static const Eina_Quaternion r1 = { -1, 1, 1, 3 }, r2 = { -1, -3, -4, 3 }; static const Eina_Quaternion r1 = { -1, 1, 1, 3 }, r2 = { -1, -3, -4, 3 };
Eina_Quaternion t1, t2; Eina_Quaternion t1, t2;
eina_init();
eina_quaternion_conjugate(&t1, &q1); eina_quaternion_conjugate(&t1, &q1);
eina_quaternion_conjugate(&t2, &q2); eina_quaternion_conjugate(&t2, &q2);
@ -119,7 +116,6 @@ EFL_START_TEST(eina_test_quaternion_conjugate)
fail_if(!eina_quaternion_cmp(&t1, &r1)); fail_if(!eina_quaternion_cmp(&t1, &r1));
fail_if(!eina_quaternion_cmp(&t2, &r2)); fail_if(!eina_quaternion_cmp(&t2, &r2));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -135,7 +131,6 @@ EFL_START_TEST(eina_test_quaternion_matrix)
}; };
Eina_Matrix3 tm; Eina_Matrix3 tm;
eina_init();
eina_quaternion_rotation_matrix3_get(&tm, &q); eina_quaternion_rotation_matrix3_get(&tm, &q);
fail_if(!eina_matrix3_cmp(&tm, &m)); fail_if(!eina_matrix3_cmp(&tm, &m));
@ -143,7 +138,6 @@ EFL_START_TEST(eina_test_quaternion_matrix)
eina_matrix3_quaternion_get(&tq, &m); eina_matrix3_quaternion_get(&tq, &m);
fail_if(!eina_quaternion_cmp(&tq, &q) && !eina_quaternion_cmp(&tq, &q1)); fail_if(!eina_quaternion_cmp(&tq, &q) && !eina_quaternion_cmp(&tq, &q1));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -153,14 +147,12 @@ EFL_START_TEST(eina_test_quaternion_op)
Eina_Quaternion z = { 0, 0, 0, 0 }; Eina_Quaternion z = { 0, 0, 0, 0 };
Eina_Quaternion neg, r; Eina_Quaternion neg, r;
eina_init();
eina_quaternion_negative(&neg, &q); eina_quaternion_negative(&neg, &q);
eina_quaternion_add(&r, &q, &neg); eina_quaternion_add(&r, &q, &neg);
fail_if(!eina_quaternion_cmp(&z, &r)); fail_if(!eina_quaternion_cmp(&z, &r));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -173,7 +165,6 @@ EFL_START_TEST(eina_test_quaternion_f16p16)
Eina_Quaternion_F16p16 t, s, r = {65536, 65536, 65536, 65536}; Eina_Quaternion_F16p16 t, s, r = {65536, 65536, 65536, 65536};
eina_init();
eina_quaternion_f16p16_set(&p, x, y, z, w); eina_quaternion_f16p16_set(&p, x, y, z, w);
fail_if(!eina_quaternion_cmp(&p, &q)); fail_if(!eina_quaternion_cmp(&p, &q));
@ -227,12 +218,10 @@ EFL_START_TEST(eina_test_quaternion_dot)
Eina_Quaternion r = {7, 9, 5, 1}; Eina_Quaternion r = {7, 9, 5, 1};
double res; double res;
eina_init();
res = eina_quaternion_dot(&q, &r); res = eina_quaternion_dot(&q, &r);
fail_if(res != 59); fail_if(res != 59);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -242,12 +231,10 @@ EFL_START_TEST(eina_test_quaternion_scale)
double scale = 2; double scale = 2;
Eina_Quaternion r, res = {2, 6, 8, 10}; Eina_Quaternion r, res = {2, 6, 8, 10};
eina_init();
eina_quaternion_scale(&r, &q, scale); eina_quaternion_scale(&r, &q, scale);
fail_if(!eina_quaternion_cmp(&r, &res)); fail_if(!eina_quaternion_cmp(&r, &res));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -255,13 +242,11 @@ EFL_START_TEST(eina_test_quaternion_set)
{ {
Eina_Quaternion q, r = {1, 3, 4, 5}; Eina_Quaternion q, r = {1, 3, 4, 5};
eina_init();
eina_quaternion_set(&q, 1, 3, 4, 5); eina_quaternion_set(&q, 1, 3, 4, 5);
fail_if(!eina_quaternion_cmp(&q, &r)); fail_if(!eina_quaternion_cmp(&q, &r));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -271,12 +256,10 @@ EFL_START_TEST(eina_test_quaternion_mul)
Eina_Quaternion q = {7, 9, 5, 1}; Eina_Quaternion q = {7, 9, 5, 1};
Eina_Quaternion r, res = {15, 71, 17, -49}; Eina_Quaternion r, res = {15, 71, 17, -49};
eina_init();
eina_quaternion_mul(&r, &p, &q); eina_quaternion_mul(&r, &p, &q);
fail_if(!eina_quaternion_cmp(&r, &res)); fail_if(!eina_quaternion_cmp(&r, &res));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -289,7 +272,6 @@ EFL_START_TEST(eina_test_matrix_recompose)
const Eina_Quaternion rotation = { 0, 0, 0, 1 }; const Eina_Quaternion rotation = { 0, 0, 0, 1 };
Eina_Matrix4 m4; Eina_Matrix4 m4;
eina_init();
eina_quaternion_matrix4_to(&m4, eina_quaternion_matrix4_to(&m4,
&rotation, &rotation,
@ -300,7 +282,6 @@ EFL_START_TEST(eina_test_matrix_recompose)
fail_if(eina_matrix4_type_get(&m4) != EINA_MATRIX_TYPE_IDENTITY); fail_if(eina_matrix4_type_get(&m4) != EINA_MATRIX_TYPE_IDENTITY);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -309,12 +290,10 @@ EFL_START_TEST(eina_test_quaternion_normalized)
Eina_Quaternion p = {1, 1, 1, 1}; Eina_Quaternion p = {1, 1, 1, 1};
Eina_Quaternion res, q = {0.5, 0.5, 0.5, 0.5}; Eina_Quaternion res, q = {0.5, 0.5, 0.5, 0.5};
eina_init();
eina_quaternion_normalized(&res, &p); eina_quaternion_normalized(&res, &p);
fail_if(!eina_quaternion_cmp(&q, &res)); fail_if(!eina_quaternion_cmp(&q, &res));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -330,7 +309,6 @@ EFL_START_TEST(eina_test_matrix_quaternion)
Eina_Matrix4 m4, m4r; Eina_Matrix4 m4, m4r;
Eina_Point_3D translation, scale, skew; Eina_Point_3D translation, scale, skew;
eina_init();
eina_matrix3_identity(&m3); eina_matrix3_identity(&m3);
eina_matrix3_rotate(&m3, 3.14159265); eina_matrix3_rotate(&m3, 3.14159265);
@ -362,7 +340,6 @@ EFL_START_TEST(eina_test_matrix_quaternion)
// Disable this test for the moment as it seems a rounding issue // Disable this test for the moment as it seems a rounding issue
// fail_if(!eina_matrix3_cmp(&m3r, &m3)); // fail_if(!eina_matrix3_cmp(&m3r, &m3));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif
@ -374,7 +351,6 @@ EFL_START_TEST(eina_test_quaternion_f16p16_lerp)
Eina_Quaternion_F16p16 res1 = {65536, 65536, 65536, 0}; Eina_Quaternion_F16p16 res1 = {65536, 65536, 65536, 0};
Eina_Quaternion_F16p16 res2 = {0, 0, 0, 0}; Eina_Quaternion_F16p16 res2 = {0, 0, 0, 0};
eina_init();
eina_quaternion_f16p16_lerp(&r, &p, &q, 65536); eina_quaternion_f16p16_lerp(&r, &p, &q, 65536);
fail_if(!eina_quaternion_f16p16_cmp(&r, &res1)); fail_if(!eina_quaternion_f16p16_cmp(&r, &res1));
@ -391,7 +367,6 @@ EFL_START_TEST(eina_test_quaternion_f16p16_lerp)
eina_quaternion_f16p16_nlerp(&r, &p, &q, 65536); eina_quaternion_f16p16_nlerp(&r, &p, &q, 65536);
fail_if(!eina_quaternion_f16p16_cmp(&r, &res1)); fail_if(!eina_quaternion_f16p16_cmp(&r, &res1));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -401,7 +376,6 @@ EFL_START_TEST(eina_test_quaternion_lerp)
Eina_Quaternion rq = {1, 0, 0, 0}; Eina_Quaternion rq = {1, 0, 0, 0};
Eina_Quaternion rr, res = {0.5, 0.0, 0.5, 0.0}; Eina_Quaternion rr, res = {0.5, 0.0, 0.5, 0.0};
eina_init();
eina_quaternion_lerp(&rr, &rp, &rq, 0.5); eina_quaternion_lerp(&rr, &rp, &rq, 0.5);
fail_if(!eina_quaternion_cmp(&rr, &res)); fail_if(!eina_quaternion_cmp(&rr, &res));
@ -427,7 +401,6 @@ EFL_START_TEST(eina_test_quaternion_lerp)
eina_quaternion_nlerp(&rr, &rp, &rq, 1.0); eina_quaternion_nlerp(&rr, &rp, &rq, 1.0);
fail_if(!eina_quaternion_cmp(&rr, &res)); fail_if(!eina_quaternion_cmp(&rr, &res));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -440,7 +413,6 @@ EFL_START_TEST(eina_test_quaternion_f16p16_rotate_matrix)
131072, -262144, 131072, 131072, -262144, 131072,
131072, 131072, -262144 }; 131072, 131072, -262144 };
eina_init();
eina_quaternion_f16p16_rotate(&r, &c, &q); eina_quaternion_f16p16_rotate(&r, &c, &q);
fail_if(r.x != res.x || fail_if(r.x != res.x ||
@ -450,7 +422,6 @@ EFL_START_TEST(eina_test_quaternion_f16p16_rotate_matrix)
eina_quaternion_f16p16_rotation_matrix3_get(&m, &q); eina_quaternion_f16p16_rotation_matrix3_get(&m, &q);
fail_if(!eina_matrix3_f16p16_cmp(&m, &mres)); fail_if(!eina_matrix3_f16p16_cmp(&m, &mres));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -461,7 +432,6 @@ EFL_START_TEST(eina_test_quaternion_rotate)
Eina_Point_3D res1 = {3.0, 3.0, -9.0}; Eina_Point_3D res1 = {3.0, 3.0, -9.0};
Eina_Quaternion q = {1, 1, 1, 0}; Eina_Quaternion q = {1, 1, 1, 0};
eina_init();
eina_quaternion_rotate(&r, &c, &q); eina_quaternion_rotate(&r, &c, &q);
fail_if(!eina_point_3d_cmp(&r, &res)); fail_if(!eina_point_3d_cmp(&r, &res));
@ -470,7 +440,6 @@ EFL_START_TEST(eina_test_quaternion_rotate)
eina_quaternion_rotate(&r, &c, &q); eina_quaternion_rotate(&r, &c, &q);
fail_if(!eina_point_3d_cmp(&r, &res1)); fail_if(!eina_point_3d_cmp(&r, &res1));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -482,7 +451,6 @@ EFL_START_TEST(eina_test_quaternion_operations)
const double v[] = {0, 1, 2, 3}; const double v[] = {0, 1, 2, 3};
double angle; double angle;
Eina_Matrix4 m; Eina_Matrix4 m;
eina_init();
eina_quaternion_inverse(&out, &in); eina_quaternion_inverse(&out, &in);
fail_if((out.x + 0.2 > DBL_EPSILON) || (out.y + 0.2 > DBL_EPSILON) || fail_if((out.x + 0.2 > DBL_EPSILON) || (out.y + 0.2 > DBL_EPSILON) ||
@ -535,7 +503,6 @@ EFL_START_TEST(eina_test_quaternion_operations)
(fabs(out.z) - 1.0) > DBL_EPSILON || (fabs(out.z) - 1.0) > DBL_EPSILON ||
(fabs(out.w) - 1.0) > DBL_EPSILON (fabs(out.w) - 1.0) > DBL_EPSILON
); );
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -368,7 +368,6 @@ EFL_START_TEST(eina_rbtree_remove)
Eina_Array_Iterator it; Eina_Array_Iterator it;
unsigned int i; unsigned int i;
eina_init();
ea = eina_array_new(11); ea = eina_array_new(11);
fail_if(!ea); fail_if(!ea);
@ -403,7 +402,6 @@ EFL_START_TEST(eina_rbtree_remove)
fail_if(root != NULL); fail_if(root != NULL);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -622,7 +620,6 @@ EFL_START_TEST(eina_rbtree_fuzzy)
unsigned int i; unsigned int i;
unsigned int j; unsigned int j;
eina_init();
for (i = 0; i < 10000; i++) for (i = 0; i < 10000; i++)
@ -672,7 +669,6 @@ EFL_START_TEST(eina_rbtree_fuzzy)
} }
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -35,7 +35,6 @@ EFL_START_TEST(eina_rectangle_pool)
int w; int w;
int h; int h;
fail_if(!eina_init());
pool = eina_rectangle_pool_new(256, 256); pool = eina_rectangle_pool_new(256, 256);
fail_if(pool == NULL); fail_if(pool == NULL);
@ -69,7 +68,6 @@ EFL_START_TEST(eina_rectangle_pool)
eina_rectangle_pool_free(pool); eina_rectangle_pool_free(pool);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -82,7 +80,6 @@ EFL_START_TEST(eina_rectangle_pool_skyline)
int w; int w;
int h; int h;
fail_if(!eina_init());
pool = eina_rectangle_pool_new(256, 256); pool = eina_rectangle_pool_new(256, 256);
fail_if(pool == NULL); fail_if(pool == NULL);
@ -116,7 +113,6 @@ EFL_START_TEST(eina_rectangle_pool_skyline)
eina_rectangle_pool_free(pool); eina_rectangle_pool_free(pool);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -124,7 +120,6 @@ EFL_START_TEST(eina_rectangle_union_intersect)
{ {
Eina_Rectangle r1, r2, r3, r4, r5, r6, r7, r8, rd; Eina_Rectangle r1, r2, r3, r4, r5, r6, r7, r8, rd;
fail_if(!eina_init());
EINA_RECTANGLE_SET(&r1, 10, 10, 50, 50); EINA_RECTANGLE_SET(&r1, 10, 10, 50, 50);
EINA_RECTANGLE_SET(&r2, 20, 20, 20, 20); EINA_RECTANGLE_SET(&r2, 20, 20, 20, 20);
@ -192,7 +187,6 @@ EFL_START_TEST(eina_rectangle_union_intersect)
|| rd.w != 20 || rd.w != 20
|| rd.h != 20); || rd.h != 20);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -34,7 +34,6 @@ EFL_START_TEST(eina_test_reusable)
{ {
unsigned int i; unsigned int i;
eina_init();
for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++) for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
{ {
@ -68,7 +67,6 @@ EFL_START_TEST(eina_test_reusable)
} }
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -116,7 +114,6 @@ EFL_START_TEST(eina_test_threading)
Eina_Thread t1, t2; Eina_Thread t1, t2;
unsigned int i; unsigned int i;
eina_init();
// We need a barrier so that both thread are more likely // We need a barrier so that both thread are more likely
// to start running in parallel // to start running in parallel
@ -147,7 +144,6 @@ EFL_START_TEST(eina_test_threading)
} }
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -155,7 +151,6 @@ EFL_START_TEST(eina_test_lowestbit)
{ {
unsigned int i; unsigned int i;
eina_init();
for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++) for (i = 0; i < sizeof (test_array) / sizeof (test_array[0]); i++)
{ {
@ -175,7 +170,6 @@ EFL_START_TEST(eina_test_lowestbit)
fail_if(eina_safepointer_get(pointers[i]) != NULL); fail_if(eina_safepointer_get(pointers[i]) != NULL);
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -59,7 +59,6 @@ EFL_START_TEST(eina_test_sched_prio_drop)
Eina_Thread tid; Eina_Thread tid;
Eina_Bool r; Eina_Bool r;
eina_init();
r = eina_thread_create(&tid, EINA_THREAD_NORMAL, -1, _thread_run, NULL); r = eina_thread_create(&tid, EINA_THREAD_NORMAL, -1, _thread_run, NULL);
fail_unless(r); fail_unless(r);
@ -72,7 +71,6 @@ EFL_START_TEST(eina_test_sched_prio_drop)
/* niceness of main thread should not have changed */ /* niceness of main thread should not have changed */
ck_assert_int_eq(niceval2, niceval); ck_assert_int_eq(niceval2, niceval);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#else #else

View File

@ -53,7 +53,6 @@ EFL_START_TEST(eina_simple_xml_parser_node_dump)
{ {
FILE *f; FILE *f;
eina_init();
f = fopen(get_file_full_path("sample.gpx"), "rb"); f = fopen(get_file_full_path("sample.gpx"), "rb");
if (f) if (f)
{ {
@ -86,24 +85,20 @@ EFL_START_TEST(eina_simple_xml_parser_node_dump)
fclose(f); fclose(f);
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_simple_xml_parser_null_node_dump) EFL_START_TEST(eina_simple_xml_parser_null_node_dump)
{ {
eina_init();
char *out = eina_simple_xml_node_dump(NULL, " "); char *out = eina_simple_xml_node_dump(NULL, " ");
fail_if(out != NULL); fail_if(out != NULL);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_simple_xml_parser_childs_count) EFL_START_TEST(eina_simple_xml_parser_childs_count)
{ {
eina_init();
const char *buf = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n" const char *buf = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n"
"<test version=\"0.1\"><child>I'm a child.</child><child><![CDATA[I'm a 2-nd child.]]></child><!-- Some comment --></test>"; "<test version=\"0.1\"><child>I'm a child.</child><child><![CDATA[I'm a 2-nd child.]]></child><!-- Some comment --></test>";
@ -114,7 +109,6 @@ EFL_START_TEST(eina_simple_xml_parser_childs_count)
fail_if(eina_inlist_count(root->children) != 2); fail_if(eina_inlist_count(root->children) != 2);
eina_simple_xml_node_root_free(root); eina_simple_xml_node_root_free(root);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -225,7 +219,6 @@ EFL_START_TEST(eina_simple_xml_parser_parse_with_custom_callback)
{ {
FILE *f; FILE *f;
eina_init();
f = fopen(get_file_full_path("sample.gpx"), "rb"); f = fopen(get_file_full_path("sample.gpx"), "rb");
if (f) if (f)
@ -261,7 +254,6 @@ EFL_START_TEST(eina_simple_xml_parser_parse_with_custom_callback)
fclose(f); fclose(f);
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -34,7 +34,6 @@ EFL_START_TEST(eina_test_slice_init)
Eina_Rw_Slice c = EINA_SLICE_STR("hi there"); Eina_Rw_Slice c = EINA_SLICE_STR("hi there");
EINA_RW_SLICE_DECLARE(d, 512); EINA_RW_SLICE_DECLARE(d, 512);
eina_init();
fail_unless(a.len == sizeof("hello world") - 1); fail_unless(a.len == sizeof("hello world") - 1);
fail_unless(strcmp(a.mem, "hello world") == 0); fail_unless(strcmp(a.mem, "hello world") == 0);
@ -46,7 +45,6 @@ EFL_START_TEST(eina_test_slice_init)
fail_unless(d.len == 512); fail_unless(d.len == 512);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -19,12 +19,10 @@ EFL_START_TEST(slstr_copy)
{ {
Eina_Slstr *str; Eina_Slstr *str;
eina_init();
str = _slstr_copy(); str = _slstr_copy();
ck_assert_str_eq(str, "Hello world 1"); ck_assert_str_eq(str, "Hello world 1");
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -40,12 +38,10 @@ EFL_START_TEST(slstr_steal)
{ {
Eina_Slstr *str; Eina_Slstr *str;
eina_init();
str = _slstr_steal(); str = _slstr_steal();
ck_assert_str_eq(str, "Hello world 2"); ck_assert_str_eq(str, "Hello world 2");
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -62,13 +58,11 @@ EFL_START_TEST(slstr_stringshare)
Eina_Stringshare *ss; Eina_Stringshare *ss;
Eina_Slstr *str; Eina_Slstr *str;
eina_init();
str = _slstr_stringshare(); str = _slstr_stringshare();
ss = eina_stringshare_add("Hello world 3"); ss = eina_stringshare_add("Hello world 3");
fail_if(ss != str); fail_if(ss != str);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -84,12 +78,10 @@ EFL_START_TEST(slstr_tmpstr)
{ {
Eina_Slstr *str; Eina_Slstr *str;
eina_init();
str = _slstr_tmpstr(); str = _slstr_tmpstr();
ck_assert_str_eq(str, "Hello world 4"); ck_assert_str_eq(str, "Hello world 4");
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -109,12 +101,10 @@ EFL_START_TEST(slstr_strbuf)
{ {
Eina_Slstr *str; Eina_Slstr *str;
eina_init();
str = _slstr_strbuf(); str = _slstr_strbuf();
ck_assert_str_eq(str, "Hello world 5"); ck_assert_str_eq(str, "Hello world 5");
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -128,12 +118,10 @@ EFL_START_TEST(slstr_slstr_printf)
{ {
Eina_Slstr *str; Eina_Slstr *str;
eina_init();
str = _slstr_printf(6); str = _slstr_printf(6);
ck_assert_str_eq(str, "Hello world 6"); ck_assert_str_eq(str, "Hello world 6");
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -156,13 +144,11 @@ _many_do(void)
EFL_START_TEST(slstr_many) EFL_START_TEST(slstr_many)
{ {
eina_init();
_many_do(); _many_do();
eina_slstr_local_clear(); eina_slstr_local_clear();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -180,7 +166,6 @@ EFL_START_TEST(slstr_thread)
Eina_Thread th[threads]; Eina_Thread th[threads];
int k; int k;
eina_init();
for (k = 0; k < threads; k++) for (k = 0; k < threads; k++)
fail_if(!eina_thread_create(&th[k], EINA_THREAD_NORMAL, -1, _thread_cb, NULL)); fail_if(!eina_thread_create(&th[k], EINA_THREAD_NORMAL, -1, _thread_cb, NULL));
@ -190,7 +175,6 @@ EFL_START_TEST(slstr_thread)
eina_slstr_local_clear(); eina_slstr_local_clear();
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -32,7 +32,6 @@ EFL_START_TEST(str_simple)
char *str, *ret; char *str, *ret;
const char *escape_ret = "\\ a\\\\x\\'"; const char *escape_ret = "\\ a\\\\x\\'";
eina_init();
fail_if(!eina_str_has_prefix("", "")); fail_if(!eina_str_has_prefix("", ""));
@ -115,7 +114,6 @@ EFL_START_TEST(str_simple)
free(str); free(str);
free(ret); free(ret);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -125,7 +123,6 @@ EFL_START_TEST(str_split)
unsigned int elements; unsigned int elements;
char *str; char *str;
eina_init();
result = eina_str_split_full(NULL, ":", 1, &elements); result = eina_str_split_full(NULL, ":", 1, &elements);
fail_if(result != NULL); fail_if(result != NULL);
@ -248,7 +245,6 @@ EFL_START_TEST(str_split)
free(result[0]); free(result[0]);
free(result); free(result);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -258,7 +254,6 @@ EFL_START_TEST(str_lcat_lcpy)
size_t ret; size_t ret;
size_t ds = (sizeof(dst) / sizeof(char)); size_t ds = (sizeof(dst) / sizeof(char));
eina_init();
dst[0] = '\0'; dst[0] = '\0';
@ -290,7 +285,6 @@ EFL_START_TEST(str_lcat_lcpy)
fail_if(ret != 10); fail_if(ret != 10);
fail_if(strcmp(dst, "copy2cop") != 0); fail_if(strcmp(dst, "copy2cop") != 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -300,7 +294,6 @@ EFL_START_TEST(str_join_len)
size_t ret; size_t ret;
size_t ds = (sizeof(dst) / sizeof(char)); size_t ds = (sizeof(dst) / sizeof(char));
eina_init();
dst[0] = '\0'; dst[0] = '\0';
@ -320,7 +313,6 @@ EFL_START_TEST(str_join_len)
fail_if(ret != 9); fail_if(ret != 9);
fail_if(strcmp(dst, "abcd#efg") != 0); fail_if(strcmp(dst, "abcd#efg") != 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -334,7 +326,6 @@ EFL_START_TEST(str_memdup)
unsigned char buf[7]; unsigned char buf[7];
unsigned char *temp_buf; unsigned char *temp_buf;
eina_init();
t1.i = 1234; t1.i = 1234;
t1.s = "hello"; t1.s = "hello";
@ -351,7 +342,6 @@ EFL_START_TEST(str_memdup)
fail_if(strcmp((char *) temp_buf, "aaabbb") != 0); fail_if(strcmp((char *) temp_buf, "aaabbb") != 0);
free(temp_buf); free(temp_buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -360,7 +350,6 @@ EFL_START_TEST(str_strftime)
time_t curr_time; time_t curr_time;
struct tm *info; struct tm *info;
char *buf; char *buf;
eina_init();
curr_time = time(NULL); curr_time = time(NULL);
info = localtime(&curr_time); info = localtime(&curr_time);
@ -369,7 +358,6 @@ EFL_START_TEST(str_strftime)
fail_if(buf == NULL); fail_if(buf == NULL);
free(buf); free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -382,7 +370,6 @@ EFL_START_TEST(str_convert)
size_t ret_sz; size_t ret_sz;
int i; int i;
eina_init();
ret = eina_str_convert("UTF-8", "UTF-16LE", utf8); ret = eina_str_convert("UTF-8", "UTF-16LE", utf8);
fail_if(ret == NULL); fail_if(ret == NULL);
@ -398,7 +385,6 @@ EFL_START_TEST(str_convert)
fail_if(ret[i] != utf16[i]); fail_if(ret[i] != utf16[i]);
free(ret); free(ret);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif

View File

@ -35,7 +35,6 @@ EFL_START_TEST(strbuf_simple)
#define TEST_TEXT \ #define TEST_TEXT \
"This test should be so long that it is longer than the initial size of strbuf" "This test should be so long that it is longer than the initial size of strbuf"
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_if(!buf); fail_if(!buf);
@ -74,7 +73,6 @@ EFL_START_TEST(strbuf_simple)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
#undef TEST_TEXT #undef TEST_TEXT
} }
EFL_END_TEST EFL_END_TEST
@ -86,7 +84,6 @@ EFL_START_TEST(strbuf_manage_simple)
#define TEST_TEXT \ #define TEST_TEXT \
"This test should be so long that it is longer than the initial size of strbuf" "This test should be so long that it is longer than the initial size of strbuf"
eina_init();
txt = strdup(TEST_TEXT); txt = strdup(TEST_TEXT);
@ -126,7 +123,6 @@ EFL_START_TEST(strbuf_manage_simple)
fail_if(strcmp(txt, TEST_TEXT TEST_TEXT)); fail_if(strcmp(txt, TEST_TEXT TEST_TEXT));
free(txt); free(txt);
eina_shutdown();
#undef TEST_TEXT #undef TEST_TEXT
} }
EFL_END_TEST EFL_END_TEST
@ -135,7 +131,6 @@ EFL_START_TEST(strbuf_remove)
{ {
Eina_Strbuf *buf; Eina_Strbuf *buf;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_if(!buf); fail_if(!buf);
@ -171,7 +166,6 @@ EFL_START_TEST(strbuf_remove)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -182,7 +176,6 @@ EFL_START_TEST(strbuf_append)
ro_slice.len -= strlen("ELSE"); ro_slice.len -= strlen("ELSE");
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_if(!buf); fail_if(!buf);
@ -224,7 +217,6 @@ EFL_START_TEST(strbuf_append)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -235,7 +227,6 @@ EFL_START_TEST(strbuf_insert)
ro_slice.len = 2; ro_slice.len = 2;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_if(!buf); fail_if(!buf);
@ -278,7 +269,6 @@ EFL_START_TEST(strbuf_insert)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -286,7 +276,6 @@ EFL_START_TEST(strbuf_replace)
{ {
Eina_Strbuf *buf; Eina_Strbuf *buf;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_if(!buf); fail_if(!buf);
@ -326,7 +315,6 @@ EFL_START_TEST(strbuf_replace)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -341,7 +329,6 @@ EFL_START_TEST(strbuf_realloc)
pattern[i] = 'a' + (i % 26); pattern[i] = 'a' + (i % 26);
pattern[i] = '\0'; pattern[i] = '\0';
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_if(!buf); fail_if(!buf);
@ -393,7 +380,6 @@ EFL_START_TEST(strbuf_realloc)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -405,7 +391,6 @@ EFL_START_TEST(strbuf_append_realloc)
const char *str; const char *str;
size_t i, target_pattern_size; size_t i, target_pattern_size;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_if(!buf); fail_if(!buf);
@ -428,7 +413,6 @@ EFL_START_TEST(strbuf_append_realloc)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -440,7 +424,6 @@ EFL_START_TEST(strbuf_prepend_realloc)
const char *str; const char *str;
size_t i, target_pattern_size; size_t i, target_pattern_size;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_if(!buf); fail_if(!buf);
@ -463,7 +446,6 @@ EFL_START_TEST(strbuf_prepend_realloc)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -472,7 +454,6 @@ EFL_START_TEST(strbuf_trim)
Eina_Strbuf* buf; Eina_Strbuf* buf;
const char *str; const char *str;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_unless(buf != NULL); fail_unless(buf != NULL);
@ -510,7 +491,6 @@ EFL_START_TEST(strbuf_trim)
eina_strbuf_reset(buf); eina_strbuf_reset(buf);
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -519,7 +499,6 @@ EFL_START_TEST(strbuf_tolower)
Eina_Strbuf* buf; Eina_Strbuf* buf;
const char *str; const char *str;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_unless(buf != NULL); fail_unless(buf != NULL);
@ -538,7 +517,6 @@ EFL_START_TEST(strbuf_tolower)
fail_unless(str || strcmp(str, "upper1@ ")); fail_unless(str || strcmp(str, "upper1@ "));
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -547,7 +525,6 @@ EFL_START_TEST(strbuf_substr_get)
Eina_Strbuf* buf, *substr; Eina_Strbuf* buf, *substr;
const char *str; const char *str;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_unless(buf != NULL); fail_unless(buf != NULL);
@ -583,7 +560,6 @@ EFL_START_TEST(strbuf_substr_get)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -615,7 +591,6 @@ EFL_START_TEST(strbuf_prepend_print)
Eina_Strbuf* buf; Eina_Strbuf* buf;
const char *str; const char *str;
eina_init();
buf = eina_strbuf_new(); buf = eina_strbuf_new();
fail_unless(buf != NULL); fail_unless(buf != NULL);
@ -640,7 +615,6 @@ EFL_START_TEST(strbuf_prepend_print)
eina_strbuf_free(buf); eina_strbuf_free(buf);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -87,7 +87,6 @@ EFL_START_TEST(eina_test_tile_grid_slicer_iterator)
{1, 2, 0, 0, 128, 1, 0}, {1, 2, 0, 0, 128, 1, 0},
{2, 2, 0, 0, 1, 1, 0}}; {2, 2, 0, 0, 1, 1, 0}};
eina_init();
cur_test = test1; cur_test = test1;
it = eina_tile_grid_slicer_iterator_new(200, 210, 10, 15, 128, 128); it = eina_tile_grid_slicer_iterator_new(200, 210, 10, 15, 128, 128);
@ -124,7 +123,6 @@ EFL_START_TEST(eina_test_tile_grid_slicer_iterator)
check_iterator(it, cur_test); check_iterator(it, cur_test);
eina_iterator_free(it); eina_iterator_free(it);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -137,7 +135,6 @@ EFL_START_TEST(eina_test_tiler_all)
int i = 0; int i = 0;
int width, height; int width, height;
eina_init();
tl = eina_tiler_new(1, 1); tl = eina_tiler_new(1, 1);
@ -183,7 +180,6 @@ EFL_START_TEST(eina_test_tiler_all)
eina_tiler_free(tl); eina_tiler_free(tl);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -195,7 +191,6 @@ EFL_START_TEST(eina_test_tiler_stable)
Eina_Rectangle r; Eina_Rectangle r;
int i = 0; int i = 0;
eina_init();
tl = eina_tiler_new(640, 480); tl = eina_tiler_new(640, 480);
fail_if(!tl); fail_if(!tl);
@ -233,7 +228,6 @@ EFL_START_TEST(eina_test_tiler_stable)
eina_tiler_free(tl); eina_tiler_free(tl);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -244,7 +238,6 @@ EFL_START_TEST(eina_test_tiler_calculation)
Eina_Rectangle r1, r2, r3, *rp; Eina_Rectangle r1, r2, r3, *rp;
int i = 0; int i = 0;
eina_init();
t1 = eina_tiler_new(500, 500); t1 = eina_tiler_new(500, 500);
fail_if(!t1); fail_if(!t1);
@ -349,7 +342,6 @@ EFL_START_TEST(eina_test_tiler_calculation)
eina_tiler_free(t1); eina_tiler_free(t1);
eina_tiler_free(t2); eina_tiler_free(t2);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -360,7 +352,6 @@ EFL_START_TEST(eina_test_tiler_size)
Eina_Tiler *t; Eina_Tiler *t;
Eina_Bool rects = EINA_FALSE; Eina_Bool rects = EINA_FALSE;
eina_init();
t = eina_tiler_new(131070, 131070); t = eina_tiler_new(131070, 131070);
fail_if(!t); fail_if(!t);
@ -379,7 +370,6 @@ EFL_START_TEST(eina_test_tiler_size)
fail_if(!rects); fail_if(!rects);
eina_iterator_free(it); eina_iterator_free(it);
eina_tiler_free(t); eina_tiler_free(t);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -27,7 +27,6 @@
EFL_START_TEST(tmpstr_simple) EFL_START_TEST(tmpstr_simple)
{ {
eina_init();
const int cnt_tmp_strings = 10; const int cnt_tmp_strings = 10;
const int max_str_len = 255; const int max_str_len = 255;
@ -57,13 +56,11 @@ EFL_START_TEST(tmpstr_simple)
// Delete non tmp string (should do nothing) // Delete non tmp string (should do nothing)
eina_tmpstr_del("Some non tmp string"); eina_tmpstr_del("Some non tmp string");
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(tmpstr_simple_len) EFL_START_TEST(tmpstr_simple_len)
{ {
eina_init();
const int cnt_tmp_strings = 10; const int cnt_tmp_strings = 10;
const int max_str_len = 255; const int max_str_len = 255;
@ -93,13 +90,11 @@ EFL_START_TEST(tmpstr_simple_len)
// Delete non tmp string (should do nothing) // Delete non tmp string (should do nothing)
eina_tmpstr_del("Some non tmp string"); eina_tmpstr_del("Some non tmp string");
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(tmpstr_manage) EFL_START_TEST(tmpstr_manage)
{ {
eina_init();
char *buf = malloc(7); char *buf = malloc(7);
strcpy(buf, "tmpstr"); strcpy(buf, "tmpstr");
@ -107,13 +102,11 @@ EFL_START_TEST(tmpstr_manage)
fail_if(strcmp(buf, tstr1)); fail_if(strcmp(buf, tstr1));
eina_tmpstr_del(tstr1); eina_tmpstr_del(tstr1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(tmpstr_manage_len) EFL_START_TEST(tmpstr_manage_len)
{ {
eina_init();
char *buf = malloc(10); char *buf = malloc(10);
strcpy(buf, "tmpstr"); strcpy(buf, "tmpstr");
@ -121,13 +114,11 @@ EFL_START_TEST(tmpstr_manage_len)
fail_if(strcmp(buf, tstr1)); fail_if(strcmp(buf, tstr1));
eina_tmpstr_del(tstr1); eina_tmpstr_del(tstr1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(tmpstr_len) EFL_START_TEST(tmpstr_len)
{ {
eina_init();
const char *str1 = "12345"; const char *str1 = "12345";
const char *str2 = "123456789"; const char *str2 = "123456789";
@ -143,7 +134,6 @@ EFL_START_TEST(tmpstr_len)
eina_tmpstr_del(tstr1); eina_tmpstr_del(tstr1);
eina_tmpstr_del(tstr2); eina_tmpstr_del(tstr2);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -32,7 +32,6 @@ EFL_START_TEST(trash_simple)
int inp_char = inp_int + '0'; int inp_char = inp_int + '0';
void *data; void *data;
eina_init();
trash = calloc(1, sizeof(Eina_Trash)); trash = calloc(1, sizeof(Eina_Trash));
fail_if(trash == NULL); fail_if(trash == NULL);
@ -68,7 +67,6 @@ EFL_START_TEST(trash_simple)
fail_if(i != 98); fail_if(i != 98);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -74,7 +74,6 @@ static const Eina_Unicode EMPTYSTR[] = {0};
EFL_START_TEST(eina_unicode_strcmp_test) EFL_START_TEST(eina_unicode_strcmp_test)
{ {
eina_init();
/* 1 & 2 */ /* 1 & 2 */
fail_if(eina_unicode_strcmp(STR1,STR2) == 0); fail_if(eina_unicode_strcmp(STR1,STR2) == 0);
@ -97,7 +96,6 @@ EFL_START_TEST(eina_unicode_strcmp_test)
fail_if(eina_unicode_strcmp(STR4, STR4) != 0); fail_if(eina_unicode_strcmp(STR4, STR4) != 0);
fail_if(eina_unicode_strcmp(EMPTYSTR, EMPTYSTR) != 0); fail_if(eina_unicode_strcmp(EMPTYSTR, EMPTYSTR) != 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -106,7 +104,6 @@ EFL_START_TEST(eina_unicode_strcpy_test)
Eina_Unicode buf[10] = { 0 }; Eina_Unicode buf[10] = { 0 };
Eina_Unicode *rv; Eina_Unicode *rv;
eina_init();
rv = eina_unicode_strcpy(buf,STR1); rv = eina_unicode_strcpy(buf,STR1);
fail_if(rv != buf); fail_if(rv != buf);
@ -133,7 +130,6 @@ EFL_START_TEST(eina_unicode_strcpy_test)
fail_if(buf[0] != 0); fail_if(buf[0] != 0);
fail_if(buf[1] != '7'); fail_if(buf[1] != '7');
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -142,7 +138,6 @@ EFL_START_TEST(eina_unicode_strncpy_test)
Eina_Unicode buf[10] = { 0 }; Eina_Unicode buf[10] = { 0 };
Eina_Unicode *rv; Eina_Unicode *rv;
eina_init();
rv = eina_unicode_strncpy(buf,STR1,9); rv = eina_unicode_strncpy(buf,STR1,9);
fail_if(rv != buf); fail_if(rv != buf);
@ -201,7 +196,6 @@ EFL_START_TEST(eina_unicode_strncpy_test)
} }
#endif #endif
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -210,7 +204,6 @@ EFL_END_TEST
EFL_START_TEST(eina_ustr_strlen_test) EFL_START_TEST(eina_ustr_strlen_test)
{ {
eina_init();
fail_if(eina_unicode_strlen(STR1) != 8); fail_if(eina_unicode_strlen(STR1) != 8);
fail_if(eina_unicode_strlen(STR2) != 9); fail_if(eina_unicode_strlen(STR2) != 9);
@ -242,13 +235,11 @@ EFL_START_TEST(eina_ustr_strlen_test)
} }
#endif #endif
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_unicode_strnlen_test) EFL_START_TEST(eina_unicode_strnlen_test)
{ {
eina_init();
/* Strlen style tests*/ /* Strlen style tests*/
fail_if(eina_unicode_strnlen(STR1,10) != 8); fail_if(eina_unicode_strnlen(STR1,10) != 8);
@ -287,7 +278,6 @@ EFL_START_TEST(eina_unicode_strnlen_test)
} }
#endif #endif
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -295,7 +285,6 @@ EFL_START_TEST(eina_unicode_strdup_test)
{ {
Eina_Unicode *buf; Eina_Unicode *buf;
eina_init();
buf = eina_unicode_strdup(STR1); buf = eina_unicode_strdup(STR1);
fail_if(!buf); fail_if(!buf);
@ -307,7 +296,6 @@ EFL_START_TEST(eina_unicode_strdup_test)
fail_if(!buf); fail_if(!buf);
fail_if(buf[0] != 0); fail_if(buf[0] != 0);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -316,7 +304,6 @@ EFL_START_TEST(eina_unicode_strstr_test)
Eina_Unicode *buf; Eina_Unicode *buf;
Eina_Unicode on[] = { 'O', 'n', 0 }; Eina_Unicode on[] = { 'O', 'n', 0 };
eina_init();
buf = eina_unicode_strstr(STR1,on); buf = eina_unicode_strstr(STR1,on);
fail_if(!buf); fail_if(!buf);
@ -333,7 +320,6 @@ EFL_START_TEST(eina_unicode_strstr_test)
fail_if(!buf); fail_if(!buf);
fail_if(buf != STR1); fail_if(buf != STR1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -348,7 +334,6 @@ EFL_START_TEST(eina_unicode_escape_test)
Eina_Unicode *buf; Eina_Unicode *buf;
size_t i; size_t i;
eina_init();
for (i = 0; i < sizeof(str)/sizeof(str[0]); ++i) for (i = 0; i < sizeof(str)/sizeof(str[0]); ++i)
{ {
@ -359,7 +344,6 @@ EFL_START_TEST(eina_unicode_escape_test)
free(buf); free(buf);
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -367,7 +351,6 @@ EFL_START_TEST(eina_unicode_utf8)
{ {
int ind; int ind;
unsigned char ch; unsigned char ch;
eina_init();
/* Valid utf-8 cases */ /* Valid utf-8 cases */
/* First possible sequence of a certain length */ /* First possible sequence of a certain length */
@ -574,7 +557,6 @@ EFL_START_TEST(eina_unicode_utf8)
fail_if((eina_unicode_utf8_get_prev("\xED\x9F\xBF", &ind) != 0x00) || fail_if((eina_unicode_utf8_get_prev("\xED\x9F\xBF", &ind) != 0x00) ||
(ind != 0)); (ind != 0));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -592,7 +574,6 @@ EFL_START_TEST(eina_unicode_utf8_conversion)
char *c_sub_out; char *c_sub_out;
int len; int len;
eina_init();
uni_out = eina_unicode_utf8_to_unicode(c_in, &len); uni_out = eina_unicode_utf8_to_unicode(c_in, &len);
fail_if((len != 9) || eina_unicode_strcmp(uni_in, uni_out)); fail_if((len != 9) || eina_unicode_strcmp(uni_in, uni_out));
@ -615,7 +596,6 @@ EFL_START_TEST(eina_unicode_utf8_conversion)
ck_assert_int_eq(len, 0); ck_assert_int_eq(len, 0);
ck_assert_str_eq("", c_sub_out); ck_assert_str_eq("", c_sub_out);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -37,7 +37,6 @@ EFL_START_TEST(eina_ustringshare_simple)
const Eina_Unicode *t0; const Eina_Unicode *t0;
const Eina_Unicode *t1; const Eina_Unicode *t1;
eina_init();
t0 = eina_ustringshare_add(TEST0); t0 = eina_ustringshare_add(TEST0);
t1 = eina_ustringshare_add(TEST1); t1 = eina_ustringshare_add(TEST1);
@ -57,7 +56,6 @@ EFL_START_TEST(eina_ustringshare_simple)
eina_ustringshare_del(t0); eina_ustringshare_del(t0);
eina_ustringshare_del(t1); eina_ustringshare_del(t1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -67,7 +65,6 @@ EFL_START_TEST(eina_ustringshare_test_share)
const Eina_Unicode *t0; const Eina_Unicode *t0;
const Eina_Unicode *t1; const Eina_Unicode *t1;
eina_init();
t0 = eina_ustringshare_add(TEST0); t0 = eina_ustringshare_add(TEST0);
t1 = eina_ustringshare_add(TEST0); t1 = eina_ustringshare_add(TEST0);
@ -83,7 +80,6 @@ EFL_START_TEST(eina_ustringshare_test_share)
eina_ustringshare_del(t0); eina_ustringshare_del(t0);
eina_ustringshare_del(t1); eina_ustringshare_del(t1);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -92,7 +88,6 @@ EFL_START_TEST(eina_ustringshare_putstuff)
const Eina_Unicode *tmp; const Eina_Unicode *tmp;
int i; int i;
eina_init();
for (i = 10000; i > 0; --i) for (i = 10000; i > 0; --i)
{ {
@ -107,7 +102,6 @@ EFL_START_TEST(eina_ustringshare_putstuff)
fail_if((int)eina_unicode_strlen(build) != eina_ustringshare_strlen(tmp)); fail_if((int)eina_unicode_strlen(build) != eina_ustringshare_strlen(tmp));
} }
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -47,7 +47,6 @@ EFL_START_TEST(eina_value_test_simple)
float f; float f;
double d; double d;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR); value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -126,7 +125,6 @@ EFL_START_TEST(eina_value_test_simple)
eina_value_flush(value); eina_value_flush(value);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -134,7 +132,6 @@ EFL_START_TEST(eina_value_test_compare)
{ {
Eina_Value *a, *b; Eina_Value *a, *b;
eina_init();
a = eina_value_new(EINA_VALUE_TYPE_CHAR); a = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(a != NULL); fail_unless(a != NULL);
@ -430,7 +427,6 @@ EFL_START_TEST(eina_value_test_compare)
eina_value_free(a); eina_value_free(a);
eina_value_free(b); eina_value_free(b);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -439,7 +435,6 @@ EFL_START_TEST(eina_value_test_string)
Eina_Value *value; Eina_Value *value;
const char *s; const char *s;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_STRING); value = eina_value_new(EINA_VALUE_TYPE_STRING);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -459,7 +454,6 @@ EFL_START_TEST(eina_value_test_string)
ck_assert_str_eq(s, "profusion"); ck_assert_str_eq(s, "profusion");
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -480,7 +474,6 @@ EFL_START_TEST(eina_value_test_pvariant)
double d, in_d; double d, in_d;
const char *str, *in_str; const char *str, *in_str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR); value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -590,7 +583,6 @@ EFL_START_TEST(eina_value_test_pvariant)
ck_assert_str_eq(str, "profusion"); ck_assert_str_eq(str, "profusion");
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -613,7 +605,6 @@ EFL_START_TEST(eina_value_test_to_string)
char *out; char *out;
char buf[256]; char buf[256];
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR); value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -795,7 +786,6 @@ EFL_START_TEST(eina_value_test_to_string)
free(out); free(out);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -808,7 +798,6 @@ EFL_START_TEST(eina_value_test_to_binbuf)
const char *out; const char *out;
char buf[256]; char buf[256];
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR); value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -859,7 +848,6 @@ EFL_START_TEST(eina_value_test_to_binbuf)
eina_binbuf_free(bin); eina_binbuf_free(bin);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -880,7 +868,6 @@ EFL_START_TEST(eina_value_test_convert_char)
double d; double d;
const char *str; const char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_CHAR); value = eina_value_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -990,7 +977,6 @@ EFL_START_TEST(eina_value_test_convert_char)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1011,7 +997,6 @@ EFL_START_TEST(eina_value_test_convert_uchar)
double d; double d;
const char *str; const char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_UCHAR); value = eina_value_new(EINA_VALUE_TYPE_UCHAR);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -1105,7 +1090,6 @@ EFL_START_TEST(eina_value_test_convert_uchar)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1124,7 +1108,6 @@ EFL_START_TEST(eina_value_test_convert_short)
double d; double d;
const char *str; const char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_SHORT); value = eina_value_new(EINA_VALUE_TYPE_SHORT);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -1238,7 +1221,6 @@ EFL_START_TEST(eina_value_test_convert_short)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1256,7 +1238,6 @@ EFL_START_TEST(eina_value_test_convert_ushort)
double d; double d;
const char *str; const char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_USHORT); value = eina_value_new(EINA_VALUE_TYPE_USHORT);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -1341,7 +1322,6 @@ EFL_START_TEST(eina_value_test_convert_ushort)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1358,7 +1338,6 @@ EFL_START_TEST(eina_value_test_convert_int)
double d; double d;
const char *str; const char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_INT); value = eina_value_new(EINA_VALUE_TYPE_INT);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -1472,7 +1451,6 @@ EFL_START_TEST(eina_value_test_convert_int)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1486,7 +1464,6 @@ EFL_START_TEST(eina_value_test_convert_uint)
double d; double d;
const char *str; const char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_UINT); value = eina_value_new(EINA_VALUE_TYPE_UINT);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -1559,7 +1536,6 @@ EFL_START_TEST(eina_value_test_convert_uint)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1580,7 +1556,6 @@ EFL_START_TEST(eina_value_test_convert_long)
double d; double d;
const char *str; const char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_LONG); value = eina_value_new(EINA_VALUE_TYPE_LONG);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -1710,7 +1685,6 @@ EFL_START_TEST(eina_value_test_convert_long)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1731,7 +1705,6 @@ EFL_START_TEST(eina_value_test_convert_ulong)
double d; double d;
const char *str; const char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_ULONG); value = eina_value_new(EINA_VALUE_TYPE_ULONG);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -1839,7 +1812,6 @@ EFL_START_TEST(eina_value_test_convert_ulong)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -1863,7 +1835,6 @@ EFL_START_TEST(eina_value_test_convert_float)
float max_float_value = FLT_MAX; float max_float_value = FLT_MAX;
float min_float_value = FLT_MIN; float min_float_value = FLT_MIN;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_FLOAT); value = eina_value_new(EINA_VALUE_TYPE_FLOAT);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -2013,7 +1984,6 @@ EFL_START_TEST(eina_value_test_convert_float)
eina_value_flush(&conv); eina_value_flush(&conv);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2027,7 +1997,6 @@ EFL_START_TEST(eina_value_test_array)
char buf[1024]; char buf[1024];
char *str; char *str;
eina_init();
value = eina_value_array_new(EINA_VALUE_TYPE_CHAR, 0); value = eina_value_array_new(EINA_VALUE_TYPE_CHAR, 0);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -2126,7 +2095,6 @@ EFL_START_TEST(eina_value_test_array)
fail_unless(c == 31); fail_unless(c == 31);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2139,7 +2107,6 @@ EFL_START_TEST(eina_value_test_list)
char *str; char *str;
const char *s; const char *s;
eina_init();
value = eina_value_list_new(EINA_VALUE_TYPE_CHAR); value = eina_value_list_new(EINA_VALUE_TYPE_CHAR);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -2236,7 +2203,6 @@ EFL_START_TEST(eina_value_test_list)
ck_assert_str_eq(s, "eina"); ck_assert_str_eq(s, "eina");
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2250,7 +2216,6 @@ EFL_START_TEST(eina_value_test_hash)
char *str; char *str;
const char *s; const char *s;
eina_init();
value = eina_value_hash_new(EINA_VALUE_TYPE_CHAR, 0); value = eina_value_hash_new(EINA_VALUE_TYPE_CHAR, 0);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -2356,7 +2321,6 @@ EFL_START_TEST(eina_value_test_hash)
ck_assert_str_eq(s, "y"); ck_assert_str_eq(s, "y");
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2370,7 +2334,6 @@ EFL_START_TEST(eina_value_test_timeval)
char *str; char *str;
char buf[64]; char buf[64];
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_TIMEVAL); value = eina_value_new(EINA_VALUE_TYPE_TIMEVAL);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -2440,7 +2403,6 @@ EFL_START_TEST(eina_value_test_timeval)
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2453,7 +2415,6 @@ EFL_START_TEST(eina_value_test_blob)
int i = 0x11223344; int i = 0x11223344;
char *str; char *str;
eina_init();
value = eina_value_new(EINA_VALUE_TYPE_BLOB); value = eina_value_new(EINA_VALUE_TYPE_BLOB);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -2529,7 +2490,6 @@ EFL_START_TEST(eina_value_test_blob)
eina_value_flush(&other); eina_value_flush(&other);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2588,7 +2548,6 @@ EFL_START_TEST(eina_value_test_struct)
char c; char c;
char *str; char *str;
eina_init();
value = eina_value_struct_new(&myst_desc); value = eina_value_struct_new(&myst_desc);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -2715,7 +2674,6 @@ EFL_START_TEST(eina_value_test_struct)
eina_value_flush(&other); eina_value_flush(&other);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2742,7 +2700,6 @@ EFL_START_TEST(eina_value_test_array_of_struct)
char *str; char *str;
int i; int i;
eina_init();
value = eina_value_array_new(EINA_VALUE_TYPE_STRUCT, 0); value = eina_value_array_new(EINA_VALUE_TYPE_STRUCT, 0);
fail_unless(value != NULL); fail_unless(value != NULL);
@ -2792,13 +2749,11 @@ EFL_START_TEST(eina_value_test_array_of_struct)
eina_value_flush(&array_item); eina_value_flush(&array_item);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_value_test_optional_int) EFL_START_TEST(eina_value_test_optional_int)
{ {
eina_init();
/* Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_OPTIONAL); */ /* Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_OPTIONAL); */
/* Eina_Bool is_empty; */ /* Eina_Bool is_empty; */
@ -2832,13 +2787,11 @@ EFL_START_TEST(eina_value_test_optional_int)
/* ck_assert_int_eq(expected_value, actual_value); */ /* ck_assert_int_eq(expected_value, actual_value); */
/* eina_value_free(value); */ /* eina_value_free(value); */
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_value_test_optional_string) EFL_START_TEST(eina_value_test_optional_string)
{ {
eina_init();
Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_OPTIONAL); Eina_Value *value = eina_value_new(EINA_VALUE_TYPE_OPTIONAL);
Eina_Bool is_empty; Eina_Bool is_empty;
@ -2873,13 +2826,11 @@ EFL_START_TEST(eina_value_test_optional_string)
ck_assert_str_eq(expected_value, actual_value); ck_assert_str_eq(expected_value, actual_value);
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_value_test_optional_struct_members) EFL_START_TEST(eina_value_test_optional_struct_members)
{ {
eina_init();
struct s { struct s {
int64_t a; int64_t a;
@ -2933,7 +2884,6 @@ EFL_START_TEST(eina_value_test_optional_struct_members)
eina_value_free(value); eina_value_free(value);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2944,7 +2894,6 @@ EFL_START_TEST(eina_value_test_value)
int i; int i;
const char *str; const char *str;
eina_init();
fail_if(!eina_value_setup(&composed, EINA_VALUE_TYPE_VALUE)); fail_if(!eina_value_setup(&composed, EINA_VALUE_TYPE_VALUE));
fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_INT)); fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_INT));
@ -2967,7 +2916,6 @@ EFL_START_TEST(eina_value_test_value)
eina_value_flush(&v); eina_value_flush(&v);
eina_value_flush(&composed); eina_value_flush(&composed);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -2976,7 +2924,6 @@ EFL_START_TEST(eina_value_test_value_string)
Eina_Value composed, v, str_v; Eina_Value composed, v, str_v;
const char *msg = "A string", *str; const char *msg = "A string", *str;
eina_init();
fail_if(!eina_value_setup(&composed, EINA_VALUE_TYPE_VALUE)); fail_if(!eina_value_setup(&composed, EINA_VALUE_TYPE_VALUE));
fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_STRING)); fail_if(!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
@ -3000,7 +2947,6 @@ EFL_START_TEST(eina_value_test_value_string)
eina_value_flush(&str_v); eina_value_flush(&str_v);
eina_value_flush(&composed); eina_value_flush(&composed);
eina_value_flush(&v); eina_value_flush(&v);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -40,7 +40,6 @@ EFL_START_TEST(eina_test_vector2_operations)
double res = 0; double res = 0;
const double arr[] = {5, 5}; const double arr[] = {5, 5};
eina_init();
eina_vector2_set(&v1, x, y); eina_vector2_set(&v1, x, y);
fail_if((v1.x != 1) || (v1.y != 2)); fail_if((v1.x != 1) || (v1.y != 2));
@ -107,7 +106,6 @@ EFL_START_TEST(eina_test_vector2_operations)
eina_vector2_homogeneous_direction_transform(&v3, &m3, &v3); eina_vector2_homogeneous_direction_transform(&v3, &m3, &v3);
fail_if((v3.x != 24) || (v3.y != 24)); fail_if((v3.x != 24) || (v3.y != 24));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -126,7 +124,6 @@ EFL_START_TEST(eina_test_vector3_operations)
Eina_Bool res2 = EINA_FALSE; Eina_Bool res2 = EINA_FALSE;
const double arr[] = {5, 5, 5}; const double arr[] = {5, 5, 5};
eina_init();
eina_vector3_set(&v1, x, y, z); eina_vector3_set(&v1, x, y, z);
fail_if((v1.x != 1) || (v1.y != 2) || (v1.z != 3)); fail_if((v1.x != 1) || (v1.y != 2) || (v1.z != 3));
@ -238,7 +235,6 @@ EFL_START_TEST(eina_test_vector3_operations)
eina_vector3_homogeneous_direction_transform(&v3, &m4, &v3); eina_vector3_homogeneous_direction_transform(&v3, &m4, &v3);
fail_if((v3.x != 72) || (v3.y != 72) || (v3.z != 72)); fail_if((v3.x != 72) || (v3.y != 72) || (v3.z != 72));
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -8,12 +8,8 @@
EFL_START_TEST(eina_test_vpath_valid) EFL_START_TEST(eina_test_vpath_valid)
{ {
int ret;
char test[PATH_MAX]; char test[PATH_MAX];
ret = eina_init();
ck_assert_int_ne(ret, 0);
ck_assert_str_eq(eina_vpath_resolve("/"), "/"); ck_assert_str_eq(eina_vpath_resolve("/"), "/");
ck_assert_str_eq(eina_vpath_resolve("./"), "./"); ck_assert_str_eq(eina_vpath_resolve("./"), "./");
ck_assert_str_eq(eina_vpath_resolve("..bla"), "..bla"); ck_assert_str_eq(eina_vpath_resolve("..bla"), "..bla");
@ -25,24 +21,17 @@ EFL_START_TEST(eina_test_vpath_valid)
snprintf(test, sizeof(test), "%s/bla", eina_environment_home_get()); snprintf(test, sizeof(test), "%s/bla", eina_environment_home_get());
ck_assert_str_eq(eina_vpath_resolve("(:home:)/bla"), test); ck_assert_str_eq(eina_vpath_resolve("(:home:)/bla"), test);
ret = eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eina_test_vpath_invalid) EFL_START_TEST(eina_test_vpath_invalid)
{ {
int ret;
ret = eina_init();
ck_assert_int_ne(ret, 0);
ck_assert_ptr_eq(eina_vpath_resolve("(:asdfasdfafasdf"), NULL); ck_assert_ptr_eq(eina_vpath_resolve("(:asdfasdfafasdf"), NULL);
ck_assert_ptr_eq(eina_vpath_resolve("(:missing_slash:)"), NULL); ck_assert_ptr_eq(eina_vpath_resolve("(:missing_slash:)"), NULL);
ck_assert_ptr_eq(eina_vpath_resolve("(:"), NULL); ck_assert_ptr_eq(eina_vpath_resolve("(:"), NULL);
ck_assert_ptr_eq(eina_vpath_resolve("(:home:)"), NULL); ck_assert_ptr_eq(eina_vpath_resolve("(:home:)"), NULL);
ck_assert_ptr_eq(eina_vpath_resolve("(:wrong_meta_key:)/"), NULL); ck_assert_ptr_eq(eina_vpath_resolve("(:wrong_meta_key:)/"), NULL);
ret = eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -50,7 +50,6 @@ EFL_START_TEST(eina_test_xattr_set)
Eina_Bool ret; Eina_Bool ret;
Eina_Tmpstr *test_file_path; Eina_Tmpstr *test_file_path;
eina_init();
test_file_path = get_file_path(XATTR_TEST_DIR, filename); test_file_path = get_file_path(XATTR_TEST_DIR, filename);
fd = open(test_file_path, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO); fd = open(test_file_path, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
@ -93,7 +92,6 @@ EFL_START_TEST(eina_test_xattr_set)
unlink(test_file_path); unlink(test_file_path);
eina_tmpstr_del(test_file_path); eina_tmpstr_del(test_file_path);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -121,7 +119,6 @@ EFL_START_TEST(eina_test_xattr_list)
Eina_Iterator *it; Eina_Iterator *it;
Eina_Xattr *xattr; Eina_Xattr *xattr;
eina_init();
test_file_path = get_file_path(XATTR_TEST_DIR, filename); test_file_path = get_file_path(XATTR_TEST_DIR, filename);
cp_file_path = get_file_path(XATTR_TEST_DIR, filename_cp); cp_file_path = get_file_path(XATTR_TEST_DIR, filename_cp);
@ -243,7 +240,6 @@ EFL_START_TEST(eina_test_xattr_list)
unlink(cp_file_path); unlink(cp_file_path);
eina_tmpstr_del(test_file_path); eina_tmpstr_del(test_file_path);
eina_tmpstr_del(cp_file_path); eina_tmpstr_del(cp_file_path);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -260,7 +256,6 @@ EFL_START_TEST(eina_test_xattr_types)
Eina_Bool ret; Eina_Bool ret;
Eina_Tmpstr *test_file_path; Eina_Tmpstr *test_file_path;
eina_init();
test_file_path = get_file_path(XATTR_TEST_DIR, filename); test_file_path = get_file_path(XATTR_TEST_DIR, filename);
fd = open(test_file_path, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO); fd = open(test_file_path, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
@ -289,7 +284,6 @@ EFL_START_TEST(eina_test_xattr_types)
unlink(test_file_path); unlink(test_file_path);
eina_tmpstr_del(test_file_path); eina_tmpstr_del(test_file_path);
eina_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif

View File

@ -6,6 +6,7 @@
#include "eio_suite.h" #include "eio_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Eio.h>
static const Efl_Test_Case etc[] = { static const Efl_Test_Case etc[] = {
{"Eio_Monitor", eio_test_monitor}, {"Eio_Monitor", eio_test_monitor},
@ -23,6 +24,17 @@ static const Efl_Test_Case etc[] = {
{NULL, NULL} {NULL, NULL}
}; };
SUITE_INIT(eio)
{
//T6813
//ck_assert_int_eq(eio_init(), 1);
}
SUITE_SHUTDOWN(eio)
{
//ck_assert_int_eq(eio_shutdown(), 0);
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
@ -38,7 +50,7 @@ main(int argc, char **argv)
eina_init(); eina_init();
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Eio", etc); "Eio", etc, SUITE_INIT_FN(eio), SUITE_SHUTDOWN_FN(eio));
eina_shutdown(); eina_shutdown();

View File

@ -4,6 +4,7 @@
#include "eldbus_suite.h" #include "eldbus_suite.h"
#include "../efl_check.h" #include "../efl_check.h"
#include <Eldbus.h>
static const Efl_Test_Case etc[] = { static const Efl_Test_Case etc[] = {
{ "eldbus_init", eldbus_test_eldbus_init }, { "eldbus_init", eldbus_test_eldbus_init },
@ -22,6 +23,17 @@ static const Efl_Test_Case etc[] = {
{ NULL, NULL } { NULL, NULL }
}; };
SUITE_INIT(eldbus)
{
ck_assert_int_eq(eldbus_init(), 1);
}
SUITE_SHUTDOWN(eldbus)
{
//T6814
ck_assert_int_eq(eldbus_shutdown(), 0);
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
@ -35,7 +47,7 @@ main(int argc, char **argv)
#endif #endif
failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
"Eldbus", etc); "Eldbus", etc, SUITE_INIT_FN(eldbus), SUITE_SHUTDOWN_FN(eldbus));
return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE; return (failed_count == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
} }

View File

@ -20,36 +20,17 @@ _quit_cb(void *data EINA_UNUSED)
EFL_START_TEST(eldbus_test_eldbus) EFL_START_TEST(eldbus_test_eldbus)
{ {
int ret;
ecore_init();
ret = eldbus_init();
fail_if(ret < 1);
ret = eldbus_shutdown();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(eldbus_test_eldbus_main_loop) EFL_START_TEST(eldbus_test_eldbus_main_loop)
{ {
Ecore_Timer *timer; Ecore_Timer *timer;
int ret;
ecore_init();
ret = eldbus_init();
fail_if(ret < 1);
timer = ecore_timer_add(0.1, _quit_cb, NULL); timer = ecore_timer_add(0.1, _quit_cb, NULL);
fail_if(timer == NULL); fail_if(timer == NULL);
ecore_main_loop_begin(); ecore_main_loop_begin();
ret = eldbus_shutdown();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -63,12 +44,6 @@ EFL_END_TEST
EFL_START_TEST(eldbus_test_eldbus_conn) EFL_START_TEST(eldbus_test_eldbus_conn)
{ {
Eldbus_Connection *conn; Eldbus_Connection *conn;
int ret;
ecore_init();
ret = eldbus_init();
fail_if(ret < 1);
/* /*
* let's use connection type == system, so it works without a session, * let's use connection type == system, so it works without a session,
@ -79,11 +54,6 @@ EFL_START_TEST(eldbus_test_eldbus_conn)
fail_if(conn == NULL); fail_if(conn == NULL);
eldbus_connection_unref(conn); eldbus_connection_unref(conn);
ret = eldbus_shutdown();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -91,12 +61,6 @@ EFL_START_TEST(eldbus_test_eldbus_conn_object)
{ {
Eldbus_Connection *conn; Eldbus_Connection *conn;
Eldbus_Object *obj; Eldbus_Object *obj;
int ret;
ecore_init();
ret = eldbus_init();
fail_if(ret < 1);
/* /*
* let's use connection type == system, so it works without a D-Bus session. * let's use connection type == system, so it works without a D-Bus session.
@ -113,10 +77,6 @@ EFL_START_TEST(eldbus_test_eldbus_conn_object)
eldbus_connection_unref(conn); eldbus_connection_unref(conn);
ret = eldbus_shutdown();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
@ -131,9 +91,6 @@ EFL_START_TEST(eldbus_test_eldbus_name_owner_changed)
Eldbus_Connection *conn; Eldbus_Connection *conn;
const char *id = NULL; const char *id = NULL;
ecore_init();
eldbus_init();
conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM); conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
fail_if(conn == NULL); fail_if(conn == NULL);
@ -147,8 +104,6 @@ EFL_START_TEST(eldbus_test_eldbus_name_owner_changed)
eldbus_connection_unref(conn); eldbus_connection_unref(conn);
eldbus_shutdown();
ecore_shutdown();
} }
EFL_END_TEST EFL_END_TEST
#endif #endif

View File

@ -46,26 +46,9 @@ static Eldbus_Message_Iter *iter_value_swap = NULL;
* *
* *
* @precondition * @precondition
* @step 1 Initialize ecore with ecore_init() * @step 1 Initialize eldbus with eldbus_init()
* @step 2 Initialize eldbus with eldbus_init()
*/ */
static void
_setup(void)
{
ecore_init();
int ret = eldbus_init();
ck_assert_int_ge(ret, 1);
}
static void
_teardown(void)
{
ecore_shutdown();
int ret = eldbus_shutdown();
ck_assert_int_eq(ret, 0);
}
static Eina_Bool static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED) _ecore_loop_close(void *data EINA_UNUSED)
{ {
@ -1621,7 +1604,6 @@ EFL_END_TEST
void eldbus_test_eldbus_message(TCase *tc) void eldbus_test_eldbus_message(TCase *tc)
{ {
tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_message_iterator_activatable_list_p); tcase_add_test(tc, utc_eldbus_message_iterator_activatable_list_p);
tcase_add_test(tc, utc_eldbus_message_info_data_get_p); tcase_add_test(tc, utc_eldbus_message_info_data_get_p);
tcase_add_test(tc, utc_eldbus_message_signal_new_p); tcase_add_test(tc, utc_eldbus_message_signal_new_p);

View File

@ -134,22 +134,6 @@ efl_model_first_child_get(Efl_Model *efl_model)
return efl_model_nth_child_get(efl_model, 0); return efl_model_nth_child_get(efl_model, 0);
} }
void
check_init(void)
{
ecore_init();
int ret = eldbus_init();
ck_assert_int_ge(ret, 1);
}
void
check_shutdown(void)
{
ecore_shutdown();
int ret = eldbus_shutdown();
ck_assert_int_eq(ret, 0);
}
void void
check_property(Eo *object, const char *property_name, const char *expected_value) check_property(Eo *object, const char *property_name, const char *expected_value)
{ {
@ -279,31 +263,22 @@ check_efl_model_children_slice_get(Efl_Model *efl_model)
EFL_START_TEST(smoke) EFL_START_TEST(smoke)
{ {
check_init();
Eo *connection = create_connection(); Eo *connection = create_connection();
efl_unref(connection); efl_unref(connection);
check_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(object) EFL_START_TEST(object)
{ {
check_init();
Eo *root = create_object(); Eo *root = create_object();
efl_unref(root); efl_unref(root);
check_shutdown();
} }
EFL_END_TEST EFL_END_TEST
EFL_START_TEST(proxy) EFL_START_TEST(proxy)
{ {
check_init();
Eo *root = create_object(); Eo *root = create_object();
Eina_Accessor *accessor = NULL; Eina_Accessor *accessor = NULL;
@ -326,7 +301,6 @@ EFL_START_TEST(proxy)
efl_unref(root); efl_unref(root);
check_shutdown();
} }
EFL_END_TEST EFL_END_TEST

View File

@ -18,7 +18,6 @@ static Eo *connection = NULL;
static void static void
_setup(void) _setup(void)
{ {
check_init();
connection = create_connection(); connection = create_connection();
} }
@ -26,7 +25,6 @@ static void
_teardown(void) _teardown(void)
{ {
efl_unref(connection); efl_unref(connection);
check_shutdown();
} }
EFL_START_TEST(properties_get) EFL_START_TEST(properties_get)

View File

@ -25,8 +25,6 @@ static Eo *method = NULL;
static void static void
_setup(void) _setup(void)
{ {
check_init();
fake_server = fake_server_start(&fake_server_data); fake_server = fake_server_start(&fake_server_data);
fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(), eldbus_model_object_custom_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(), eldbus_model_object_custom_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH));
@ -45,8 +43,6 @@ _teardown(void)
efl_unref(fake_server_object); efl_unref(fake_server_object);
fake_server_stop(fake_server); fake_server_stop(fake_server);
check_shutdown();
} }
EFL_START_TEST(properties_get) EFL_START_TEST(properties_get)

View File

@ -18,7 +18,6 @@ static Eo *object = NULL;
static void static void
_setup(void) _setup(void)
{ {
check_init();
object = create_object(); object = create_object();
} }
@ -26,7 +25,6 @@ static void
_teardown(void) _teardown(void)
{ {
efl_unref(object); efl_unref(object);
check_shutdown();
} }
EFL_START_TEST(properties_get) EFL_START_TEST(properties_get)

View File

@ -17,7 +17,6 @@ static Eo *dbus_proxy = NULL;
static void static void
_setup(void) _setup(void)
{ {
check_init();
dbus_object1 = create_object(); dbus_object1 = create_object();
dbus_proxy = eldbus_model_proxy_from_object_get(dbus_object1, ELDBUS_FDO_INTERFACE); dbus_proxy = eldbus_model_proxy_from_object_get(dbus_object1, ELDBUS_FDO_INTERFACE);
@ -28,7 +27,6 @@ static void
_teardown(void) _teardown(void)
{ {
efl_unref(dbus_object1); efl_unref(dbus_object1);
check_shutdown();
} }
EFL_START_TEST(properties_get) EFL_START_TEST(properties_get)

View File

@ -23,8 +23,6 @@ static Eo *pong_signal = NULL;
static void static void
_setup(void) _setup(void)
{ {
check_init();
fake_server = fake_server_start(&fake_server_data); fake_server = fake_server_start(&fake_server_data);
fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(), eldbus_model_object_custom_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH)); fake_server_object = efl_add(ELDBUS_MODEL_OBJECT_CLASS, efl_main_loop_get(), eldbus_model_object_custom_constructor(efl_added, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH));
@ -44,7 +42,6 @@ _teardown(void)
fake_server_stop(fake_server); fake_server_stop(fake_server);
check_shutdown();
} }
EFL_START_TEST(properties_get) EFL_START_TEST(properties_get)

View File

@ -27,26 +27,9 @@ static int cb_data = 5;
* @defgroup eldbus_object * @defgroup eldbus_object
* *
* @precondition * @precondition
* @step 1 Initialize ecore with ecore_init() * @step 1 Initialize eldbus with eldbus_init()
* @step 2 Initialize eldbus with eldbus_init()
*/ */
static void
_setup(void)
{
ecore_init();
int ret = eldbus_init();
ck_assert_int_ge(ret, 1);
}
static void
_teardown(void)
{
ecore_shutdown();
int ret = eldbus_shutdown();
ck_assert_int_eq(ret, 0);
}
static Eina_Bool static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED) _ecore_loop_close(void *data EINA_UNUSED)
{ {
@ -402,7 +385,6 @@ EFL_END_TEST
void void
eldbus_test_eldbus_object(TCase *tc) eldbus_test_eldbus_object(TCase *tc)
{ {
tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_object_send_info_get_p); tcase_add_test(tc, utc_eldbus_object_send_info_get_p);
tcase_add_test(tc, utc_eldbus_introspect_p); tcase_add_test(tc, utc_eldbus_introspect_p);
tcase_add_test(tc, utc_eldbus_object_peer_p); tcase_add_test(tc, utc_eldbus_object_peer_p);

View File

@ -30,25 +30,9 @@ const char *member = "GetId";
* @li eldbus_pending_path_get() * @li eldbus_pending_path_get()
* *
* @precondition * @precondition
* @step 1 Initialize ecore with ecore_init() * @step 1 Initialize eldbus with eldbus_init()
* @step 2 Initialize eldbus with eldbus_init()
*/ */
static void
_setup(void)
{
ecore_init();
int ret = eldbus_init();
ck_assert_int_ge(ret, 1);
}
static void
_teardown(void)
{
eldbus_shutdown();
ecore_shutdown();
}
static Eina_Bool static Eina_Bool
_ecore_loop_close(void *data EINA_UNUSED) _ecore_loop_close(void *data EINA_UNUSED)
{ {
@ -203,6 +187,5 @@ EFL_END_TEST
void void
eldbus_test_eldbus_pending_cancel(TCase *tc) eldbus_test_eldbus_pending_cancel(TCase *tc)
{ {
tcase_add_checked_fixture(tc, _setup, _teardown);
tcase_add_test(tc, utc_eldbus_pending_info_get_cancel_p); tcase_add_test(tc, utc_eldbus_pending_info_get_cancel_p);
} }

Some files were not shown because too many files have changed in this diff Show More