summaryrefslogtreecommitdiff
path: root/src/tests/ecore_con/ecore_con_test_ecore_con.c
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/ecore_con_test_ecore_con.c
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/ecore_con_test_ecore_con.c')
-rw-r--r--src/tests/ecore_con/ecore_con_test_ecore_con.c44
1 files changed, 1 insertions, 43 deletions
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 df481bc6ce..86323a4bd5 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);