From: Vadim Zeitlin Date: Sat, 27 Dec 2008 11:12:47 +0000 (+0000) Subject: make the test really use the event loop in its second half (this already was the... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8d8087fc9b1ab1403b17104c509f834083a48fc7 make the test really use the event loop in its second half (this already was the intention before but it didn't work correctly) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57582 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/tests/net/socket.cpp b/tests/net/socket.cpp index 80318efb0b..e571a566bf 100644 --- a/tests/net/socket.cpp +++ b/tests/net/socket.cpp @@ -37,7 +37,7 @@ static wxString gs_serverHost(wxGetenv("WX_TEST_SERVER")); class SocketTestCase : public CppUnit::TestCase { public: - SocketTestCase() { m_useLoop = false; } + SocketTestCase() { } private: // we need to repeat the tests twice as the sockets behave differently when @@ -86,7 +86,7 @@ private: // disabled wxSocketClientPtr GetHTTPSocket(int flags = wxSOCKET_NONE) const; - void PseudoTest_SetUseEventLoop() { m_useLoop = true; } + void PseudoTest_SetUseEventLoop() { ms_useLoop = true; } void BlockingConnect(); void NonblockingConnect(); @@ -95,11 +95,13 @@ private: void ReadNowait(); void ReadWaitall(); - bool m_useLoop; + static bool ms_useLoop; DECLARE_NO_COPY_CLASS(SocketTestCase) }; +bool SocketTestCase::ms_useLoop = false; + CPPUNIT_TEST_SUITE_REGISTRATION( SocketTestCase ); CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SocketTestCase, "SocketTestCase" ); @@ -151,7 +153,7 @@ void SocketTestCase::NonblockingConnect() if ( !addr.get() ) return; - SocketTestEventLoop loop(m_useLoop); + SocketTestEventLoop loop(ms_useLoop); wxSocketClient sock; sock.Connect(*addr, false); @@ -162,7 +164,7 @@ void SocketTestCase::NonblockingConnect() void SocketTestCase::ReadNormal() { - SocketTestEventLoop loop(m_useLoop); + SocketTestEventLoop loop(ms_useLoop); wxSocketClientPtr sock(GetHTTPSocket()); if ( !sock.get() ) @@ -218,7 +220,7 @@ void SocketTestCase::ReadNowait() void SocketTestCase::ReadWaitall() { - SocketTestEventLoop loop(m_useLoop); + SocketTestEventLoop loop(ms_useLoop); wxSocketClientPtr sock(GetHTTPSocket(wxSOCKET_WAITALL)); if ( !sock.get() )