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

Remove unnecessary unit tests for extension uniqueness

Refs #21231
parent da0ecbcd
No related merge requests found
......@@ -58,8 +58,6 @@ public:
/// DO NOT USE! MADE PUBLIC FOR TESTING ONLY.
std::string getExtension(const std::string &filename,
const std::vector<std::string> &exts) const;
void getUniqueExtensions(const std::vector<std::string> &exts,
std::set<std::string> &uniqueExts) const;
private:
friend struct Mantid::Kernel::CreateUsingNew<FileFinderImpl>;
......@@ -79,6 +77,8 @@ private:
const std::set<std::string> &filenames,
const std::vector<std::string> &exts) const;
std::string toUpper(const std::string &src) const;
void getUniqueExtensions(const std::vector<std::string> &exts,
std::set<std::string> &uniqueExts) const;
/// glob option - set to case sensitive or insensitive
int m_globOption;
};
......
......@@ -512,6 +512,14 @@ FileFinderImpl::findRun(const std::string &hintstr,
return "";
}
/**
* Given a set of already determined extensions and new extensions,
* create a set of all extensions.
* If not in an extension-is-case-sensitive environment, only add the
* lower case OR upper case version of the extension
* @param exts :: a vector of extensions to add
* @param uniqueExts :: a set of currently included extensions
*/
void FileFinderImpl::getUniqueExtensions(
const std::vector<std::string> &exts,
std::set<std::string> &uniqueExts) const {
......
......@@ -347,22 +347,6 @@ public:
std::cout << "\n end of test \n";
}
void testGetUniqueExtensions() {
std::set<std::string> uniqueExts;
std::vector<std::string> firstExtsToAdd = {".RAW", ".log"};
std::vector<std::string> secondExtsToAdd = {".so", ".txt", ".RAW"};
std::set<std::string> expectedFirstExtensions = {".RAW", ".log"};
std::set<std::string> expectedSecondExtensions = {".RAW", ".log", ".so",
".txt"};
FileFinder::Instance().getUniqueExtensions(firstExtsToAdd, uniqueExts);
TS_ASSERT_EQUALS(uniqueExts, expectedFirstExtensions);
FileFinder::Instance().getUniqueExtensions(secondExtsToAdd, uniqueExts);
TS_ASSERT_EQUALS(uniqueExts, expectedSecondExtensions);
}
void testFindAddFiles() {
// create a test file to find
Poco::File file("LOQ00111-add.raw");
......
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