Skip to content
Snippets Groups Projects
Commit acb78bca authored by Tom Titcombe's avatar Tom Titcombe
Browse files

Fit clang formatting Refs #0

parent 2af4a79b
No related branches found
No related tags found
No related merge requests found
...@@ -31,8 +31,9 @@ public: ...@@ -31,8 +31,9 @@ public:
getArchivePath(const std::set<std::string> &filenames, getArchivePath(const std::set<std::string> &filenames,
const std::vector<std::string> &exts) const override; const std::vector<std::string> &exts) const override;
/// Public and virtual for testing purposes /// Public and virtual for testing purposes
virtual std::string getCorrectExtension(const std::string &path, virtual std::string
const std::vector<std::string> &exts) const; getCorrectExtension(const std::string &path,
const std::vector<std::string> &exts) const;
private: private:
/// Queries the archive & returns the path to a single file. /// Queries the archive & returns the path to a single file.
......
...@@ -26,11 +26,12 @@ const char *URL_PREFIX = "http://data.isis.rl.ac.uk/where.py/unixdir?name="; ...@@ -26,11 +26,12 @@ const char *URL_PREFIX = "http://data.isis.rl.ac.uk/where.py/unixdir?name=";
class MockgetCorrectExtension : public ISISDataArchive { class MockgetCorrectExtension : public ISISDataArchive {
public: public:
std::string getCorrectExtension(const std::string &path, std::string
const std::vector<std::string> &exts) const override { getCorrectExtension(const std::string &path,
(void)exts; const std::vector<std::string> &exts) const override {
return path; (void)exts;
} return path;
}
}; };
class ISISDataArchiveTest : public CxxTest::TestSuite { class ISISDataArchiveTest : public CxxTest::TestSuite {
...@@ -51,7 +52,7 @@ public: ...@@ -51,7 +52,7 @@ public:
if (path.empty()) { if (path.empty()) {
TS_FAIL("Returned path was empty."); TS_FAIL("Returned path was empty.");
} else { } 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: ...@@ -62,19 +63,23 @@ public:
*/ */
void xtestgetCorrectExtension() { void xtestgetCorrectExtension() {
std::string path; std::string path;
if (strcmp(URL_PREFIX,"http://data.isis.rl.ac.uk/where.py/windir?name=")==0) { if (strcmp(URL_PREFIX, "http://data.isis.rl.ac.uk/where.py/windir?name=") ==
path = "\\isis.cclrc.ac.uk\\inst$\\ndxhrpd\\instrument\\data\\cycle_98_0\\HRP00273"; 0) {
path = "\\isis.cclrc.ac.uk\\inst$\\ndxhrpd\\instrument\\data\\cycle_98_"
"0\\HRP00273";
} else { } else {
path = "/archive/ndxhrpd/Instrument/data/cycle_98_0/HRP00273"; path = "/archive/ndxhrpd/Instrument/data/cycle_98_0/HRP00273";
} }
ISISDataArchive arch; ISISDataArchive arch;
const std::vector<std::string> correct_exts = {".RAW"}; 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"); TS_ASSERT_EQUALS(rawExtension, path + ".RAW");
const std::vector<std::string> incorrect_exts = {".so", ".txt"}; 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, ""); TS_ASSERT_EQUALS(emptyString, "");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment