diff --git a/Code/Mantid/Framework/API/test/FileFinderTest.h b/Code/Mantid/Framework/API/test/FileFinderTest.h index fc66576eb7480d0927148641773aa7a3c2d2e90d..29734928df42f4c23e482565a5ce11e90494a0e7 100644 --- a/Code/Mantid/Framework/API/test/FileFinderTest.h +++ b/Code/Mantid/Framework/API/test/FileFinderTest.h @@ -80,6 +80,11 @@ public: " <technique>Reflectometer</technique>" " </instrument>" " </facility>" + " <facility name=\"ILL\" delimiter=\"_\" FileExtensions=\".nxs,.dat\">" + " <instrument name=\"IN5\" shortname=\"IN5\">" + " <technique>Inelastic Spectroscopy</technique>" + " </instrument>" + " </facility>" "</facilities>"; std::ofstream fil(m_facFile.path().c_str()); diff --git a/Code/Mantid/Framework/DataHandling/CMakeLists.txt b/Code/Mantid/Framework/DataHandling/CMakeLists.txt index 733fe286a6bb1bef0f3fdaea0edc59f5fa9f5951..d7eb8617a1381b393c9e6f1afd537a88d95561df 100644 --- a/Code/Mantid/Framework/DataHandling/CMakeLists.txt +++ b/Code/Mantid/Framework/DataHandling/CMakeLists.txt @@ -276,7 +276,7 @@ set ( INC_FILES set ( TEST_FILES #LoadDAETest.h - #LoadILLTest.h + LoadILLTest.h #LoadSNSNexusTest.h # TODO has no active tests in it #LoadSassenaTest.h #Needs fixing to not rely on network. SNSLiveEventDataListenerTest.h diff --git a/Code/Mantid/Framework/DataHandling/test/LoadILLTest.h b/Code/Mantid/Framework/DataHandling/test/LoadILLTest.h index f2bd814bfc072a7c65d8ae48c8a7307ae82061a5..1650f7a63311e1a85165af8271e765005ab72e61 100644 --- a/Code/Mantid/Framework/DataHandling/test/LoadILLTest.h +++ b/Code/Mantid/Framework/DataHandling/test/LoadILLTest.h @@ -7,43 +7,66 @@ using namespace Mantid::API; -class LoadILLTest : public CxxTest::TestSuite -{ +class LoadILLTest: public CxxTest::TestSuite { public: - LoadILLTest():testFile("C:/Users/hqs74821/Work/Mantid_stuff/ILL/068288.nxs"){} - void testName() - { - TS_ASSERT_EQUALS( loader.name(), "LoadILL" ); - } - - void testVersion() - { - TS_ASSERT_EQUALS( loader.version(), 1 ); - } - - void testInit() - { - TS_ASSERT_THROWS_NOTHING( loader.initialize() ); - TS_ASSERT( loader.isInitialized() ); - } - - void testFileCheck() - { - std::cerr << loader.fileCheck(testFile); - } - - void testExec() - { - loader.setPropertyValue("Filename",testFile); - loader.setPropertyValue("OutputWorkspace","out"); - TS_ASSERT_THROWS_NOTHING( loader.execute() ); - - AnalysisDataService::Instance().clear(); - } + LoadILLTest() : + testFile("ILLIN5_094460.nxs") { + } + void testName() { + TS_ASSERT_EQUALS( loader.name(), "LoadILL"); + } + + void testVersion() { + TS_ASSERT_EQUALS( loader.version(), 1); + } + + void testInit() { + TS_ASSERT_THROWS_NOTHING( loader.initialize()); + TS_ASSERT( loader.isInitialized()); + } + +// void testFileCheck() { +// std::cerr << loader.fileCheck(testFile); +// } + + void testExec() { + loader.setPropertyValue("Filename", testFile); + + std::string outputSpace = "LoadILLTest_out"; + loader.setPropertyValue("OutputWorkspace", outputSpace); + TS_ASSERT_THROWS_NOTHING( loader.execute()); + + // test workspace, copied from LoadMuonNexusTest.h + 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: - Mantid::DataHandling::LoadILL loader; - std::string testFile; + Mantid::DataHandling::LoadILL loader; + 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_*/ diff --git a/Test/AutoTestData/ILLIN5_094460.nxs b/Test/AutoTestData/ILLIN5_094460.nxs new file mode 100644 index 0000000000000000000000000000000000000000..72fdf3467bf9bc05132d464c343cb82a1d878c6d Binary files /dev/null and b/Test/AutoTestData/ILLIN5_094460.nxs differ