Skip to content

Commit

Permalink
Re #8107. We don't use auto_ptr.
Browse files Browse the repository at this point in the history
In fact, there's no need for a heap allocation at all.
  • Loading branch information
RussellTaylor committed Oct 10, 2013
1 parent 0c68aad commit ec1f504
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions Code/Mantid/Framework/LiveData/test/LoadLiveDataTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ using namespace Mantid::DataObjects;
using namespace Mantid::API;
using namespace Mantid::Kernel;

class LoadLiveDataImpl : public LoadLiveData
{
public:
// void store() { Algorithm::store(); }
};

class LoadLiveDataTest : public CxxTest::TestSuite
{
public:
Expand Down Expand Up @@ -67,27 +61,27 @@ class LoadLiveDataTest : public CxxTest::TestSuite
{
FacilityHelper::ScopedFacilities loadTESTFacility("IDFs_for_UNIT_TESTING/UnitTestFacilities.xml", "TEST");

std::auto_ptr<LoadLiveDataImpl> alg(new LoadLiveDataImpl);
TS_ASSERT_THROWS_NOTHING( alg->initialize() )
TS_ASSERT( alg->isInitialized() )
TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("Instrument", "TestDataListener") );
TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("AccumulationMethod", AccumulationMethod) );
TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("ProcessingAlgorithm", ProcessingAlgorithm) );
TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("ProcessingProperties", ProcessingProperties) );
TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("PostProcessingAlgorithm", PostProcessingAlgorithm) );
TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("PostProcessingProperties", PostProcessingProperties) );
TS_ASSERT_THROWS_NOTHING( alg->setProperty("PreserveEvents", PreserveEvents) );
LoadLiveData alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() )
TS_ASSERT( alg.isInitialized() )
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("Instrument", "TestDataListener") );
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("AccumulationMethod", AccumulationMethod) );
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("ProcessingAlgorithm", ProcessingAlgorithm) );
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("ProcessingProperties", ProcessingProperties) );
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("PostProcessingAlgorithm", PostProcessingAlgorithm) );
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("PostProcessingProperties", PostProcessingProperties) );
TS_ASSERT_THROWS_NOTHING( alg.setProperty("PreserveEvents", PreserveEvents) );
if (!PostProcessingAlgorithm.empty())
TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("AccumulationWorkspace", "fake_accum") );
TS_ASSERT_THROWS_NOTHING( alg->setPropertyValue("OutputWorkspace", "fake") );
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("AccumulationWorkspace", "fake_accum") );
TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", "fake") );
if (listener)
alg->setLiveListener(listener);
alg.setLiveListener(listener);

if (!makeThrow)
{ TS_ASSERT_THROWS_NOTHING( alg->execute(); ); }
{ TS_ASSERT_THROWS_NOTHING( alg.execute(); ); }
else
alg->exec();
TS_ASSERT( alg->isExecuted() );
alg.exec();
TS_ASSERT( alg.isExecuted() );

// Retrieve the workspace from data service.
boost::shared_ptr<TYPE> ws;
Expand Down

0 comments on commit ec1f504

Please sign in to comment.