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
43ec346b
Commit
43ec346b
authored
14 years ago
by
Anders Markvardsen
Browse files
Options
Downloads
Patches
Plain Diff
Fix: bug in MuonRemoveExpDecay plus added additional test. re #2671
parent
9da6fd13
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/Algorithms/src/MuonRemoveExpDecay.cpp
+1
-2
1 addition, 2 deletions
Code/Mantid/Framework/Algorithms/src/MuonRemoveExpDecay.cpp
Code/Mantid/Framework/Algorithms/test/MuonRemoveExpDecayTest.h
+21
-6
21 additions, 6 deletions
...Mantid/Framework/Algorithms/test/MuonRemoveExpDecayTest.h
with
22 additions
and
8 deletions
Code/Mantid/Framework/Algorithms/src/MuonRemoveExpDecay.cpp
+
1
−
2
View file @
43ec346b
...
@@ -38,8 +38,7 @@ void MuonRemoveExpDecay::init()
...
@@ -38,8 +38,7 @@ void MuonRemoveExpDecay::init()
declareProperty
(
new
API
::
WorkspaceProperty
<
API
::
MatrixWorkspace
>
(
"OutputWorkspace"
,
""
,
declareProperty
(
new
API
::
WorkspaceProperty
<
API
::
MatrixWorkspace
>
(
"OutputWorkspace"
,
""
,
Direction
::
Output
),
"The name of the workspace to be created as the output of the algorithm"
);
Direction
::
Output
),
"The name of the workspace to be created as the output of the algorithm"
);
std
::
vector
<
int
>
empty
;
std
::
vector
<
int
>
empty
;
declareProperty
(
new
Kernel
::
ArrayProperty
<
int
>
(
"Spectra"
,
empty
,
new
MandatoryValidator
<
std
::
vector
<
declareProperty
(
new
Kernel
::
ArrayProperty
<
int
>
(
"Spectra"
,
empty
),
"Spectra to remove the exponential decay from"
);
int
>
>
),
"Spectra to remove the exponential decay from"
);
}
}
/** Executes the algorithm
/** Executes the algorithm
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/Framework/Algorithms/test/MuonRemoveExpDecayTest.h
+
21
−
6
View file @
43ec346b
...
@@ -37,7 +37,6 @@ public:
...
@@ -37,7 +37,6 @@ public:
void
testLoadNexusAndSetProperties
()
void
testLoadNexusAndSetProperties
()
{
{
//This test does not run on Windows64 as is does not support HDF4 files
//This test does not run on Windows64 as is does not support HDF4 files
#ifndef _WIN64
loader
.
initialize
();
loader
.
initialize
();
loader
.
setPropertyValue
(
"Filename"
,
"emu00006473.nxs"
);
loader
.
setPropertyValue
(
"Filename"
,
"emu00006473.nxs"
);
...
@@ -48,21 +47,17 @@ public:
...
@@ -48,21 +47,17 @@ public:
alg
.
setPropertyValue
(
"InputWorkspace"
,
"EMU6473"
);
alg
.
setPropertyValue
(
"InputWorkspace"
,
"EMU6473"
);
alg
.
setPropertyValue
(
"OutputWorkspace"
,
"Result"
);
alg
.
setPropertyValue
(
"OutputWorkspace"
,
"Result"
);
alg
.
setPropertyValue
(
"Spectra"
,
"0"
);
alg
.
setPropertyValue
(
"Spectra"
,
"0"
);
#endif
/*_WIN64*/
}
}
void
testProperties
()
void
testProperties
()
{
{
//This test does not run on Windows64 as is does not support HDF4 files
//This test does not run on Windows64 as is does not support HDF4 files
#ifndef _WIN64
TS_ASSERT_EQUALS
(
alg
.
getPropertyValue
(
"Spectra"
),
"0"
);
TS_ASSERT_EQUALS
(
alg
.
getPropertyValue
(
"Spectra"
),
"0"
);
#endif
/*_WIN64*/
}
}
void
testExecute
()
void
testExecute
()
{
{
//This test does not run on Windows64 as is does not support HDF4 files
//This test does not run on Windows64 as is does not support HDF4 files
#ifndef _WIN64
try
try
{
{
TS_ASSERT_EQUALS
(
alg
.
execute
(),
true
);
TS_ASSERT_EQUALS
(
alg
.
execute
(),
true
);
...
@@ -73,9 +68,29 @@ public:
...
@@ -73,9 +68,29 @@ public:
}
}
Workspace_const_sptr
outputWS
=
AnalysisDataService
::
Instance
().
retrieve
(
"Result"
);
Workspace_const_sptr
outputWS
=
AnalysisDataService
::
Instance
().
retrieve
(
"Result"
);
#endif
/*_WIN64*/
}
}
void
testWhereOptional3rdArgNotSet
()
{
//This test does not run on Windows64 as is does not support HDF4 files
MuonRemoveExpDecay
alg2
;
alg2
.
initialize
();
alg2
.
setPropertyValue
(
"InputWorkspace"
,
"EMU6473"
);
alg2
.
setPropertyValue
(
"OutputWorkspace"
,
"MuonRemoveExpDecayResult"
);
try
{
TS_ASSERT_EQUALS
(
alg2
.
execute
(),
true
);
}
catch
(
std
::
runtime_error
e
)
{
TS_FAIL
(
e
.
what
());
}
}
private
:
private
:
MuonRemoveExpDecay
alg
;
MuonRemoveExpDecay
alg
;
Mantid
::
NeXus
::
LoadMuonNexus
loader
;
Mantid
::
NeXus
::
LoadMuonNexus
loader
;
...
...
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