]> git.llucax.com Git - software/posixx.git/blobdiff - test/socket/inet/common.hpp
Add SUB_CANCEL to tipc::subscr_t
[software/posixx.git] / test / socket / inet / common.hpp
index 5dd8612f7de05db4574478bbb1048f083916b0c6..4829557c5aeaad0c8f4854532ee2a0f60d661b81 100644 (file)
@@ -2,6 +2,7 @@
 #define TEST_SOCKET_IP_COMMON_HPP_
 
 #include <posixx/socket/inet.hpp> // posixx::socket::inet
+#include <posixx/socket/inet/print.hpp> // address ostream formatting
 #include <posixx/socket/opt.hpp> // posixx::socket::opt::REUSEADDR
 #include <ostream> // 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_