Skip to content
Snippets Groups Projects
Commit eee6775a authored by Owen Arnold's avatar Owen Arnold
Browse files

re #3314. Add performance test to benchmark loading/conversion. Fix warning.

parent a6d18c41
No related branches found
No related tags found
No related merge requests found
......@@ -256,7 +256,6 @@ namespace Mantid
data_buffer.resize(3*4);
m_fileStream.read(&data_buffer[0],2*4);
int isSQW = *((uint32_t*)(&data_buffer[0]));
this->m_nDims = *((uint32_t*)(&data_buffer[4]));
parse_sqw_main_header();
......
......@@ -8,6 +8,9 @@
using namespace Mantid::MDEvents;
//=====================================================================================
// Functional Tests
//=====================================================================================
class LoadSQWTest : public CxxTest::TestSuite
{
private:
......@@ -127,8 +130,31 @@ public:
TSM_ASSERT_EQUALS("Wrong number of points", 580, ws->getNPoints());
TSM_ASSERT_EQUALS("Wrong number of dimensions", 4, ws->getNumDims());
};
};
//=====================================================================================
// Perfomance Tests
//=====================================================================================
class LoadSQWTestPerformance : public CxxTest::TestSuite
{
public:
//Simple benchmark test so that we can monitor changes to performance.
void testLoading()
{
LoadSQW alg;
alg.initialize();
alg.setPropertyValue("Filename","test_horace_reader.sqw");
alg.setPropertyValue("OutputWorkspace", "benchmarkWS");
TS_ASSERT_THROWS_NOTHING( alg.execute(); )
TS_ASSERT( alg.isExecuted() );
boost::shared_ptr<MDEventWorkspace4> ws = boost::dynamic_pointer_cast<MDEventWorkspace4>(Mantid::API::AnalysisDataService::Instance().retrieve("benchmarkWS"));
//Check the product
TSM_ASSERT_EQUALS("Wrong number of points", 580, ws->getNPoints());
TSM_ASSERT_EQUALS("Wrong number of dimensions", 4, ws->getNumDims());
};
};
#endif
\ No newline at end of file
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