From 726bcc9202e9765a1cdd80c6e4eb282aa4389987 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Tue, 10 Oct 2017 18:17:49 -0500 Subject: [PATCH] Replace std::auto_ptr with std::unique_ptr #619 --- CppUnit/include/Poco/CppUnit/TestCaller.h | 4 ---- NetSSL_Win/samples/download/src/download.cpp | 2 +- NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp | 8 ++++---- NetSSL_Win/testsuite/src/WebSocketTest.cpp | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CppUnit/include/Poco/CppUnit/TestCaller.h b/CppUnit/include/Poco/CppUnit/TestCaller.h index 7eaf2e753..df6ee3344 100644 --- a/CppUnit/include/Poco/CppUnit/TestCaller.h +++ b/CppUnit/include/Poco/CppUnit/TestCaller.h @@ -87,11 +87,7 @@ protected: private: TestMethod _test; -#if __cplusplus < 201103L - std::auto_ptr _fixture; -#else std::unique_ptr _fixture; -#endif }; diff --git a/NetSSL_Win/samples/download/src/download.cpp b/NetSSL_Win/samples/download/src/download.cpp index 6eeff62d2..ea0f41e85 100644 --- a/NetSSL_Win/samples/download/src/download.cpp +++ b/NetSSL_Win/samples/download/src/download.cpp @@ -79,7 +79,7 @@ int main(int argc, char** argv) try { URI uri(argv[1]); - std::auto_ptr pStr(URIStreamOpener::defaultOpener().open(uri)); + std::unique_ptr pStr(URIStreamOpener::defaultOpener().open(uri)); StreamCopier::copyStream(*pStr.get(), std::cout); } catch (Exception& exc) diff --git a/NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp b/NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp index a3f50a937..08e972011 100644 --- a/NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp +++ b/NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp @@ -48,7 +48,7 @@ void HTTPSStreamFactoryTest::testNoRedirect() HTTPSStreamFactory factory; URI uri("https://127.0.0.1/large"); uri.setPort(server.port()); - std::auto_ptr pStr(factory.open(uri)); + std::unique_ptr pStr(factory.open(uri)); std::ostringstream ostr; StreamCopier::copyStream(*pStr.get(), ostr); assert (ostr.str() == HTTPSTestServer::LARGE_BODY); @@ -61,7 +61,7 @@ void HTTPSStreamFactoryTest::testEmptyPath() HTTPSStreamFactory factory; URI uri("https://127.0.0.1"); uri.setPort(server.port()); - std::auto_ptr pStr(factory.open(uri)); + std::unique_ptr pStr(factory.open(uri)); std::ostringstream ostr; StreamCopier::copyStream(*pStr.get(), ostr); assert (ostr.str() == HTTPSTestServer::SMALL_BODY); @@ -74,7 +74,7 @@ void HTTPSStreamFactoryTest::testRedirect() HTTPSStreamFactory factory; URI uri("https://127.0.0.1/redirect"); uri.setPort(server.port()); - std::auto_ptr pStr(factory.open(uri)); + std::unique_ptr pStr(factory.open(uri)); std::ostringstream ostr; StreamCopier::copyStream(*pStr.get(), ostr); assert (ostr.str() == HTTPSTestServer::LARGE_BODY); @@ -94,7 +94,7 @@ void HTTPSStreamFactoryTest::testProxy() Application::instance().config().getInt("testsuite.proxy.port") ); URI uri("https://secure.appinf.com/public/poco/NetSSL.txt"); - std::auto_ptr pStr(factory.open(uri)); + std::unique_ptr pStr(factory.open(uri)); std::ostringstream ostr; StreamCopier::copyStream(*pStr.get(), ostr); assert(ostr.str().length() > 0); diff --git a/NetSSL_Win/testsuite/src/WebSocketTest.cpp b/NetSSL_Win/testsuite/src/WebSocketTest.cpp index f4f25d884..719c2116a 100644 --- a/NetSSL_Win/testsuite/src/WebSocketTest.cpp +++ b/NetSSL_Win/testsuite/src/WebSocketTest.cpp @@ -49,7 +49,7 @@ namespace try { WebSocket ws(request, response); - std::auto_ptr pBuffer(new char[_bufSize]); + std::unique_ptr pBuffer(new char[_bufSize]); int flags; int n; do