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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user