diff --git a/Framework/DataHandling/inc/MantidDataHandling/ISISDataArchive.h b/Framework/DataHandling/inc/MantidDataHandling/ISISDataArchive.h index f2058ebfad7a6cefe2f774e3e53304f47edd0b04..854369ae97b8eee537e0814f4d99c671c2d6ffe5 100644 --- a/Framework/DataHandling/inc/MantidDataHandling/ISISDataArchive.h +++ b/Framework/DataHandling/inc/MantidDataHandling/ISISDataArchive.h @@ -31,8 +31,9 @@ public: getArchivePath(const std::set<std::string> &filenames, const std::vector<std::string> &exts) const override; /// Public and virtual for testing purposes - virtual std::string getCorrectExtension(const std::string &path, - const std::vector<std::string> &exts) const; + virtual std::string + getCorrectExtension(const std::string &path, + const std::vector<std::string> &exts) const; private: /// Queries the archive & returns the path to a single file. diff --git a/Framework/DataHandling/test/ISISDataArchiveTest.h b/Framework/DataHandling/test/ISISDataArchiveTest.h index 579bdd0ae567740cd69d681367bb08a989d178b3..955b5104fd1299a8f060ec67fc06501cabe48fc3 100644 --- a/Framework/DataHandling/test/ISISDataArchiveTest.h +++ b/Framework/DataHandling/test/ISISDataArchiveTest.h @@ -26,11 +26,12 @@ const char *URL_PREFIX = "http://data.isis.rl.ac.uk/where.py/unixdir?name="; class MockgetCorrectExtension : public ISISDataArchive { public: - std::string getCorrectExtension(const std::string &path, - const std::vector<std::string> &exts) const override { - (void)exts; - return path; - } + std::string + getCorrectExtension(const std::string &path, + const std::vector<std::string> &exts) const override { + (void)exts; + return path; + } }; class ISISDataArchiveTest : public CxxTest::TestSuite { @@ -51,7 +52,7 @@ public: if (path.empty()) { TS_FAIL("Returned path was empty."); } else { - TS_ASSERT_EQUALS(path.substr(path.size() - 18, 10), "cycle_98_0"); + TS_ASSERT_EQUALS(path.substr(path.size() - 18, 10), "cycle_98_0"); } } @@ -62,19 +63,23 @@ public: */ void xtestgetCorrectExtension() { std::string path; - if (strcmp(URL_PREFIX,"http://data.isis.rl.ac.uk/where.py/windir?name=")==0) { - path = "\\isis.cclrc.ac.uk\\inst$\\ndxhrpd\\instrument\\data\\cycle_98_0\\HRP00273"; + if (strcmp(URL_PREFIX, "http://data.isis.rl.ac.uk/where.py/windir?name=") == + 0) { + path = "\\isis.cclrc.ac.uk\\inst$\\ndxhrpd\\instrument\\data\\cycle_98_" + "0\\HRP00273"; } else { path = "/archive/ndxhrpd/Instrument/data/cycle_98_0/HRP00273"; } ISISDataArchive arch; const std::vector<std::string> correct_exts = {".RAW"}; - const std::string rawExtension = arch.getCorrectExtension(path, correct_exts); + const std::string rawExtension = + arch.getCorrectExtension(path, correct_exts); TS_ASSERT_EQUALS(rawExtension, path + ".RAW"); const std::vector<std::string> incorrect_exts = {".so", ".txt"}; - const std::string emptyString = arch.getCorrectExtension(path, incorrect_exts); + const std::string emptyString = + arch.getCorrectExtension(path, incorrect_exts); TS_ASSERT_EQUALS(emptyString, ""); }