diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp index 220fd46b4e..a574d784ec 100644 --- a/tests/archive/archivetest.cpp +++ b/tests/archive/archivetest.cpp @@ -20,7 +20,6 @@ #include "archivetest.h" #include "wx/dir.h" -#include "wx/scopedptr.h" #include #include #include diff --git a/tests/archive/archivetest.h b/tests/archive/archivetest.h index 91f053c675..d1b4d88375 100644 --- a/tests/archive/archivetest.h +++ b/tests/archive/archivetest.h @@ -12,6 +12,7 @@ #define WX_TEST_ARCHIVE_ITERATOR #include "wx/archive.h" +#include "wx/scopedptr.h" #include "wx/wfstream.h" #include @@ -215,7 +216,7 @@ protected: typedef std::map TestEntries; TestEntries m_testEntries; // test data - std::auto_ptr m_factory; // factory to make classes + wxScopedPtr m_factory; // factory to make classes int m_options; // test options wxDateTime m_timeStamp; // timestamp to give test entries int m_id; // select between the possibilites diff --git a/tests/archive/ziptest.cpp b/tests/archive/ziptest.cpp index ab1809460a..24c62e3f8f 100644 --- a/tests/archive/ziptest.cpp +++ b/tests/archive/ziptest.cpp @@ -22,7 +22,6 @@ #include "wx/zipstrm.h" using std::string; -using std::auto_ptr; /////////////////////////////////////////////////////////////////////////////// @@ -188,7 +187,7 @@ void ZipPipeTestCase::runTest() TestInputStream in(out, m_id % ((m_options & PipeIn) ? 4 : 3)); wxZipInputStream zip(in); - auto_ptr entry(zip.GetNextEntry()); + wxScopedPtr entry(zip.GetNextEntry()); CPPUNIT_ASSERT(entry.get() != NULL); if ((m_options & PipeIn) == 0) diff --git a/tests/net/socket.cpp b/tests/net/socket.cpp index 2def27f4a6..ca21bc9971 100644 --- a/tests/net/socket.cpp +++ b/tests/net/socket.cpp @@ -26,12 +26,12 @@ #include "wx/socket.h" #include "wx/url.h" +#include "wx/scopedptr.h" #include "wx/sstream.h" #include "wx/evtloop.h" -#include -typedef std::auto_ptr wxSockAddressPtr; -typedef std::auto_ptr wxSocketClientPtr; +typedef wxScopedPtr wxSockAddressPtr; +typedef wxScopedPtr wxSocketClientPtr; static wxString gs_serverHost(wxGetenv("WX_TEST_SERVER")); @@ -88,11 +88,11 @@ private: // get the address to connect to, if NULL is returned it means that the // test is disabled and shouldn't run at all - wxSockAddressPtr GetServer() const; + wxSockAddress* GetServer() const; // get the socket to read HTTP reply from, returns NULL if the test is // disabled - wxSocketClientPtr GetHTTPSocket(int flags = wxSOCKET_NONE) const; + wxSocketClient* GetHTTPSocket(int flags = wxSOCKET_NONE) const; void PseudoTest_SetUseEventLoop() { ms_useLoop = true; } @@ -115,23 +115,23 @@ bool SocketTestCase::ms_useLoop = false; CPPUNIT_TEST_SUITE_REGISTRATION( SocketTestCase ); CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SocketTestCase, "SocketTestCase" ); -wxSockAddressPtr SocketTestCase::GetServer() const +wxSockAddress* SocketTestCase::GetServer() const { if ( gs_serverHost.empty() ) - return wxSockAddressPtr(); + return NULL; wxIPV4address *addr = new wxIPV4address; addr->Hostname(gs_serverHost); addr->Service("www"); - return wxSockAddressPtr(addr); + return addr; } -wxSocketClientPtr SocketTestCase::GetHTTPSocket(int flags) const +wxSocketClient* SocketTestCase::GetHTTPSocket(int flags) const { - wxSockAddressPtr addr = GetServer(); - if ( !addr.get() ) - return wxSocketClientPtr(); + wxSockAddress *addr = GetServer(); + if ( !addr ) + return NULL; wxSocketClient *sock = new wxSocketClient(flags); sock->SetTimeout(1); @@ -144,12 +144,12 @@ wxSocketClientPtr SocketTestCase::GetHTTPSocket(int flags) const sock->Write(httpGetRoot.ToAscii(), httpGetRoot.length()); - return wxSocketClientPtr(sock); + return sock; } void SocketTestCase::BlockingConnect() { - wxSockAddressPtr addr = GetServer(); + wxSockAddressPtr addr(GetServer()); if ( !addr.get() ) return; @@ -159,7 +159,7 @@ void SocketTestCase::BlockingConnect() void SocketTestCase::NonblockingConnect() { - wxSockAddressPtr addr = GetServer(); + wxSockAddressPtr addr(GetServer()); if ( !addr.get() ) return; @@ -257,7 +257,7 @@ void SocketTestCase::UrlTest() wxURL url("http://" + gs_serverHost); - const std::auto_ptr in(url.GetInputStream()); + const wxScopedPtr in(url.GetInputStream()); CPPUNIT_ASSERT( in.get() ); wxStringOutputStream out;