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:
|
private:
|
||||||
TestMethod _test;
|
TestMethod _test;
|
||||||
#if __cplusplus < 201103L
|
|
||||||
std::auto_ptr<Fixture> _fixture;
|
|
||||||
#else
|
|
||||||
std::unique_ptr<Fixture> _fixture;
|
std::unique_ptr<Fixture> _fixture;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ int main(int argc, char** argv)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
URI uri(argv[1]);
|
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);
|
StreamCopier::copyStream(*pStr.get(), std::cout);
|
||||||
}
|
}
|
||||||
catch (Exception& exc)
|
catch (Exception& exc)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ void HTTPSStreamFactoryTest::testNoRedirect()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1/large");
|
URI uri("https://127.0.0.1/large");
|
||||||
uri.setPort(server.port());
|
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;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assert (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
assert (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
||||||
@@ -61,7 +61,7 @@ void HTTPSStreamFactoryTest::testEmptyPath()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1");
|
URI uri("https://127.0.0.1");
|
||||||
uri.setPort(server.port());
|
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;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assert (ostr.str() == HTTPSTestServer::SMALL_BODY);
|
assert (ostr.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
@@ -74,7 +74,7 @@ void HTTPSStreamFactoryTest::testRedirect()
|
|||||||
HTTPSStreamFactory factory;
|
HTTPSStreamFactory factory;
|
||||||
URI uri("https://127.0.0.1/redirect");
|
URI uri("https://127.0.0.1/redirect");
|
||||||
uri.setPort(server.port());
|
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;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assert (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
assert (ostr.str() == HTTPSTestServer::LARGE_BODY);
|
||||||
@@ -94,7 +94,7 @@ void HTTPSStreamFactoryTest::testProxy()
|
|||||||
Application::instance().config().getInt("testsuite.proxy.port")
|
Application::instance().config().getInt("testsuite.proxy.port")
|
||||||
);
|
);
|
||||||
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
|
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;
|
std::ostringstream ostr;
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assert(ostr.str().length() > 0);
|
assert(ostr.str().length() > 0);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
WebSocket ws(request, response);
|
WebSocket ws(request, response);
|
||||||
std::auto_ptr<char> pBuffer(new char[_bufSize]);
|
std::unique_ptr<char> pBuffer(new char[_bufSize]);
|
||||||
int flags;
|
int flags;
|
||||||
int n;
|
int n;
|
||||||
do
|
do
|
||||||
|
|||||||
Reference in New Issue
Block a user