ifdef auto_ptr

This commit is contained in:
Alex Fabijanic
2017-10-24 21:55:33 -05:00
parent 87ec631b4a
commit 1a18621ff8
17 changed files with 130 additions and 18 deletions

View File

@@ -44,7 +44,11 @@ void HTTPStreamFactoryTest::testNoRedirect()
HTTPStreamFactory factory;
URI uri("http://localhost/large");
uri.setPort(server.port());
#ifndef POCO_ENABLE_CPP11
std::auto_ptr<std::istream> pStr(factory.open(uri));
#else
std::unique_ptr<std::istream> pStr(factory.open(uri));
#endif // POCO_ENABLE_CPP11
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);
assert (ostr.str() == HTTPTestServer::LARGE_BODY);
@@ -57,7 +61,11 @@ void HTTPStreamFactoryTest::testEmptyPath()
HTTPStreamFactory factory;
URI uri("http://localhost");
uri.setPort(server.port());
#ifndef POCO_ENABLE_CPP11
std::auto_ptr<std::istream> pStr(factory.open(uri));
#else
std::unique_ptr<std::istream> pStr(factory.open(uri));
#endif // POCO_ENABLE_CPP11
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);
assert (ostr.str() == HTTPTestServer::SMALL_BODY);
@@ -71,7 +79,11 @@ void HTTPStreamFactoryTest::testRedirect()
opener.registerStreamFactory("http", new HTTPStreamFactory);
URI uri("http://localhost/redirect");
uri.setPort(server.port());
#ifndef POCO_ENABLE_CPP11
std::auto_ptr<std::istream> pStr(opener.open(uri));
#else
std::unique_ptr<std::istream> pStr(opener.open(uri));
#endif // POCO_ENABLE_CPP11
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);
assert (ostr.str() == HTTPTestServer::LARGE_BODY);
@@ -83,7 +95,11 @@ void HTTPStreamFactoryTest::testProxy()
HTTPTestServer server;
HTTPStreamFactory factory("localhost", server.port());
URI uri("http://www.somehost.com/large");
#ifndef POCO_ENABLE_CPP11
std::auto_ptr<std::istream> pStr(factory.open(uri));
#else
std::unique_ptr<std::istream> pStr(factory.open(uri));
#endif // POCO_ENABLE_CPP11
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);
assert (ostr.str() == HTTPTestServer::LARGE_BODY);