diff --git a/src/tests/kits/net/service/HttpTest.cpp b/src/tests/kits/net/service/HttpTest.cpp index 1dc17dfd07..f27c80fe04 100644 --- a/src/tests/kits/net/service/HttpTest.cpp +++ b/src/tests/kits/net/service/HttpTest.cpp @@ -318,11 +318,18 @@ HttpTest::UploadTest() // the server received it. std::string fileContents; { - std::ifstream inputStream(testFilePath); - CPPUNIT_ASSERT(inputStream.is_open()); - fileContents = std::string( - std::istreambuf_iterator(inputStream), - std::istreambuf_iterator()); + std::ifstream inputStream( + testFilePath.c_str(), + std::ios::in | std::ios::binary); + CPPUNIT_ASSERT(inputStream); + + inputStream.seekg(0, std::ios::end); + fileContents.resize(inputStream.tellg()); + + inputStream.seekg(0, std::ios::beg); + inputStream.read(&fileContents[0], fileContents.size()); + inputStream.close(); + CPPUNIT_ASSERT(!fileContents.empty()); } diff --git a/src/tests/kits/net/service/TestServer.cpp b/src/tests/kits/net/service/TestServer.cpp index 240c6972f6..d2551f962a 100644 --- a/src/tests/kits/net/service/TestServer.cpp +++ b/src/tests/kits/net/service/TestServer.cpp @@ -7,6 +7,7 @@ */ #include "TestServer.h" +#include #include #include #include @@ -208,7 +209,7 @@ status_t ChildProcess::Start(const std::vector& args) // If we reach this point we failed to load the Python image. std::ostringstream ostr; - for (std::vector::const_iterator iter = args.cbegin(); + for (std::vector::const_iterator iter = args.begin(); iter != args.end(); ++iter) { ostr << " " << *iter;