summaryrefslogtreecommitdiff
path: root/src/tests/ecore_con
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-09 18:45:27 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-13 16:59:58 +0100
commit37d2d378ec2e2d1f9a3941372ef4d818996291c7 (patch)
treee100879fbdc9ce0d2ce810be81977be97125603b /src/tests/ecore_con
parent3b2a5a429be16e5b8e5d322b7a077a2c849586b8 (diff)
eolian: drop class function overriding
Until this commit eo did class functions as part of the vtable, which enabled those functions to be overwritten in classes inheriting another class. However in task T7675 we decided that this is not really good for bindings, as most OOP languages do not support this sort of feature. After this commit eolian realizes class function completly outside of the vtable, the c-symbol that is the class funciton is now just directly redirecting to a implementation, without the involvement of the vtable. This also means a change to the syntax created by eo: Calling before: class_function(CLASS_A); Calling after: class_function(); Implementation before: class_function(const Eo *obj, void *pd) { ... } Implementation after: class_function(void) { ... } This fixes T7675. Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br> Reviewed-by: Daniel Kolesa <daniel@octaforge.org> Differential Revision: https://phab.enlightenment.org/D7901
Diffstat (limited to 'src/tests/ecore_con')
-rw-r--r--src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c92
1 files changed, 46 insertions, 46 deletions
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 1a150ff..cf83eaf 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
@@ -236,7 +236,7 @@ _resolve_done(void *data, const Eina_Value v, const Eina_Future *dead_future EIN
236static void 236static void
237_resolve(struct resolve_ctx *ctx, const char *address, int family, int flags) 237_resolve(struct resolve_ctx *ctx, const char *address, int family, int flags)
238{ 238{
239 ctx->future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, 239 ctx->future = efl_net_ip_address_resolve(
240 address, family, flags); 240 address, family, flags);
241 ck_assert_ptr_ne(ctx->future, NULL); 241 ck_assert_ptr_ne(ctx->future, NULL);
242 ctx->future = eina_future_then(ctx->future, _resolve_done, ctx, NULL); 242 ctx->future = eina_future_then(ctx->future, _resolve_done, ctx, NULL);
@@ -402,7 +402,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
402 402
403 addr.sin_port = eina_htons(12345); 403 addr.sin_port = eina_htons(12345);
404 addr.sin_addr.s_addr = eina_htonl(0xabcdefafU); 404 addr.sin_addr.s_addr = eina_htonl(0xabcdefafU);
405 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 405 o = efl_net_ip_address_create(
406 eina_ntohs(addr.sin_port), 406 eina_ntohs(addr.sin_port),
407 slice); 407 slice);
408 _ipv4_check(o, &addr); 408 _ipv4_check(o, &addr);
@@ -410,7 +410,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
410 410
411 addr.sin_port = eina_htons(8081); 411 addr.sin_port = eina_htons(8081);
412 addr.sin_addr.s_addr = eina_htonl(0); 412 addr.sin_addr.s_addr = eina_htonl(0);
413 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 413 o = efl_net_ip_address_create(
414 eina_ntohs(addr.sin_port), 414 eina_ntohs(addr.sin_port),
415 slice); 415 slice);
416 _ipv4_check(o, &addr); 416 _ipv4_check(o, &addr);
@@ -418,7 +418,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_ok)
418 418
419 addr.sin_port = eina_htons(0); 419 addr.sin_port = eina_htons(0);
420 addr.sin_addr.s_addr = eina_htonl(0x12345678); 420 addr.sin_addr.s_addr = eina_htonl(0x12345678);
421 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 421 o = efl_net_ip_address_create(
422 eina_ntohs(addr.sin_port), 422 eina_ntohs(addr.sin_port),
423 slice); 423 slice);
424 _ipv4_check(o, &addr); 424 _ipv4_check(o, &addr);
@@ -434,7 +434,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_fail)
434 Eo *o; 434 Eo *o;
435 435
436 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true"); 436 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address.len != 4 && address.len != 16 is true");
437 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 437 o = efl_net_ip_address_create(
438 1234, 438 1234,
439 wrong_slice); 439 wrong_slice);
440 ck_assert_ptr_eq(o, NULL); 440 ck_assert_ptr_eq(o, NULL);
@@ -452,14 +452,14 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_ok)
452 452
453 addr.sin_port = eina_htons(12345); 453 addr.sin_port = eina_htons(12345);
454 addr.sin_addr.s_addr = eina_htonl(0xabcdefafU); 454 addr.sin_addr.s_addr = eina_htonl(0xabcdefafU);
455 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 455 o = efl_net_ip_address_create_sockaddr(&addr);
456 ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o)); 456 ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o));
457 _ipv4_check(o, &addr); 457 _ipv4_check(o, &addr);
458 efl_unref(o); 458 efl_unref(o);
459 459
460 addr.sin_port = eina_htons(0); 460 addr.sin_port = eina_htons(0);
461 addr.sin_addr.s_addr = eina_htonl(0); 461 addr.sin_addr.s_addr = eina_htonl(0);
462 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 462 o = efl_net_ip_address_create_sockaddr(&addr);
463 ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o)); 463 ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o));
464 _ipv4_check(o, &addr); 464 _ipv4_check(o, &addr);
465 efl_unref(o); 465 efl_unref(o);
@@ -475,12 +475,12 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_create_sockaddr_fail)
475 Eo *o; 475 Eo *o;
476 476
477 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL"); 477 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: sockaddr == NULL");
478 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, NULL); 478 o = efl_net_ip_address_create_sockaddr(NULL);
479 ck_assert_ptr_eq(o, NULL); 479 ck_assert_ptr_eq(o, NULL);
480 TRAP_ERRORS_FINISH(1); 480 TRAP_ERRORS_FINISH(1);
481 481
482 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: (sockaddr->sa_family != AF_INET) && (sockaddr->sa_family != AF_INET6) is true"); 482 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: (sockaddr->sa_family != AF_INET) && (sockaddr->sa_family != AF_INET6) is true");
483 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 483 o = efl_net_ip_address_create_sockaddr(&addr);
484 ck_assert_ptr_eq(o, NULL); 484 ck_assert_ptr_eq(o, NULL);
485 TRAP_ERRORS_FINISH(1); 485 TRAP_ERRORS_FINISH(1);
486 486
@@ -491,22 +491,22 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_ok)
491{ 491{
492 Eo *o; 492 Eo *o;
493 493
494 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:12345"); 494 o = efl_net_ip_address_parse( "127.0.0.1:12345");
495 ck_assert_ptr_ne(o, NULL); 495 ck_assert_ptr_ne(o, NULL);
496 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1:12345"); 496 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1:12345");
497 efl_unref(o); 497 efl_unref(o);
498 498
499 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:0"); 499 o = efl_net_ip_address_parse( "127.0.0.1:0");
500 ck_assert_ptr_ne(o, NULL); 500 ck_assert_ptr_ne(o, NULL);
501 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1"); 501 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1");
502 efl_unref(o); 502 efl_unref(o);
503 503
504 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1"); 504 o = efl_net_ip_address_parse( "127.0.0.1");
505 ck_assert_ptr_ne(o, NULL); 505 ck_assert_ptr_ne(o, NULL);
506 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1"); 506 ck_assert_str_eq(efl_net_ip_address_string_get(o), "127.0.0.1");
507 efl_unref(o); 507 efl_unref(o);
508 508
509 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "192.168.0.123:80"); 509 o = efl_net_ip_address_parse( "192.168.0.123:80");
510 ck_assert_ptr_ne(o, NULL); 510 ck_assert_ptr_ne(o, NULL);
511 ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80"); 511 ck_assert_str_eq(efl_net_ip_address_string_get(o), "192.168.0.123:80");
512 efl_unref(o); 512 efl_unref(o);
@@ -519,30 +519,30 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_parse_fail)
519 Eo *o; 519 Eo *o;
520 520
521 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL"); 521 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: numeric_address == NULL");
522 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, NULL); 522 o = efl_net_ip_address_parse( NULL);
523 ck_assert_ptr_eq(o, NULL); 523 ck_assert_ptr_eq(o, NULL);
524 TRAP_ERRORS_FINISH(1); 524 TRAP_ERRORS_FINISH(1);
525 525
526 /* incomplete numbers */ 526 /* incomplete numbers */
527 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); 527 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL);
528 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127."); 528 o = efl_net_ip_address_parse( "127.");
529 ck_assert_ptr_eq(o, NULL); 529 ck_assert_ptr_eq(o, NULL);
530 TRAP_ERRORS_FINISH(0); /* no error messages! */ 530 TRAP_ERRORS_FINISH(0); /* no error messages! */
531 531
532 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); 532 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL);
533 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0."); 533 o = efl_net_ip_address_parse( "127.0.0.");
534 ck_assert_ptr_eq(o, NULL); 534 ck_assert_ptr_eq(o, NULL);
535 TRAP_ERRORS_FINISH(0); /* no error messages! */ 535 TRAP_ERRORS_FINISH(0); /* no error messages! */
536 536
537 /* hostnames are not numeric, shouldn't return an object */ 537 /* hostnames are not numeric, shouldn't return an object */
538 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); 538 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL);
539 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "google.com"); 539 o = efl_net_ip_address_parse( "google.com");
540 ck_assert_ptr_eq(o, NULL); 540 ck_assert_ptr_eq(o, NULL);
541 TRAP_ERRORS_FINISH(0); /* no error messages! */ 541 TRAP_ERRORS_FINISH(0); /* no error messages! */
542 542
543 /* port names are not numeric, shouldn't return an object */ 543 /* port names are not numeric, shouldn't return an object */
544 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); 544 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL);
545 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "127.0.0.1:http"); 545 o = efl_net_ip_address_parse( "127.0.0.1:http");
546 ck_assert_ptr_eq(o, NULL); 546 ck_assert_ptr_eq(o, NULL);
547 TRAP_ERRORS_FINISH(0); /* no error messages! */ 547 TRAP_ERRORS_FINISH(0); /* no error messages! */
548 548
@@ -589,13 +589,13 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_resolve_fail)
589 struct resolve_ctx ctx = { }; 589 struct resolve_ctx ctx = { };
590 590
591 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL"); 591 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: address == NULL");
592 ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, 592 ctx.future = efl_net_ip_address_resolve(
593 NULL, 0, 0); 593 NULL, 0, 0);
594 ck_assert_ptr_eq(ctx.future, NULL); 594 ck_assert_ptr_eq(ctx.future, NULL);
595 TRAP_ERRORS_FINISH(1); 595 TRAP_ERRORS_FINISH(1);
596 596
597 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: (family != AF_UNSPEC) && (family != AF_INET) && (family != AF_INET6) is true"); 597 TRAP_ERRORS_BEGIN(eina_safety, ERR, "safety check failed: (family != AF_UNSPEC) && (family != AF_INET) && (family != AF_INET6) is true");
598 ctx.future = efl_net_ip_address_resolve(EFL_NET_IP_ADDRESS_CLASS, 598 ctx.future = efl_net_ip_address_resolve(
599 "localhost", 1234, 0); 599 "localhost", 1234, 0);
600 ck_assert_ptr_eq(ctx.future, NULL); 600 ck_assert_ptr_eq(ctx.future, NULL);
601 TRAP_ERRORS_FINISH(1); 601 TRAP_ERRORS_FINISH(1);
@@ -643,7 +643,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv4_checks)
643 .sin_port = 0, 643 .sin_port = 0,
644 .sin_addr.s_addr = eina_htonl(itr->addr), 644 .sin_addr.s_addr = eina_htonl(itr->addr),
645 }; 645 };
646 Eo *o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &a); 646 Eo *o = efl_net_ip_address_create_sockaddr(&a);
647 ck_assert_ptr_ne(o, NULL); 647 ck_assert_ptr_ne(o, NULL);
648 648
649 ck_assert_int_eq(efl_net_ip_address_ipv4_class_a_check(o), itr->is_a); 649 ck_assert_int_eq(efl_net_ip_address_ipv4_class_a_check(o), itr->is_a);
@@ -799,7 +799,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
799 799
800 addr.sin6_port = eina_htons(12365); 800 addr.sin6_port = eina_htons(12365);
801 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 801 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
802 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 802 o = efl_net_ip_address_create(
803 eina_ntohs(addr.sin6_port), 803 eina_ntohs(addr.sin6_port),
804 slice); 804 slice);
805 _ipv6_check(o, &addr); 805 _ipv6_check(o, &addr);
@@ -807,7 +807,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
807 807
808 addr.sin6_port = eina_htons(8081); 808 addr.sin6_port = eina_htons(8081);
809 _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0); 809 _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0);
810 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 810 o = efl_net_ip_address_create(
811 eina_ntohs(addr.sin6_port), 811 eina_ntohs(addr.sin6_port),
812 slice); 812 slice);
813 _ipv6_check(o, &addr); 813 _ipv6_check(o, &addr);
@@ -815,7 +815,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_ok)
815 815
816 addr.sin6_port = eina_htons(0); 816 addr.sin6_port = eina_htons(0);
817 _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 1); 817 _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 1);
818 o = efl_net_ip_address_create(EFL_NET_IP_ADDRESS_CLASS, 818 o = efl_net_ip_address_create(
819 eina_ntohs(addr.sin6_port), 819 eina_ntohs(addr.sin6_port),
820 slice); 820 slice);
821 _ipv6_check(o, &addr); 821 _ipv6_check(o, &addr);
@@ -833,14 +833,14 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_create_sockaddr_ok)
833 833
834 addr.sin6_port = eina_htons(12345); 834 addr.sin6_port = eina_htons(12345);
835 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8); 835 _ipv6_set(&addr, 1, 2, 3, 4, 5, 6, 7, 8);
836 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 836 o = efl_net_ip_address_create_sockaddr(&addr);
837 ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o)); 837 ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o));
838 _ipv6_check(o, &addr); 838 _ipv6_check(o, &addr);
839 efl_unref(o); 839 efl_unref(o);
840 840
841 addr.sin6_port = eina_htons(0); 841 addr.sin6_port = eina_htons(0);
842 _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0); 842 _ipv6_set(&addr, 0, 0, 0, 0, 0, 0, 0, 0);
843 o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &addr); 843 o = efl_net_ip_address_create_sockaddr(&addr);
844 ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o)); 844 ck_assert_ptr_ne(&addr, efl_net_ip_address_sockaddr_get(o));
845 _ipv6_check(o, &addr); 845 _ipv6_check(o, &addr);
846 efl_unref(o); 846 efl_unref(o);
@@ -852,86 +852,86 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_ok)
852{ 852{
853 Eo *o; 853 Eo *o;
854 854
855 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:12345"); 855 o = efl_net_ip_address_parse( "[::1]:12345");
856 ck_assert_ptr_ne(o, NULL); 856 ck_assert_ptr_ne(o, NULL);
857 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345"); 857 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]:12345");
858 efl_unref(o); 858 efl_unref(o);
859 859
860 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:0"); 860 o = efl_net_ip_address_parse( "[::1]:0");
861 ck_assert_ptr_ne(o, NULL); 861 ck_assert_ptr_ne(o, NULL);
862 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]"); 862 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]");
863 efl_unref(o); 863 efl_unref(o);
864 864
865 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]"); 865 o = efl_net_ip_address_parse( "[::1]");
866 ck_assert_ptr_ne(o, NULL); 866 ck_assert_ptr_ne(o, NULL);
867 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]"); 867 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]");
868 efl_unref(o); 868 efl_unref(o);
869 869
870 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "::1"); 870 o = efl_net_ip_address_parse( "::1");
871 ck_assert_ptr_ne(o, NULL); 871 ck_assert_ptr_ne(o, NULL);
872 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]"); 872 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::1]");
873 efl_unref(o); 873 efl_unref(o);
874 874
875 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]:12345"); 875 o = efl_net_ip_address_parse( "[::]:12345");
876 ck_assert_ptr_ne(o, NULL); 876 ck_assert_ptr_ne(o, NULL);
877 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]:12345"); 877 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]:12345");
878 efl_unref(o); 878 efl_unref(o);
879 879
880 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]:0"); 880 o = efl_net_ip_address_parse( "[::]:0");
881 ck_assert_ptr_ne(o, NULL); 881 ck_assert_ptr_ne(o, NULL);
882 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]"); 882 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]");
883 efl_unref(o); 883 efl_unref(o);
884 884
885 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::]"); 885 o = efl_net_ip_address_parse( "[::]");
886 ck_assert_ptr_ne(o, NULL); 886 ck_assert_ptr_ne(o, NULL);
887 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]"); 887 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]");
888 efl_unref(o); 888 efl_unref(o);
889 889
890 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "::"); 890 o = efl_net_ip_address_parse( "::");
891 ck_assert_ptr_ne(o, NULL); 891 ck_assert_ptr_ne(o, NULL);
892 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]"); 892 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::]");
893 efl_unref(o); 893 efl_unref(o);
894 894
895 /* IPv4 Mapped */ 895 /* IPv4 Mapped */
896 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::ffff:192.168.0.1]:12345"); 896 o = efl_net_ip_address_parse( "[::ffff:192.168.0.1]:12345");
897 ck_assert_ptr_ne(o, NULL); 897 ck_assert_ptr_ne(o, NULL);
898 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::ffff:192.168.0.1]:12345"); 898 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::ffff:192.168.0.1]:12345");
899 efl_unref(o); 899 efl_unref(o);
900 900
901 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::ffff:192.168.0.1]"); 901 o = efl_net_ip_address_parse( "[::ffff:192.168.0.1]");
902 ck_assert_ptr_ne(o, NULL); 902 ck_assert_ptr_ne(o, NULL);
903 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::ffff:192.168.0.1]"); 903 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::ffff:192.168.0.1]");
904 efl_unref(o); 904 efl_unref(o);
905 905
906 /* IPv4 Compatible */ 906 /* IPv4 Compatible */
907 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::192.168.0.1]:12345"); 907 o = efl_net_ip_address_parse( "[::192.168.0.1]:12345");
908 ck_assert_ptr_ne(o, NULL); 908 ck_assert_ptr_ne(o, NULL);
909 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::192.168.0.1]:12345"); 909 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::192.168.0.1]:12345");
910 efl_unref(o); 910 efl_unref(o);
911 911
912 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::192.168.0.1]"); 912 o = efl_net_ip_address_parse( "[::192.168.0.1]");
913 ck_assert_ptr_ne(o, NULL); 913 ck_assert_ptr_ne(o, NULL);
914 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::192.168.0.1]"); 914 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[::192.168.0.1]");
915 efl_unref(o); 915 efl_unref(o);
916 916
917 /* Link Local */ 917 /* Link Local */
918 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fe80::1]:12345"); 918 o = efl_net_ip_address_parse( "[fe80::1]:12345");
919 ck_assert_ptr_ne(o, NULL); 919 ck_assert_ptr_ne(o, NULL);
920 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fe80::1]:12345"); 920 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fe80::1]:12345");
921 efl_unref(o); 921 efl_unref(o);
922 922
923 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fe80::1]"); 923 o = efl_net_ip_address_parse( "[fe80::1]");
924 ck_assert_ptr_ne(o, NULL); 924 ck_assert_ptr_ne(o, NULL);
925 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fe80::1]"); 925 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fe80::1]");
926 efl_unref(o); 926 efl_unref(o);
927 927
928 /* Site Local */ 928 /* Site Local */
929 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fc00::1]:12345"); 929 o = efl_net_ip_address_parse( "[fc00::1]:12345");
930 ck_assert_ptr_ne(o, NULL); 930 ck_assert_ptr_ne(o, NULL);
931 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]:12345"); 931 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]:12345");
932 efl_unref(o); 932 efl_unref(o);
933 933
934 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[fc00::1]"); 934 o = efl_net_ip_address_parse( "[fc00::1]");
935 ck_assert_ptr_ne(o, NULL); 935 ck_assert_ptr_ne(o, NULL);
936 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]"); 936 ck_assert_str_eq(efl_net_ip_address_string_get(o), "[fc00::1]");
937 efl_unref(o); 937 efl_unref(o);
@@ -947,18 +947,18 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_parse_fail)
947 947
948 /* incomplete numbers */ 948 /* incomplete numbers */
949 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); 949 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL);
950 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "::9999999"); 950 o = efl_net_ip_address_parse( "::9999999");
951 ck_assert_ptr_eq(o, NULL); 951 ck_assert_ptr_eq(o, NULL);
952 TRAP_ERRORS_FINISH(0); /* no error messages! */ 952 TRAP_ERRORS_FINISH(0); /* no error messages! */
953 953
954 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); 954 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL);
955 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "ab:cd:ef:gh"); 955 o = efl_net_ip_address_parse( "ab:cd:ef:gh");
956 ck_assert_ptr_eq(o, NULL); 956 ck_assert_ptr_eq(o, NULL);
957 TRAP_ERRORS_FINISH(0); /* no error messages! */ 957 TRAP_ERRORS_FINISH(0); /* no error messages! */
958 958
959 /* port names are not numeric, shouldn't return an object */ 959 /* port names are not numeric, shouldn't return an object */
960 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL); 960 TRAP_ERRORS_BEGIN(eina_safety, ERR, NULL);
961 o = efl_net_ip_address_parse(EFL_NET_IP_ADDRESS_CLASS, "[::1]:http"); 961 o = efl_net_ip_address_parse( "[::1]:http");
962 ck_assert_ptr_eq(o, NULL); 962 ck_assert_ptr_eq(o, NULL);
963 TRAP_ERRORS_FINISH(0); /* no error messages! */ 963 TRAP_ERRORS_FINISH(0); /* no error messages! */
964 964
@@ -1152,7 +1152,7 @@ EFL_START_TEST(ecore_test_efl_net_ip_address_ipv6_checks)
1152 r = inet_pton(AF_INET6, itr->str, ia); 1152 r = inet_pton(AF_INET6, itr->str, ia);
1153 ck_assert_int_eq(r, 1); 1153 ck_assert_int_eq(r, 1);
1154 1154
1155 Eo *o = efl_net_ip_address_create_sockaddr(EFL_NET_IP_ADDRESS_CLASS, &a); 1155 Eo *o = efl_net_ip_address_create_sockaddr(&a);
1156 ck_assert_ptr_ne(o, NULL); 1156 ck_assert_ptr_ne(o, NULL);
1157 1157
1158 ck_assert_int_eq(efl_net_ip_address_ipv4_class_a_check(o), EINA_FALSE); 1158 ck_assert_int_eq(efl_net_ip_address_ipv4_class_a_check(o), EINA_FALSE);