Skip to content
Snippets Groups Projects
Commit f43b89a2 authored by Ricardo Leal's avatar Ricardo Leal
Browse files

Refs #6287. Tests for ILL IN5.

parent 4f009043
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,11 @@ public: ...@@ -80,6 +80,11 @@ public:
" <technique>Reflectometer</technique>" " <technique>Reflectometer</technique>"
" </instrument>" " </instrument>"
" </facility>" " </facility>"
" <facility name=\"ILL\" delimiter=\"_\" FileExtensions=\".nxs,.dat\">"
" <instrument name=\"IN5\" shortname=\"IN5\">"
" <technique>Inelastic Spectroscopy</technique>"
" </instrument>"
" </facility>"
"</facilities>"; "</facilities>";
std::ofstream fil(m_facFile.path().c_str()); std::ofstream fil(m_facFile.path().c_str());
......
...@@ -276,7 +276,7 @@ set ( INC_FILES ...@@ -276,7 +276,7 @@ set ( INC_FILES
set ( TEST_FILES set ( TEST_FILES
#LoadDAETest.h #LoadDAETest.h
#LoadILLTest.h LoadILLTest.h
#LoadSNSNexusTest.h # TODO has no active tests in it #LoadSNSNexusTest.h # TODO has no active tests in it
#LoadSassenaTest.h #LoadSassenaTest.h
#Needs fixing to not rely on network. SNSLiveEventDataListenerTest.h #Needs fixing to not rely on network. SNSLiveEventDataListenerTest.h
......
...@@ -7,43 +7,66 @@ ...@@ -7,43 +7,66 @@
using namespace Mantid::API; using namespace Mantid::API;
class LoadILLTest : public CxxTest::TestSuite class LoadILLTest: public CxxTest::TestSuite {
{
public: public:
LoadILLTest():testFile("C:/Users/hqs74821/Work/Mantid_stuff/ILL/068288.nxs"){} LoadILLTest() :
void testName() testFile("ILLIN5_094460.nxs") {
{ }
TS_ASSERT_EQUALS( loader.name(), "LoadILL" ); void testName() {
} TS_ASSERT_EQUALS( loader.name(), "LoadILL");
}
void testVersion()
{ void testVersion() {
TS_ASSERT_EQUALS( loader.version(), 1 ); TS_ASSERT_EQUALS( loader.version(), 1);
} }
void testInit() void testInit() {
{ TS_ASSERT_THROWS_NOTHING( loader.initialize());
TS_ASSERT_THROWS_NOTHING( loader.initialize() ); TS_ASSERT( loader.isInitialized());
TS_ASSERT( loader.isInitialized() ); }
}
// void testFileCheck() {
void testFileCheck() // std::cerr << loader.fileCheck(testFile);
{ // }
std::cerr << loader.fileCheck(testFile);
} void testExec() {
loader.setPropertyValue("Filename", testFile);
void testExec()
{ std::string outputSpace = "LoadILLTest_out";
loader.setPropertyValue("Filename",testFile); loader.setPropertyValue("OutputWorkspace", outputSpace);
loader.setPropertyValue("OutputWorkspace","out"); TS_ASSERT_THROWS_NOTHING( loader.execute());
TS_ASSERT_THROWS_NOTHING( loader.execute() );
// test workspace, copied from LoadMuonNexusTest.h
AnalysisDataService::Instance().clear(); MatrixWorkspace_sptr output;
}
(output = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
outputSpace));
MatrixWorkspace_sptr output2D = boost::dynamic_pointer_cast<
MatrixWorkspace>(output);
TS_ASSERT_EQUALS( output2D->getNumberHistograms(), 98304);
AnalysisDataService::Instance().clear();
}
private: private:
Mantid::DataHandling::LoadILL loader; Mantid::DataHandling::LoadILL loader;
std::string testFile; std::string testFile;
};
//------------------------------------------------------------------------------
// Performance test
//------------------------------------------------------------------------------
class LoadILLTestPerformance: public CxxTest::TestSuite {
public:
void testDefaultLoad() {
Mantid::DataHandling::LoadILL loader;
loader.initialize();
loader.setPropertyValue("Filename", "ILLIN5_094460.nxs");
loader.setPropertyValue("OutputWorkspace", "ws");
TS_ASSERT( loader.execute());
}
}; };
#endif /*LoadILLTEST_H_*/ #endif /*LoadILLTEST_H_*/
File added
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