From: g0dil Date: Mon, 7 Sep 2009 17:51:06 +0000 (+0000) Subject: Socket/Protocols/INet: Fix unit-test bind/connect race X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=847b1f511f9a30c72496430bdc9be2e67b9f338b;p=senf.git Socket/Protocols/INet: Fix unit-test bind/connect race git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1395 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Socket/Protocols/INet/TCPSocketHandle.test.cc b/senf/Socket/Protocols/INet/TCPSocketHandle.test.cc index f323450..889a139 100644 --- a/senf/Socket/Protocols/INet/TCPSocketHandle.test.cc +++ b/senf/Socket/Protocols/INet/TCPSocketHandle.test.cc @@ -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() ); diff --git a/senf/Socket/Protocols/INet/net.test.hh b/senf/Socket/Protocols/INet/net.test.hh index bf398da..9f94c8f 100644 --- a/senf/Socket/Protocols/INet/net.test.hh +++ b/senf/Socket/Protocols/INet/net.test.hh @@ -61,6 +61,7 @@ namespace { _exit(0); } signal(SIGCHLD, SIG_DFL); + sleep(1); } void wait()