Skip to content

Commit

Permalink
Merge branch 'feature/8546_load_parameter_file_string' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlPalmen committed Dec 11, 2013
2 parents 29fe84b + c21d90a commit 3740413
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadParameterFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void LoadParameterFile::exec()

// Check the two properties (at least one must be set)
if( filename.empty() && parameterXMLProperty->isDefault()){
throw Kernel::Exception::FileError("Either the Filename or ParameterXML property of LoadInstrument most be specified to load an IDF" , filename);
throw Kernel::Exception::FileError("Either the Filename or ParameterXML property of LoadParameterFile most be specified to load an IDF" , filename);
}

// Get the input workspace
Expand All @@ -115,7 +115,7 @@ void LoadParameterFile::exec()

void LoadParameterFile::execManually(bool useString, std::string filename, std::string parameterXML, Mantid::API::ExperimentInfo_sptr localWorkspace)
{
// TODO: Refactor to remove the need for the const cast
// TODO: Refactor to remove the need for the const cast (ticket #8521)
Instrument_sptr instrument = boost::const_pointer_cast<Instrument>(localWorkspace->getInstrument()->baseInstrument());

// Set up the DOM parser and parse xml file
Expand Down
13 changes: 13 additions & 0 deletions Code/Mantid/Framework/DataHandling/test/LoadParameterFileTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ class LoadParameterFileTest : public CxxTest::TestSuite

}

void test_failure_if_no_file_or_string()
{
// Create workspace
load_IDF2();

// Run algorithm without file or string properties set
LoadParameterFile loaderPF;
TS_ASSERT_THROWS_NOTHING(loaderPF.initialize());
loaderPF.setPropertyValue("Workspace", wsName);
TS_ASSERT_THROWS_NOTHING(loaderPF.execute());
TS_ASSERT( ! loaderPF.execute() )
}

void load_IDF2()
{
LoadInstrument loaderIDF2;
Expand Down

0 comments on commit 3740413

Please sign in to comment.