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
90f20fb0
Commit
90f20fb0
authored
5 years ago
by
Hahn, Steven
Committed by
WHITFIELDRE email
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
work on unit test for ConvertSCDtoMDE
parent
c016ddf6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/MDAlgorithms/test/ConvertSCDtoMDETest.h
+22
-8
22 additions, 8 deletions
Framework/MDAlgorithms/test/ConvertSCDtoMDETest.h
with
22 additions
and
8 deletions
Framework/MDAlgorithms/test/ConvertSCDtoMDETest.h
+
22
−
8
View file @
90f20fb0
...
@@ -9,10 +9,15 @@
...
@@ -9,10 +9,15 @@
#include
<cxxtest/TestSuite.h>
#include
<cxxtest/TestSuite.h>
#include
"MantidAPI/AnalysisDataService.h"
#include
"MantidMDAlgorithms/ConvertSCDtoMDE.h"
#include
"MantidMDAlgorithms/ConvertSCDtoMDE.h"
#include
"TestHelpers/WorkspaceCreationHelpers.h"
#include
"MantidMDAlgorithms/LoadMD.h"
//#include "TestHelpers/WorkspaceCreationHelpers.h"
#include
"MantidAPI/Workspace_fwd.h"
#include
"MantidAPI/AnalysisDataService.h"
#include
"MantidAPI/FileFinder.h"
using
Mantid
::
MDAlgorithms
::
ConvertSCDtoMDE
;
using
Mantid
::
MDAlgorithms
::
ConvertSCDtoMDE
;
using
Mantid
::
MDAlgorithms
::
LoadMD
;
class
ConvertSCDtoMDETest
:
public
CxxTest
::
TestSuite
{
class
ConvertSCDtoMDETest
:
public
CxxTest
::
TestSuite
{
public:
public:
...
@@ -32,14 +37,23 @@ public:
...
@@ -32,14 +37,23 @@ public:
void
test_exec
()
void
test_exec
()
{
{
// Create test input if necessary
// Create test input if necessary
MatrixWorkspace_sptr
inputWS
=
//-- Fill in appropriate code. Consider using TestHelpers/WorkspaceCreationHelpers.h --
LoadMD
loader
;
//loader.setChild(true);
loader
.
initialize
();
loader
.
setPropertyValue
(
"Filename"
,
Mantid
::
API
::
FileFinder
::
Instance
().
getFullPath
(
"MAPS_MDEW.nxs"
));
loader
.
setPropertyValue
(
"OutputWorkspace"
,
"MD_EVENT_WS_ID"
);
loader
.
setProperty
(
"FileBackEnd"
,
false
);
loader
.
execute
();
auto
inputWS
=
Mantid
::
API
::
AnalysisDataService
::
Instance
().
retrieveWS
<
Mantid
::
API
::
IMDHistoWorkspace
>
(
"MD_EVENT_WS_ID"
);
ConvertSCDtoMDE
alg
;
ConvertSCDtoMDE
alg
;
// Don't put output in ADS by default
// Don't put output in ADS by default
alg
.
setChild
(
true
);
alg
.
setChild
(
true
);
TS_ASSERT_THROWS_NOTHING
(
alg
.
initialize
()
)
TS_ASSERT_THROWS_NOTHING
(
alg
.
initialize
()
)
TS_ASSERT
(
alg
.
isInitialized
()
)
TS_ASSERT
(
alg
.
isInitialized
()
)
TS_ASSERT_THROWS_NOTHING
(
alg
.
setProperty
(
"InputWorkspace"
,
inputWS
)
);
TS_ASSERT_THROWS_NOTHING
(
alg
.
setProperty
(
"InputWorkspace"
,
"MD_EVENT_WS_ID"
)
);
TS_ASSERT_THROWS_NOTHING
(
alg
.
setPropertyValue
(
"OutputWorkspace"
,
"_unused_for_child"
)
);
TS_ASSERT_THROWS_NOTHING
(
alg
.
setPropertyValue
(
"OutputWorkspace"
,
"_unused_for_child"
)
);
TS_ASSERT_THROWS_NOTHING
(
alg
.
execute
();
);
TS_ASSERT_THROWS_NOTHING
(
alg
.
execute
();
);
TS_ASSERT
(
alg
.
isExecuted
()
);
TS_ASSERT
(
alg
.
isExecuted
()
);
...
@@ -47,14 +61,14 @@ public:
...
@@ -47,14 +61,14 @@ public:
// Retrieve the workspace from the algorithm. The type here will probably need to change. It should
// Retrieve the workspace from the algorithm. The type here will probably need to change. It should
// be the type using in declareProperty for the "OutputWorkspace" type.
// be the type using in declareProperty for the "OutputWorkspace" type.
// We can't use auto as it's an implicit conversion.
// We can't use auto as it's an implicit conversion.
Workspace_sptr
outputWS
=
alg
.
getProperty
(
"OutputWorkspace"
);
//Mantid::API::Matrix
Workspace_sptr outputWS = alg.getProperty("OutputWorkspace");
TS_ASSERT
(
outputWS
);
//
TS_ASSERT(outputWS);
TS_FAIL
(
"TODO: Check the results and remove this line"
);
//
TS_FAIL("TODO: Check the results and remove this line");
}
}
void
test_Something
()
void
test_Something
()
{
{
TS_FAIL
(
"You forgot to write a test!"
);
//
TS_FAIL( "You forgot to write a test!");
}
}
...
...
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