Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
d7bfc0af
Commit
d7bfc0af
authored
6 years ago
by
Tom Titcombe
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary unit tests for extension uniqueness
Refs #21231
parent
da0ecbcd
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Framework/API/inc/MantidAPI/FileFinder.h
+2
-2
2 additions, 2 deletions
Framework/API/inc/MantidAPI/FileFinder.h
Framework/API/src/FileFinder.cpp
+8
-0
8 additions, 0 deletions
Framework/API/src/FileFinder.cpp
Framework/API/test/FileFinderTest.h
+0
-16
0 additions, 16 deletions
Framework/API/test/FileFinderTest.h
with
10 additions
and
18 deletions
Framework/API/inc/MantidAPI/FileFinder.h
+
2
−
2
View file @
d7bfc0af
...
...
@@ -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
;
};
...
...
This diff is collapsed.
Click to expand it.
Framework/API/src/FileFinder.cpp
+
8
−
0
View file @
d7bfc0af
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Framework/API/test/FileFinderTest.h
+
0
−
16
View file @
d7bfc0af
...
...
@@ -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"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment