Skip to content

Commit

Permalink
strict about standards so it builds on all ci platforms, re #10591
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed Feb 20, 2015
1 parent b084108 commit 51e1038
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -1052,7 +1052,8 @@ std::string SCARFTomoReconstruction::buildUploadBody(const std::string &boundary
body += "\r\n";

// BLOCK: the file
std::ifstream fileStream(filename, std::ios_base::binary);
std::ifstream fileStream(filename.c_str(), std::ios_base::binary |
std::ios_base::in);
Poco::StreamCopier::copyToString(fileStream, body);

// BLOCK: end like this:
Expand Down Expand Up @@ -1113,7 +1114,8 @@ void SCARFTomoReconstruction::genOutputStatusInfo(const std::string &resp,
std::vector<std::string> jobStatus;
std::vector<std::string> jobCommands;
for (size_t i = 0; i < n; i++) {
Poco::XML::Element *el = static_cast<Poco::XML::Element *>(jobs->item(i));
Poco::XML::Element *el = static_cast<Poco::XML::Element *>(jobs->item(
static_cast<unsigned long>(i)));
if (!el)
throw std::runtime_error("Error while trying to parse job with index " +
boost::lexical_cast<std::string>(i) +
Expand Down Expand Up @@ -1311,7 +1313,7 @@ void SCARFTomoReconstruction::getOneJobFile(const std::string &jobId,
std::endl;
}
std::string outName = checkDownloadOutputFile(localPath, name);
std::ofstream file(outName, std::ios_base::binary);
std::ofstream file(outName. c_str(), std::ios_base::binary | std::ios_base::out);
Poco::StreamCopier::copyStream(ss, file);
g_log.notice() << "Downloaded remote file " << outName << " into " <<
localPath << "." << std::endl;
Expand Down
Expand Up @@ -156,7 +156,7 @@ class SCARFTomoReconstructionTest: public CxxTest::TestSuite
void test_castAlgorithm()
{
// can create
boost::shared_ptr<MockedSCARFTomo> a = NULL;
boost::shared_ptr<MockedSCARFTomo> a;
TS_ASSERT(a = boost::make_shared<MockedSCARFTomo>());
// can cast to inherited interfaces and base classes

Expand Down Expand Up @@ -584,7 +584,9 @@ class SCARFTomoReconstructionTest: public CxxTest::TestSuite
private:
std::string goodUsername;
std::string goodPassword;
const std::string SCARFName = "SCARF@STFC";
static const std::string SCARFName;
};

const std::string SCARFTomoReconstructionTest::SCARFName = "SCARF@STFC";

#endif // MANTID_REMOTEALGORITHMS_SCARFTOMORECONSTRUCTION_H_

0 comments on commit 51e1038

Please sign in to comment.