X-Git-Url: https://git.llucax.com/software/posixx.git/blobdiff_plain/7b35c34eaa3ee421eb5effc63801aeff69a9ffe8..808b1eca4692bb7d76270d992e1c62f4df85939f:/test/socket/inet/common.hpp diff --git a/test/socket/inet/common.hpp b/test/socket/inet/common.hpp index 5dd8612..4829557 100644 --- a/test/socket/inet/common.hpp +++ b/test/socket/inet/common.hpp @@ -2,6 +2,7 @@ #define TEST_SOCKET_IP_COMMON_HPP_ #include // posixx::socket::inet +#include // address ostream formatting #include // posixx::socket::opt::REUSEADDR #include // std::ostream @@ -9,15 +10,6 @@ #define PORT1 10001 #define PORT2 10002 -static inline -std::ostream& operator << (std::ostream& os, - const posixx::socket::inet::sockaddr& sa) throw() -{ - return os << "inet::sockaddr(family=" << sa.sin_family - << ", port=" << ntohs(sa.sin_port) - << ", addr=" << inet_ntoa(sa.sin_addr) << ")"; -} - static inline void clean_test_address(posixx::socket::inet::socket& socket, const posixx::socket::inet::sockaddr& addr) @@ -26,7 +18,7 @@ void clean_test_address(posixx::socket::inet::socket& socket, socket.opt< posixx::socket::opt::REUSEADDR >(true); } -static posixx::socket::inet::sockaddr test_address1(PORT1, IP); -static posixx::socket::inet::sockaddr test_address2(PORT2, IP); +static posixx::socket::inet::sockaddr test_address1(IP, PORT1); +static posixx::socket::inet::sockaddr test_address2(IP, PORT2); #endif // TEST_SOCKET_IP_COMMON_HPP_