Skip to content

Commit

Permalink
Added a unit test to expose the problem. Refs #9034.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Feb 24, 2014
1 parent 05fd06f commit 5313d94
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Code/Mantid/Framework/Algorithms/test/SaveGSASInstrumentFileTest.h
Expand Up @@ -82,6 +82,42 @@ class SaveGSASInstrumentFileTest : public CxxTest::TestSuite
return;
}

//----------------------------------------------------------------------------------------------
void test_SaveGSSInstrumentFile_LoadFile()
{
Mantid::API::FrameworkManager::Instance();

// Set up the algorithm
SaveGSASInstrumentFile saver;
saver.initialize();
TS_ASSERT(saver.isInitialized());

saver.setProperty("InputFileName", "2011B_HR60b2.irf");
saver.setProperty("OutputFilename", "PG3_Bank2.iparm");
saver.setProperty("Instrument", "powgen");
saver.setPropertyValue("ChopperFrequency", "60");
saver.setProperty("IDLine", "PG60_2011B");
saver.setProperty("Sample", "LaB6");
saver.setProperty("L1", 60.0);
saver.setProperty("TwoTheta", 90.0);

// Execute the algorithm
saver.execute();
TS_ASSERT(saver.isExecuted());

// Check the output file's existence and size
std::string filename = saver.getProperty("OutputFilename"); // get full pathname
TS_ASSERT(Poco::File(filename).exists());

// Clean
AnalysisDataService::Instance().remove("PG3ProfileTable");
Poco::File(filename).remove();

return;
}



//----------------------------------------------------------------------------------------------
/** Test on import FP .irf file and import multiple banks
*/
Expand Down

0 comments on commit 5313d94

Please sign in to comment.