X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68888eeaa8d84ed54ff8854110f488ad1c5054e9..04a123c642b0fc589e29cdd507faf11b85973f79:/tests/net/socket.cpp?ds=sidebyside diff --git a/tests/net/socket.cpp b/tests/net/socket.cpp index 5928915e41..3532618f8c 100644 --- a/tests/net/socket.cpp +++ b/tests/net/socket.cpp @@ -4,7 +4,7 @@ // Author: Vadim Zeitlin // RCS-ID: $Id$ // Copyright: (c) 2008 Vadim Zeitlin -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /* @@ -68,17 +68,23 @@ private: { m_useLoop = useLoop; if ( useLoop ) + { + m_evtLoopOld = wxEventLoopBase::GetActive(); SetActive(this); + } } virtual ~SocketTestEventLoop() { if ( m_useLoop ) - SetActive(NULL); + { + wxEventLoopBase::SetActive(m_evtLoopOld); + } } private: bool m_useLoop; + wxEventLoopBase *m_evtLoopOld; }; // get the address to connect to, if NULL is returned it means that the @@ -180,6 +186,7 @@ void SocketTestCase::ReadNormal() CPPUNIT_ASSERT_EQUAL( wxSOCKET_NOERROR, sock->LastError() ); CPPUNIT_ASSERT_EQUAL( WXSIZEOF(bufSmall), (size_t)sock->LastCount() ); + CPPUNIT_ASSERT_EQUAL( WXSIZEOF(bufSmall), (size_t)sock->LastReadCount() ); char bufBig[102400]; @@ -187,6 +194,7 @@ void SocketTestCase::ReadNormal() CPPUNIT_ASSERT_EQUAL( wxSOCKET_NOERROR, sock->LastError() ); CPPUNIT_ASSERT( WXSIZEOF(bufBig) >= sock->LastCount() ); + CPPUNIT_ASSERT( WXSIZEOF(bufBig) >= sock->LastReadCount() ); } void SocketTestCase::ReadBlock() @@ -200,6 +208,7 @@ void SocketTestCase::ReadBlock() CPPUNIT_ASSERT_EQUAL( wxSOCKET_NOERROR, sock->LastError() ); CPPUNIT_ASSERT_EQUAL( WXSIZEOF(bufSmall), (size_t)sock->LastCount() ); + CPPUNIT_ASSERT_EQUAL( WXSIZEOF(bufSmall), (size_t)sock->LastReadCount() ); char bufBig[102400]; @@ -207,6 +216,7 @@ void SocketTestCase::ReadBlock() CPPUNIT_ASSERT_EQUAL( wxSOCKET_NOERROR, sock->LastError() ); CPPUNIT_ASSERT( WXSIZEOF(bufBig) >= sock->LastCount() ); + CPPUNIT_ASSERT( WXSIZEOF(bufBig) >= sock->LastReadCount() ); } void SocketTestCase::ReadNowait() @@ -236,6 +246,7 @@ void SocketTestCase::ReadWaitall() CPPUNIT_ASSERT_EQUAL( wxSOCKET_NOERROR, sock->LastError() ); CPPUNIT_ASSERT_EQUAL( WXSIZEOF(buf), (size_t)sock->LastCount() ); + CPPUNIT_ASSERT_EQUAL( WXSIZEOF(buf), (size_t)sock->LastReadCount() ); } void SocketTestCase::UrlTest()