Skip to content

Commit

Permalink
Re #8357. Remove leak in test by adding components to instrument.
Browse files Browse the repository at this point in the history
The fact that you have to call two methods in succession to get this
right is probably not great design. Nor is the fact that you can
'mark' something that isn't in the instrument without any error or warning.
  • Loading branch information
RussellTaylor committed Mar 31, 2014
1 parent d97c3c8 commit da65363
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Code/Mantid/Framework/API/test/ExperimentInfoTest.h
Expand Up @@ -710,11 +710,15 @@ class ExperimentInfoTest : public CxxTest::TestSuite
ExperimentInfo_sptr exptInfo(new ExperimentInfo);
boost::shared_ptr<Instrument> inst1(new Instrument());
inst1->setName("MyTestInst");
inst1->markAsSource(new ObjComponent("source"));
auto source = new ObjComponent("source");
inst1->add(source);
inst1->markAsSource(source);

for(size_t i = 0; i < npoints; ++i)
{
inst1->markAsChopperPoint(new ObjComponent("ChopperPoint"));
auto chopperPoint = new ObjComponent("ChopperPoint");
inst1->add(chopperPoint);
inst1->markAsChopperPoint(chopperPoint);
}
exptInfo->setInstrument(inst1);
return exptInfo;
Expand Down

0 comments on commit da65363

Please sign in to comment.