Skip to content

Commit

Permalink
Re #8357. Update to account for change in TestHelpers class.
Browse files Browse the repository at this point in the history
The BoxControllerDummyIO constructor was changed to accept (and hold
internally) a bare pointer to avoid a cyclic reference.
  • Loading branch information
RussellTaylor committed Mar 31, 2014
1 parent ee89f1b commit 981868b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Code/Mantid/Framework/MDEvents/test/MDBoxSaveableTest.h
Expand Up @@ -199,7 +199,7 @@ static void destroySuite(MDBoxSaveableTest * suite) { delete suite; }
MDBox<MDLeanEvent<3>,3> c(sc.get());
TS_ASSERT_EQUALS( c.getNPoints(), 0);

auto loader =boost::shared_ptr<API::IBoxControllerIO>(new MantidTestHelpers::BoxControllerDummyIO(sc));
auto loader =boost::shared_ptr<API::IBoxControllerIO>(new MantidTestHelpers::BoxControllerDummyIO(sc.get()));
loader->setDataType(c.getCoordType(),c.getEventType());

// Create and open the test dummy file with 1000 floats in it (have to recalulate to events differently)
Expand Down Expand Up @@ -283,16 +283,17 @@ static void destroySuite(MDBoxSaveableTest * suite) { delete suite; }
void test_fileBackEnd_addEvent()
{
// Create a box with a controller for the back-end
BoxController_sptr bc(new BoxController(3));
// Create on stack to ensure it's cleaned up properly. Its lifetime is sure to exceed those of the things that use it.
BoxController bc(3);

// Create and open the test NXS file
MDBox<MDLeanEvent<3>,3> c(bc.get(), 0);
auto loader =boost::shared_ptr<API::IBoxControllerIO>(new MantidTestHelpers::BoxControllerDummyIO(bc));
MDBox<MDLeanEvent<3>,3> c(&bc, 0);
auto loader = boost::shared_ptr<API::IBoxControllerIO>(new MantidTestHelpers::BoxControllerDummyIO(&bc));
loader->setDataType(c.getCoordType(),c.getEventType());
loader->setWriteBufferSize(10000);

// Create and open the test dummy file with 1000 floats in it
bc->setFileBacked(loader,"existingDummy");
bc.setFileBacked(loader,"existingDummy");
c.setFileBacked(0,1000,true);


Expand Down Expand Up @@ -882,4 +883,4 @@ static void destroySuite(MDBoxSaveableTest * suite) { delete suite; }


};
#endif
#endif

0 comments on commit 981868b

Please sign in to comment.