Skip to content
Snippets Groups Projects
Commit 43ec346b authored by Anders Markvardsen's avatar Anders Markvardsen
Browse files

Fix: bug in MuonRemoveExpDecay plus added additional test. re #2671

parent 9da6fd13
No related merge requests found
...@@ -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
......
...@@ -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;
......
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