summaryrefslogtreecommitdiff
path: root/src/tests/ecore_con
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-03-27 13:51:13 -0400
committerStefan Schmidt <stefan@osg.samsung.com>2018-04-05 11:10:26 +0200
commit624925fe6e9c72c639d47135d5ea70d4110ac1fe (patch)
treeb57c12a611bf3b4b492327a7fcb5722cd39dad5b /src/tests/ecore_con
parent730020c7d4a87daf60cbfbb3a0a912b4f75d8cb5 (diff)
tests: move to using checked fixtures for all test suites
individual tests should not need to explicitly call init/shutdown functions in most cases, and many did not properly do this anyway see followup commit which resolves some issues with eina tests ref T6813 ref T6811 Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Diffstat (limited to 'src/tests/ecore_con')
-rw-r--r--src/tests/ecore_con/ecore_con_suite.c13
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con.c44
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con_eet.c8
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con_url.c16
-rw-r--r--src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c62
5 files changed, 13 insertions, 130 deletions
diff --git a/src/tests/ecore_con/ecore_con_suite.c b/src/tests/ecore_con/ecore_con_suite.c
index 1ef8b84..7f96297 100644
--- a/src/tests/ecore_con/ecore_con_suite.c
+++ b/src/tests/ecore_con/ecore_con_suite.c
@@ -4,6 +4,7 @@
4 4
5#include "ecore_con_suite.h" 5#include "ecore_con_suite.h"
6#include "../efl_check.h" 6#include "../efl_check.h"
7#include <Ecore_Con.h>
7 8
8static const Efl_Test_Case etc[] = { 9static const Efl_Test_Case etc[] = {
9 { "Ecore_Con", ecore_con_test_ecore_con }, 10 { "Ecore_Con", ecore_con_test_ecore_con },
@@ -13,6 +14,16 @@ static const Efl_Test_Case etc[] = {
13 { NULL, NULL } 14 { NULL, NULL }
14}; 15};
15 16
17SUITE_INIT(ecore_con)
18{
19 ck_assert_int_eq(ecore_con_init(), 1);
20}
21
22SUITE_SHUTDOWN(ecore_con)
23{
24 ck_assert_int_eq(ecore_con_shutdown(), 0);
25}
26
16int 27int
17main(int argc, char **argv) 28main(int argc, char **argv)
18{ 29{
@@ -26,7 +37,7 @@ main(int argc, char **argv)
26#endif 37#endif
27 38
28 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 39 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
29 "Ecore_Con", etc); 40 "Ecore_Con", etc, SUITE_INIT_FN(ecore_con), SUITE_SHUTDOWN_FN(ecore_con));
30 41
31 return (failed_count == 0) ? 0 : 255; 42 return (failed_count == 0) ? 0 : 255;
32} 43}
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con.c b/src/tests/ecore_con/ecore_con_test_ecore_con.c
index df481bc..86323a4 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con.c
@@ -200,11 +200,6 @@ void _ecore_con_server_client_tests(Ecore_Con_Type compl_type, const char *name,
200 void *del_ret; 200 void *del_ret;
201 const char *server_name; 201 const char *server_name;
202 202
203 ret = eina_init();
204 fail_if(ret != 1);
205 ret = ecore_con_init();
206 fail_if(ret != 1);
207
208 handlers[0] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, 203 handlers[0] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD,
209 _add, (void *) 1); 204 _add, (void *) 1);
210 fail_if(handlers[0] == NULL); 205 fail_if(handlers[0] == NULL);
@@ -316,10 +311,6 @@ void _ecore_con_server_client_tests(Ecore_Con_Type compl_type, const char *name,
316 fail_if (del_ret != (void *) 2); 311 fail_if (del_ret != (void *) 2);
317 del_ret = ecore_event_handler_del (handlers[5]); 312 del_ret = ecore_event_handler_del (handlers[5]);
318 fail_if (del_ret != (void *) 2); 313 fail_if (del_ret != (void *) 2);
319
320 ret = ecore_con_shutdown();
321 fail_if(ret != 0);
322 ret = eina_shutdown();
323} 314}
324 315
325EFL_START_TEST(ecore_test_ecore_con_local_user) 316EFL_START_TEST(ecore_test_ecore_con_local_user)
@@ -470,30 +461,12 @@ EFL_START_TEST(ecore_test_ecore_con_ssl_available)
470} 461}
471EFL_END_TEST 462EFL_END_TEST
472 463
473EFL_START_TEST(ecore_test_ecore_con_init)
474{
475 int ret;
476
477 ret = ecore_con_init();
478 fail_if(ret != 1);
479
480 ret = ecore_con_shutdown();
481 fail_if(ret != 0);
482}
483EFL_END_TEST
484
485EFL_START_TEST(ecore_test_ecore_con_dns) 464EFL_START_TEST(ecore_test_ecore_con_dns)
486{ 465{
487 Ecore_Con_Server *client; 466 Ecore_Con_Server *client;
488 Ecore_Event_Handler *e_err; 467 Ecore_Event_Handler *e_err;
489 Ecore_Event_Handler *e_add; 468 Ecore_Event_Handler *e_add;
490 Eina_Bool err_check = EINA_FALSE; 469 Eina_Bool err_check = EINA_FALSE;
491 int ret;
492
493 ret = eina_init();
494 fail_if(ret != 1);
495 ret = ecore_con_init();
496 fail_if(ret != 1);
497 470
498 e_add = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, _dns_add_del, (void *) &err_check); 471 e_add = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, _dns_add_del, (void *) &err_check);
499 e_err = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR, _dns_err, (void *) &err_check); 472 e_err = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR, _dns_err, (void *) &err_check);
@@ -509,27 +482,16 @@ EFL_START_TEST(ecore_test_ecore_con_dns)
509 fail_if (err_check == EINA_FALSE); 482 fail_if (err_check == EINA_FALSE);
510 fail_if (ecore_event_handler_del(e_err) != (void *) &err_check); 483 fail_if (ecore_event_handler_del(e_err) != (void *) &err_check);
511 fail_if (ecore_event_handler_del(e_add) != (void *) &err_check); 484 fail_if (ecore_event_handler_del(e_add) != (void *) &err_check);
512
513 ret = ecore_con_shutdown();
514 fail_if(ret != 0);
515 ret = eina_shutdown();
516} 485}
517EFL_END_TEST 486EFL_END_TEST
518 487
519EFL_START_TEST(ecore_test_ecore_con_shutdown_bef_init) 488EFL_START_TEST(ecore_test_ecore_con_shutdown_bef_init)
520{ 489{
521 int ret; 490 int ret = ecore_con_shutdown();
522
523 eina_init();
524 ret = ecore_con_shutdown();
525 fail_if(ret != 0); 491 fail_if(ret != 0);
526 492
527 ret = ecore_con_init();
528 fail_if(ret != 1);
529
530 ret = ecore_con_shutdown(); 493 ret = ecore_con_shutdown();
531 fail_if(ret != 0); 494 fail_if(ret != 0);
532 eina_shutdown();
533} 495}
534EFL_END_TEST 496EFL_END_TEST
535 497
@@ -549,19 +511,15 @@ _lookup_done_cb(const char *canonname, const char *ip, struct sockaddr *addr, in
549EFL_START_TEST(ecore_test_ecore_con_dns_lookup) 511EFL_START_TEST(ecore_test_ecore_con_dns_lookup)
550{ 512{
551 const char link[] = "www.google.com"; 513 const char link[] = "www.google.com";
552 ecore_con_init();
553 514
554 fail_unless(ecore_con_lookup(link, _lookup_done_cb, link)); 515 fail_unless(ecore_con_lookup(link, _lookup_done_cb, link));
555 516
556 ecore_main_loop_begin(); 517 ecore_main_loop_begin();
557
558 ecore_con_shutdown();
559} 518}
560EFL_END_TEST 519EFL_END_TEST
561 520
562void ecore_con_test_ecore_con(TCase *tc) 521void ecore_con_test_ecore_con(TCase *tc)
563{ 522{
564 tcase_add_test(tc, ecore_test_ecore_con_init);
565 tcase_add_test(tc, ecore_test_ecore_con_local_user); 523 tcase_add_test(tc, ecore_test_ecore_con_local_user);
566 tcase_add_test(tc, ecore_test_ecore_con_local_user_home); 524 tcase_add_test(tc, ecore_test_ecore_con_local_user_home);
567 tcase_add_test(tc, ecore_test_ecore_con_local_user_tmp); 525 tcase_add_test(tc, ecore_test_ecore_con_local_user_tmp);
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c b/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
index bc27f52..8cedac0 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con_eet.c
@@ -118,9 +118,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_cl)
118 int *cb_data = (int *) malloc(sizeof(int)); 118 int *cb_data = (int *) malloc(sizeof(int));
119 *cb_data = 1; 119 *cb_data = 1;
120 120
121 eina_init();
122 eet_init(); 121 eet_init();
123 ecore_con_init();
124 _ece_test_descriptor_init(); 122 _ece_test_descriptor_init();
125 123
126 svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 124 svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1",
@@ -165,9 +163,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_cl)
165 free(cb_data); 163 free(cb_data);
166 _ece_test_descriptor_shutdown(); 164 _ece_test_descriptor_shutdown();
167 ecore_con_server_del(svr); 165 ecore_con_server_del(svr);
168 ecore_con_shutdown();
169 eet_shutdown(); 166 eet_shutdown();
170 eina_shutdown();
171} 167}
172EFL_END_TEST 168EFL_END_TEST
173 169
@@ -200,9 +196,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_del)
200 int *cb_data = (int *) malloc(sizeof(int)); 196 int *cb_data = (int *) malloc(sizeof(int));
201 *cb_data = 0; 197 *cb_data = 0;
202 198
203 eina_init();
204 eet_init(); 199 eet_init();
205 ecore_con_init();
206 _ece_test_descriptor_init(); 200 _ece_test_descriptor_init();
207 201
208 svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1", 202 svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP, "127.0.0.1",
@@ -235,9 +229,7 @@ EFL_START_TEST(ecore_con_test_ecore_con_eet_svr_del)
235 229
236 free(cb_data); 230 free(cb_data);
237 _ece_test_descriptor_shutdown(); 231 _ece_test_descriptor_shutdown();
238 ecore_con_shutdown();
239 eet_shutdown(); 232 eet_shutdown();
240 eina_shutdown();
241} 233}
242EFL_END_TEST 234EFL_END_TEST
243 235
diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
index c1da064..bdf26f0 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
@@ -172,8 +172,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
172 char link[] = ECORE_CON_FTP_TEST_URL; 172 char link[] = ECORE_CON_FTP_TEST_URL;
173 char url[4096], *username, *password, *file = NULL, *dir = NULL; 173 char url[4096], *username, *password, *file = NULL, *dir = NULL;
174 174
175 ret = eina_init();
176 fail_if(ret != 1);
177 ret = ecore_con_url_init(); 175 ret = ecore_con_url_init();
178 fail_if(ret != 1); 176 fail_if(ret != 1);
179 177
@@ -196,7 +194,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_ftp_upload)
196 194
197 ret = ecore_con_url_shutdown(); 195 ret = ecore_con_url_shutdown();
198 fail_if(ret != 0); 196 fail_if(ret != 0);
199 ret = eina_shutdown();
200} 197}
201EFL_END_TEST 198EFL_END_TEST
202#endif 199#endif
@@ -212,8 +209,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_post)
212 char *username = NULL, *password = NULL; 209 char *username = NULL, *password = NULL;
213 char url[4096]; 210 char url[4096];
214 211
215 ret = eina_init();
216 fail_if(ret != 1);
217 ret = ecore_con_url_init(); 212 ret = ecore_con_url_init();
218 fail_if(ret != 1); 213 fail_if(ret != 1);
219 214
@@ -240,7 +235,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_post)
240 235
241 ret = ecore_con_url_shutdown(); 236 ret = ecore_con_url_shutdown();
242 fail_if(ret != 0); 237 fail_if(ret != 0);
243 ret = eina_shutdown();
244} 238}
245EFL_END_TEST 239EFL_END_TEST
246#endif 240#endif
@@ -257,8 +251,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_download)
257#endif 251#endif
258 char url_data[] = "test"; 252 char url_data[] = "test";
259 253
260 ret = eina_init();
261 fail_if(ret != 1);
262 ret = ecore_con_url_init(); 254 ret = ecore_con_url_init();
263 fail_if(ret != 1); 255 fail_if(ret != 1);
264 256
@@ -290,7 +282,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_download)
290 282
291 ret = ecore_con_url_shutdown(); 283 ret = ecore_con_url_shutdown();
292 fail_if(ret != 0); 284 fail_if(ret != 0);
293 ret = eina_shutdown();
294} 285}
295EFL_END_TEST 286EFL_END_TEST
296 287
@@ -299,8 +290,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_create)
299 Ecore_Con_Url *url; 290 Ecore_Con_Url *url;
300 int ret; 291 int ret;
301 292
302 ret = eina_init();
303 fail_if(ret != 1);
304 ret = ecore_con_url_init(); 293 ret = ecore_con_url_init();
305 fail_if(ret != 1); 294 fail_if(ret != 1);
306 295
@@ -311,7 +300,6 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_create)
311 300
312 ret = ecore_con_url_shutdown(); 301 ret = ecore_con_url_shutdown();
313 fail_if(ret != 0); 302 fail_if(ret != 0);
314 ret = eina_shutdown();
315} 303}
316EFL_END_TEST 304EFL_END_TEST
317 305
@@ -359,8 +347,6 @@ _ecore_con_url_cookies_test_init()
359 const char link[] = DEFAULT_LINK; 347 const char link[] = DEFAULT_LINK;
360#endif 348#endif
361 349
362 eina_init();
363 ecore_con_init();
364 ecore_con_url_init(); 350 ecore_con_url_init();
365 351
366 ec_url = ecore_con_url_new(link); 352 ec_url = ecore_con_url_new(link);
@@ -385,8 +371,6 @@ _ecore_con_url_cookies_test_shutdown(Ecore_Con_Url *ec_url, int tmpfd, Eina_Tmps
385 eina_tmpstr_del(*path); 371 eina_tmpstr_del(*path);
386 ecore_con_url_free(ec_url); 372 ecore_con_url_free(ec_url);
387 ecore_con_url_shutdown(); 373 ecore_con_url_shutdown();
388 ecore_con_shutdown();
389 eina_shutdown();
390} 374}
391 375
392EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_clear) 376EFL_START_TEST(ecore_con_test_ecore_con_url_cookies_clear)
diff --git a/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c b/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
index 477b242..a32f6ee 100644
--- a/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
+++ b/src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c
@@ -303,8 +303,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_ok)
303 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; 303 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
304 Eo *o; 304 Eo *o;
305 305
306 ecore_con_init();
307
308 addr.sin_port = htons(12345); 306 addr.sin_port = htons(12345);
309 addr.sin_addr.s_addr = htonl(0xabcdefafU); 307 addr.sin_addr.s_addr = htonl(0xabcdefafU);
310 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(), 308 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(),
@@ -330,8 +328,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_ok)
330 efl_net_ip_address_set(efl_added, slice)); 328 efl_net_ip_address_set(efl_added, slice));
331 _ipv4_check(o, &addr); 329 _ipv4_check(o, &addr);
332 efl_del(o); 330 efl_del(o);
333
334 ecore_con_shutdown();
335} 331}
336EFL_END_TEST 332EFL_END_TEST
337 333
@@ -345,8 +341,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
345 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; 341 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
346 Eo *o; 342 Eo *o;
347 343
348 ecore_con_init();
349
350 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true"); 344 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: pd->addr.sa_family == 0 is true");
351 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get()); 345 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get());
352 ck_assert_ptr_eq(o, NULL); 346 ck_assert_ptr_eq(o, NULL);
@@ -418,8 +412,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_manual_fail)
418 TRAP_ERRORS_FINISH(1); 412 TRAP_ERRORS_FINISH(1);
419 413
420 efl_del(o); 414 efl_del(o);
421
422 ecore_con_shutdown();
423} 415}
424EFL_END_TEST 416EFL_END_TEST
425 417
@@ -431,8 +423,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
431 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) }; 423 Eina_Slice slice = { .mem = &addr.sin_addr, .len = sizeof(addr.sin_addr) };
432 Eo *o; 424 Eo *o;
433 425
434 ecore_con_init();
435
436 addr.sin_port = htons(12345); 426 addr.sin_port = htons(12345);
437 addr.sin_addr.s_addr = htonl(0xabcdefafU); 427 addr.sin_addr.s_addr = htonl(0xabcdefafU);
438 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 428 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
@@ -457,7 +447,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
457 _ipv4_check(o, &addr); 447 _ipv4_check(o, &addr);
458 efl_unref(o); 448 efl_unref(o);
459 449
460 ecore_con_shutdown();
461} 450}
462EFL_END_TEST 451EFL_END_TEST
463 452
@@ -467,8 +456,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
467 Eina_Slice wrong_slice = { .mem = &c, .len = 1 }; 456 Eina_Slice wrong_slice = { .mem = &c, .len = 1 };
468 Eo *o; 457 Eo *o;
469 458
470 ecore_con_init();
471
472 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true"); 459 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true");
473 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 460 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
474 1234, 461 1234,
@@ -476,7 +463,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
476 ck_assert_ptr_eq(o, NULL); 463 ck_assert_ptr_eq(o, NULL);
477 TRAP_ERRORS_FINISH(1); 464 TRAP_ERRORS_FINISH(1);
478 465
479 ecore_con_shutdown();
480} 466}
481EFL_END_TEST 467EFL_END_TEST
482 468
@@ -487,8 +473,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok)
487 }; 473 };
488 Eo *o; 474 Eo *o;
489 475
490 ecore_con_init();
491
492 addr.sin_port = htons(12345); 476 addr.sin_port = htons(12345);
493 addr.sin_addr.s_addr = htonl(0xabcdefafU); 477 addr.sin_addr.s_addr = htonl(0xabcdefafU);
494 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 478 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr);
@@ -503,7 +487,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok)
503 _ipv4_check(o, &addr); 487 _ipv4_check(o, &addr);
504 efl_unref(o); 488 efl_unref(o);
505 489
506 ecore_con_shutdown();
507} 490}
508EFL_END_TEST 491EFL_END_TEST
509 492
@@ -514,8 +497,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
514 }; 497 };
515 Eo *o; 498 Eo *o;
516 499
517 ecore_con_init();
518
519 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL"); 500 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL");
520 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL); 501 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL);
521 ck_assert_ptr_eq(o, NULL); 502 ck_assert_ptr_eq(o, NULL);
@@ -526,7 +507,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
526 ck_assert_ptr_eq(o, NULL); 507 ck_assert_ptr_eq(o, NULL);
527 TRAP_ERRORS_FINISH(1); 508 TRAP_ERRORS_FINISH(1);
528 509
529 ecore_con_shutdown();
530} 510}
531EFL_END_TEST 511EFL_END_TEST
532 512
@@ -534,8 +514,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok)
534{ 514{
535 Eo *o; 515 Eo *o;
536 516
537 ecore_con_init();
538
539 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345"); 517 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345");
540 ck_assert_ptr_ne(o, NULL); 518 ck_assert_ptr_ne(o, NULL);
541 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1:12345"); 519 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1:12345");
@@ -556,7 +534,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok)
556 ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80"); 534 ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80");
557 efl_unref(o); 535 efl_unref(o);
558 536
559 ecore_con_shutdown();
560} 537}
561EFL_END_TEST 538EFL_END_TEST
562 539
@@ -564,8 +541,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
564{ 541{
565 Eo *o; 542 Eo *o;
566 543
567 ecore_con_init();
568
569 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL"); 544 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL");
570 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL); 545 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL);
571 ck_assert_ptr_eq(o, NULL); 546 ck_assert_ptr_eq(o, NULL);
@@ -594,7 +569,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
594 ck_assert_ptr_eq(o, NULL); 569 ck_assert_ptr_eq(o, NULL);
595 TRAP_ERRORS_FINISH(0); /* no error messages! */ 570 TRAP_ERRORS_FINISH(0); /* no error messages! */
596 571
597 ecore_con_shutdown();
598} 572}
599EFL_END_TEST 573EFL_END_TEST
600 574
@@ -602,8 +576,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
602{ 576{
603 struct resolve_ctx ctx = { }; 577 struct resolve_ctx ctx = { };
604 578
605 ecore_con_init();
606
607 _resolve(&ctx, "localhost:http", 0, 0); 579 _resolve(&ctx, "localhost:http", 0, 0);
608 _assert_found(&ctx, "127.0.0.1:80", EINA_TRUE, 0); 580 _assert_found(&ctx, "127.0.0.1:80", EINA_TRUE, 0);
609 _resolve_cleanup(&ctx); 581 _resolve_cleanup(&ctx);
@@ -632,7 +604,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_ok)
632 _assert_found(&ctx, "[::1]:80", EINA_FALSE, 0); 604 _assert_found(&ctx, "[::1]:80", EINA_FALSE, 0);
633 _resolve_cleanup(&ctx); 605 _resolve_cleanup(&ctx);
634 606
635 ecore_con_shutdown();
636} 607}
637EFL_END_TEST 608EFL_END_TEST
638 609
@@ -640,8 +611,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
640{ 611{
641 struct resolve_ctx ctx = { }; 612 struct resolve_ctx ctx = { };
642 613
643 ecore_con_init();
644
645 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL"); 614 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL");
646 ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, 615 ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS,
647 NULL, 0, 0); 616 NULL, 0, 0);
@@ -662,7 +631,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
662 _assert_found(&ctx, "[::1]:http", EINA_FALSE, EFL_NET_ERROR_COULDNT_RESOLVE_HOST); 631 _assert_found(&ctx, "[::1]:http", EINA_FALSE, EFL_NET_ERROR_COULDNT_RESOLVE_HOST);
663 _resolve_cleanup(&ctx); 632 _resolve_cleanup(&ctx);
664 633
665 ecore_con_shutdown();
666} 634}
667EFL_END_TEST 635EFL_END_TEST
668 636
@@ -691,8 +659,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
691#undef TEST 659#undef TEST
692 }; 660 };
693 661
694 ecore_con_init();
695
696 for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++) 662 for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++)
697 { 663 {
698 struct sockaddr_in a = { 664 struct sockaddr_in a = {
@@ -719,7 +685,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
719 efl_unref(o); 685 efl_unref(o);
720 } 686 }
721 687
722 ecore_con_shutdown();
723} 688}
724EFL_END_TEST 689EFL_END_TEST
725 690
@@ -769,8 +734,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_ok)
769 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; 734 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
770 Eo *o; 735 Eo *o;
771 736
772 ecore_con_init();
773
774 addr.sin6_port = htons(12345); 737 addr.sin6_port = htons(12345);
775 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 738 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
776 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(), 739 o = efl_add(EFL_NET_IP_ADDRESS_CLASS, efl_main_loop_get(),
@@ -789,7 +752,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_ok)
789 _ipv6_check(o, &addr); 752 _ipv6_check(o, &addr);
790 efl_del(o); 753 efl_del(o);
791 754
792 ecore_con_shutdown();
793} 755}
794EFL_END_TEST 756EFL_END_TEST
795 757
@@ -803,8 +765,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
803 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; 765 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
804 Eo *o; 766 Eo *o;
805 767
806 ecore_con_init();
807
808 /* generic errors checked at ecore_test_efl_net_ip_address_ipv4_manual_fail */ 768 /* generic errors checked at ecore_test_efl_net_ip_address_ipv4_manual_fail */
809 769
810 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: rw_slice.len != address.len is true"); 770 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: rw_slice.len != address.len is true");
@@ -849,7 +809,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_manual_fail)
849 809
850 efl_del(o); 810 efl_del(o);
851 811
852 ecore_con_shutdown();
853} 812}
854EFL_END_TEST 813EFL_END_TEST
855 814
@@ -861,8 +820,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
861 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) }; 820 Eina_Slice slice = { .mem = &addr.sin6_addr, .len = sizeof(addr.sin6_addr) };
862 Eo *o; 821 Eo *o;
863 822
864 ecore_con_init();
865
866 addr.sin6_port = htons(12365); 823 addr.sin6_port = htons(12365);
867 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 824 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
868 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 825 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS,
@@ -887,7 +844,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
887 _ipv6_check(o, &addr); 844 _ipv6_check(o, &addr);
888 efl_unref(o); 845 efl_unref(o);
889 846
890 ecore_con_shutdown();
891} 847}
892EFL_END_TEST 848EFL_END_TEST
893 849
@@ -898,8 +854,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok)
898 }; 854 };
899 Eo *o; 855 Eo *o;
900 856
901 ecore_con_init();
902
903 addr.sin6_port = htons(12345); 857 addr.sin6_port = htons(12345);
904 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 858 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
905 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 859 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr);
@@ -914,7 +868,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok)
914 _ipv6_check(o, &addr); 868 _ipv6_check(o, &addr);
915 efl_unref(o); 869 efl_unref(o);
916 870
917 ecore_con_shutdown();
918} 871}
919EFL_END_TEST 872EFL_END_TEST
920 873
@@ -922,8 +875,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok)
922{ 875{
923 Eo *o; 876 Eo *o;
924 877
925 ecore_con_init();
926
927 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345"); 878 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345");
928 ck_assert_ptr_ne(o, NULL); 879 ck_assert_ptr_ne(o, NULL);
929 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345"); 880 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345");
@@ -1008,7 +959,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok)
1008 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]"); 959 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]");
1009 efl_unref(o); 960 efl_unref(o);
1010 961
1011 ecore_con_shutdown();
1012} 962}
1013EFL_END_TEST 963EFL_END_TEST
1014 964
@@ -1016,8 +966,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
1016{ 966{
1017 Eo *o; 967 Eo *o;
1018 968
1019 ecore_con_init();
1020
1021 /* generic error (null ptr) checked in ipv4_parse_fail */ 969 /* generic error (null ptr) checked in ipv4_parse_fail */
1022 970
1023 /* incomplete numbers */ 971 /* incomplete numbers */
@@ -1037,7 +985,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
1037 ck_assert_ptr_eq(o, NULL); 985 ck_assert_ptr_eq(o, NULL);
1038 TRAP_ERRORS_FINISH(0); /* no error messages! */ 986 TRAP_ERRORS_FINISH(0); /* no error messages! */
1039 987
1040 ecore_con_shutdown();
1041} 988}
1042EFL_END_TEST 989EFL_END_TEST
1043 990
@@ -1136,8 +1083,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
1136 char buf[4096]; 1083 char buf[4096];
1137 const char *localhost_str; 1084 const char *localhost_str;
1138 1085
1139 ecore_con_init();
1140
1141 localhost_str = _ipv6_localhost_check(); 1086 localhost_str = _ipv6_localhost_check();
1142 1087
1143 if (localhost_str) 1088 if (localhost_str)
@@ -1183,7 +1128,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_ok)
1183 _resolve_cleanup(&ctx); 1128 _resolve_cleanup(&ctx);
1184 } 1129 }
1185 1130
1186 ecore_con_shutdown();
1187} 1131}
1188EFL_END_TEST 1132EFL_END_TEST
1189 1133
@@ -1191,8 +1135,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
1191{ 1135{
1192 struct resolve_ctx ctx = { }; 1136 struct resolve_ctx ctx = { };
1193 1137
1194 ecore_con_init();
1195
1196 /* generic checks at ipv4_resolve_fail */ 1138 /* generic checks at ipv4_resolve_fail */
1197 1139
1198#if defined(AI_V4MAPPED) && (AI_V4MAPPED > 0) 1140#if defined(AI_V4MAPPED) && (AI_V4MAPPED > 0)
@@ -1201,7 +1143,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_resolve_fail)
1201 _resolve_cleanup(&ctx); 1143 _resolve_cleanup(&ctx);
1202#endif 1144#endif
1203 1145
1204 ecore_con_shutdown();
1205} 1146}
1206EFL_END_TEST 1147EFL_END_TEST
1207 1148
@@ -1221,8 +1162,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
1221#undef TEST 1162#undef TEST
1222 }; 1163 };
1223 1164
1224 ecore_con_init();
1225
1226 for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++) 1165 for (itr = tests; itr < tests + sizeof(tests)/sizeof(tests[0]); itr++)
1227 { 1166 {
1228 struct sockaddr_in6 a = { 1167 struct sockaddr_in6 a = {
@@ -1256,7 +1195,6 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
1256 efl_unref(o); 1195 efl_unref(o);
1257 } 1196 }
1258 1197
1259 ecore_con_shutdown();
1260} 1198}
1261EFL_END_TEST 1199EFL_END_TEST
1262 1200