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
acb78bca
Commit
acb78bca
authored
6 years ago
by
Tom Titcombe
Browse files
Options
Downloads
Patches
Plain Diff
Fit clang formatting Refs #0
parent
2af4a79b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/DataHandling/inc/MantidDataHandling/ISISDataArchive.h
+3
-2
3 additions, 2 deletions
...ork/DataHandling/inc/MantidDataHandling/ISISDataArchive.h
Framework/DataHandling/test/ISISDataArchiveTest.h
+15
-10
15 additions, 10 deletions
Framework/DataHandling/test/ISISDataArchiveTest.h
with
18 additions
and
12 deletions
Framework/DataHandling/inc/MantidDataHandling/ISISDataArchive.h
+
3
−
2
View file @
acb78bca
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Framework/DataHandling/test/ISISDataArchiveTest.h
+
15
−
10
View file @
acb78bca
...
@@ -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
,
""
);
}
}
...
...
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