Socket/Protocols/INet: Fix unit-test bind/connect race
g0dil [Mon, 7 Sep 2009 17:51:06 +0000 (17:51 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1395 270642c3-0616-0410-b53a-bc976706d245

senf/Socket/Protocols/INet/TCPSocketHandle.test.cc
senf/Socket/Protocols/INet/net.test.hh

index f323450..889a139 100644 (file)
@@ -122,8 +122,8 @@ BOOST_AUTO_UNIT_TEST(tcpv4ClientSocketHandle)
         alarm(10);
         start(server_v4);
         senf::TCPv4ClientSocketHandle sock;
-        SENF_CHECK_NO_THROW( sock.bind(senf::INet4SocketAddress(localhost4str(1)) );
-                             SENF_CHECK_NO_THROW( sock.connect(senf::INet4SocketAddress(localhost4str(0)))) );
+        SENF_CHECK_NO_THROW( sock.bind(senf::INet4SocketAddress(localhost4str(1))) );
+        SENF_CHECK_NO_THROW( sock.connect(senf::INet4SocketAddress(localhost4str(0))) );
         BOOST_CHECK( sock.peer() == senf::INet4SocketAddress(localhost4str(0)) );
         BOOST_CHECK( sock.local() == senf::INet4SocketAddress(localhost4str(1)) );
         BOOST_CHECK( sock.blocking() );
index bf398da..9f94c8f 100644 (file)
@@ -61,6 +61,7 @@ namespace {
             _exit(0);
         }
         signal(SIGCHLD, SIG_DFL);
+        sleep(1);
     }
 
     void wait()