mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
Replace std::auto_ptr with std::unique_ptr #619
This commit is contained in:
@@ -87,11 +87,7 @@ protected:
|
||||
|
||||
private:
|
||||
TestMethod _test;
|
||||
#if __cplusplus < 201103L
|
||||
std::auto_ptr<Fixture> _fixture;
|
||||
#else
|
||||
std::unique_ptr<Fixture> _fixture;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ int main(int argc, char** argv)
|
||||
try
|
||||
{
|
||||
URI uri(argv[1]);
|
||||
std::auto_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
||||
std::unique_ptr<std::istream> pStr(URIStreamOpener::defaultOpener().open(uri));
|
||||
StreamCopier::copyStream(*pStr.get(), std::cout);
|
||||
}
|
||||
catch (Exception& exc)
|
||||
|
||||
@@ -48,7 +48,7 @@ void HTTPSStreamFactoryTest::testNoRedirect()
|
||||
HTTPSStreamFactory factory;
|
||||
URI uri("https://127.0.0.1/large");
|
||||
uri.setPort(server.port());
|
||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
||||
std::unique_ptr<std::istream> 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<std::istream> pStr(factory.open(uri));
|
||||
std::unique_ptr<std::istream> 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<std::istream> pStr(factory.open(uri));
|
||||
std::unique_ptr<std::istream> 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<std::istream> pStr(factory.open(uri));
|
||||
std::unique_ptr<std::istream> pStr(factory.open(uri));
|
||||
std::ostringstream ostr;
|
||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||
assert(ostr.str().length() > 0);
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace
|
||||
try
|
||||
{
|
||||
WebSocket ws(request, response);
|
||||
std::auto_ptr<char> pBuffer(new char[_bufSize]);
|
||||
std::unique_ptr<char> pBuffer(new char[_bufSize]);
|
||||
int flags;
|
||||
int n;
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user