diff options
Diffstat (limited to 'tests/INET_Addr_Test.cpp')
-rw-r--r-- | tests/INET_Addr_Test.cpp | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/tests/INET_Addr_Test.cpp b/tests/INET_Addr_Test.cpp index e8a88293ae9..f0d69907248 100644 --- a/tests/INET_Addr_Test.cpp +++ b/tests/INET_Addr_Test.cpp @@ -23,37 +23,6 @@ #include "ace/INET_Addr.h" #include "ace/Log_Msg.h" -// Make sure that ACE_Addr::addr_type_ is the same -// as the family of the inet_addr_. -int check_type_consistency (const ACE_INET_Addr &addr) -{ - int family = -1; - - if (addr.get_type () == AF_INET) - { - struct sockaddr_in *sa4 = (struct sockaddr_in *)addr.get_addr(); - family = sa4->sin_family; - } -#if defined (ACE_HAS_IPV6) - else if (addr.get_type () == AF_INET6) - { - struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)addr.get_addr(); - family = sa6->sin6_family; - } -#endif - - if (addr.get_type () != family) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Inconsistency between ACE_SOCK::addr_type_ (%d) ") - ACE_TEXT ("and the sockaddr family (%d)\n"), - addr.get_type (), - family)); - return 1; - } - return 0; -} - int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { @@ -69,7 +38,6 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) }; ACE_INET_Addr addr; - status |= check_type_consistency (addr); for (int i=0; ipv4_addresses[i] != 0; i++) { struct in_addr addrv4; @@ -80,7 +48,6 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_OS::memcpy (&addr32, &addrv4, sizeof (addr32)); addr.set (80, ipv4_addresses[i]); - status |= check_type_consistency (addr); /* ** Now check to make sure get_ip_address matches and get_host_addr @@ -110,7 +77,6 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Clear out the address by setting it to 1 and check addr.set (0, ACE_UINT32 (1), 1); - status |= check_type_consistency (addr); if (addr.get_ip_address () != 1) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("Failed to set address to 1\n"))); @@ -120,8 +86,6 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Now set the address using a 32 bit number and check that we get // the right string out of get_host_addr(). addr.set (80, addr32, 0); // addr32 is already in network byte order - status |= check_type_consistency(addr); - if (0 != ACE_OS::strcmp (addr.get_host_addr (), ipv4_addresses[i])) { ACE_ERROR ((LM_ERROR, @@ -132,33 +96,6 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ipv4_addresses[i])); status = 1; } - - // Test for ACE_INET_Addr::set_addr(). - struct sockaddr_in sa4; - sa4.sin_family = AF_INET; - sa4.sin_addr = addrv4; - sa4.sin_port = ACE_HTONS(8080); - - addr.set (0, ACE_UINT32 (1), 1); - addr.set_addr (&sa4, sizeof(sa4)); - status |= check_type_consistency (addr); - - if (addr.get_port_number () != 8080) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::set_addr() ") - ACE_TEXT ("failed to update port number.\n"))); - status = 1; - } - - if (addr.get_ip_address () != ACE_HTONL (addr32)) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("ACE_INET_Addr::set_addr() ") - ACE_TEXT ("failed to update address.\n"))); - status = 1; - } - } #if defined (ACE_HAS_IPV6) @@ -175,7 +112,6 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) for (int i=0; ipv6_addresses[i] != 0; i++) { ACE_INET_Addr addr (80, ipv6_addresses[i]); - status |= check_type_consistency (addr); if (0 != ACE_OS::strcmp (addr.get_host_addr (), ipv6_addresses[i])) { |