Skip to content

Commit

Permalink
refs #9895 This should fix ConvertToDiffractionMDWorkspace tests
Browse files Browse the repository at this point in the history
The test is not written by me but just decreasing number of test points by two orders of magnitude do works without, seems, affecting the coverage.
  • Loading branch information
abuts committed Aug 13, 2014
1 parent c4f9da7 commit db30943
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Expand Up @@ -101,7 +101,7 @@ class ConvertToDiffractionMDWorkspace2Test : public CxxTest::TestSuite
}

void do_test_MINITOPAZ(EventType type, size_t numTimesToAdd = 1,
bool OneEventPerBin=false, bool MakeWorkspace2D = false,size_t nEventsRetrieved=100000)
bool OneEventPerBin=false, bool MakeWorkspace2D = false,size_t nEventsRetrieved=400)
{

int numEventsPer = 100;
Expand Down Expand Up @@ -201,7 +201,7 @@ class ConvertToDiffractionMDWorkspace2Test : public CxxTest::TestSuite
void test_MINITOPAZ_fromWorkspace2D()
{
// this is questionable change, indicating that ConvertToMD and CovertToDiffractionWorkspace treat 0 differently
do_test_MINITOPAZ(TOF, 1, false, true,1000);
do_test_MINITOPAZ(TOF, 1, false, true,399);
}


Expand Down
Expand Up @@ -139,7 +139,7 @@ class ConvertToDiffractionMDWorkspaceTest : public CxxTest::TestSuite
if (!ws) return;
size_t npoints = ws->getNPoints();
// # of points != # of bins exactly because some are off the extents
TS_ASSERT_LESS_THAN( 100000, npoints);
TS_ASSERT_LESS_THAN( 399, npoints);

TS_ASSERT_EQUALS( ws->getNumExperimentInfo(), 1);
TSM_ASSERT("ExperimentInfo object is valid", ws->getExperimentInfo(0) );
Expand Down
Expand Up @@ -38,7 +38,7 @@ namespace MDEventsTestHelper
*
* @return EventWorkspace_sptr
*/
Mantid::DataObjects::EventWorkspace_sptr createDiffractionEventWorkspace(int numEvents);
Mantid::DataObjects::EventWorkspace_sptr createDiffractionEventWorkspace(int numEvents,int numPixels = 400,int numBins = 160);

/** Make a (optionally) file backed MDEventWorkspace with 10000 fake random data points
*
Expand Down
4 changes: 1 addition & 3 deletions Code/Mantid/Framework/TestHelpers/src/MDEventsTestHelper.cpp
Expand Up @@ -55,12 +55,10 @@ namespace MDEventsTestHelper
*
* @return EventWorkspace_sptr
*/
EventWorkspace_sptr createDiffractionEventWorkspace(int numEvents)
EventWorkspace_sptr createDiffractionEventWorkspace(int numEvents,int numPixels,int numBins)
{
FacilityHelper::ScopedFacilities loadTESTFacility("IDFs_for_UNIT_TESTING/UnitTestFacilities.xml", "TEST");

int numPixels = 10000;
int numBins = 1600;
double binDelta = 10.0;

EventWorkspace_sptr retVal(new EventWorkspace);
Expand Down

0 comments on commit db30943

Please sign in to comment.