]> git.saurik.com Git - wxWidgets.git/commitdiff
make the test really use the event loop in its second half (this already was the...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Dec 2008 11:12:47 +0000 (11:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Dec 2008 11:12:47 +0000 (11:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57582 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/net/socket.cpp

index 80318efb0b146d2a70afb9224f8891d1e32a987d..e571a566bfa446e3ee230ffa6a43ae28ebf7771a 100644 (file)
@@ -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() )