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

@@ -47,7 +47,11 @@ void HTTPSStreamFactoryTest::testNoRedirect()
HTTPSStreamFactory factory;
URI uri("https://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() == HTTPSTestServer::LARGE_BODY);
@@ -60,7 +64,11 @@ void HTTPSStreamFactoryTest::testEmptyPath()
HTTPSStreamFactory factory;
URI uri("https://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() == HTTPSTestServer::SMALL_BODY);
@@ -73,7 +81,11 @@ void HTTPSStreamFactoryTest::testRedirect()
HTTPSStreamFactory factory;
URI uri("https://localhost/redirect");
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() == HTTPSTestServer::LARGE_BODY);
@@ -88,7 +100,11 @@ void HTTPSStreamFactoryTest::testProxy()
Application::instance().config().getInt("testsuite.proxy.port")
);
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
#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().length() > 0);