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.
This commit is contained in:
Vadim Zeitlin
2017-10-31 21:14:05 +01:00
parent 9d0df5707a
commit b8c9cd3528

View File

@@ -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<wxOutputStream> out(MakeOutStream(tmpfile.m_name));
wxScopedPtr<wxOutputStream> 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<wxInputStream> in(MakeInStream(tmpfile.m_name));
wxScopedPtr<wxInputStream> 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<wxFileInputStream> in(new wxFileInputStream(name));
wxScopedPtr<wxFileInputStream> 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<wxFFileInputStream> in(new wxFFileInputStream(name));
wxScopedPtr<wxFFileInputStream> in(new wxFFileInputStream(name));
CPPUNIT_ASSERT(in->IsOk());
return in.release();
}