From b8c9cd35288a5c94f88ea83bf8c9ee644f99ece1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 31 Oct 2017 21:14:05 +0100 Subject: [PATCH] Use wxScopedPtr<> instead of std::auto_ptr<> in the tests It is better to use wholly non-standard wxWidgets smart pointer class rather than using standard, but deprecated in C++17, std::auto_ptr<> as this results in warnings from recent compilers. --- tests/streams/largefile.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/streams/largefile.cpp b/tests/streams/largefile.cpp index 9c6c48110f..d89af98564 100644 --- a/tests/streams/largefile.cpp +++ b/tests/streams/largefile.cpp @@ -32,6 +32,7 @@ #endif #include "wx/filename.h" +#include "wx/scopedptr.h" #include "wx/wfstream.h" #ifdef __WINDOWS__ @@ -51,8 +52,6 @@ #define fileno _fileno #endif -using std::auto_ptr; - /////////////////////////////////////////////////////////////////////////////// // Helpers @@ -120,7 +119,7 @@ void LargeFileTest::runTest() // write a large file { - auto_ptr out(MakeOutStream(tmpfile.m_name)); + wxScopedPtr out(MakeOutStream(tmpfile.m_name)); // write 'A's at [ 0x7fffffbf, 0x7fffffff [ pos = 0x7fffffff - size; @@ -154,7 +153,7 @@ void LargeFileTest::runTest() // read the large file back { - auto_ptr in(MakeInStream(tmpfile.m_name)); + wxScopedPtr in(MakeInStream(tmpfile.m_name)); char buf[size]; if (haveLFS) { @@ -218,7 +217,7 @@ protected: wxInputStream *LargeFileTest_wxFile::MakeInStream(const wxString& name) const { - auto_ptr in(new wxFileInputStream(name)); + wxScopedPtr in(new wxFileInputStream(name)); CPPUNIT_ASSERT(in->IsOk()); return in.release(); } @@ -250,7 +249,7 @@ protected: wxInputStream *LargeFileTest_wxFFile::MakeInStream(const wxString& name) const { - auto_ptr in(new wxFFileInputStream(name)); + wxScopedPtr in(new wxFFileInputStream(name)); CPPUNIT_ASSERT(in->IsOk()); return in.release(); }