Commit f2dadc47 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

Merge remote-tracking branch 'origin/master' into 15246_reduce_recursive_includes_in_Algorithm.h

Fixed conflicts with last few days changes in master, especially with InstrumentWidget files that
have been moved and revamped, re #15246.
parents ad814ae0 7888407a
...@@ -360,7 +360,7 @@ int Sample::loadNexus(::NeXus::File *file, const std::string &group) { ...@@ -360,7 +360,7 @@ int Sample::loadNexus(::NeXus::File *file, const std::string &group) {
int num_other_samples; int num_other_samples;
file->readData("num_other_samples", num_other_samples); file->readData("num_other_samples", num_other_samples);
for (int i = 0; i < num_other_samples; i++) { for (int i = 0; i < num_other_samples; i++) {
boost::shared_ptr<Sample> extra(new Sample); auto extra = boost::make_shared<Sample>();
extra->loadNexus(file, "sample" + Strings::toString(i + 1)); extra->loadNexus(file, "sample" + Strings::toString(i + 1));
this->addSample(extra); this->addSample(extra);
} }
......
...@@ -43,9 +43,11 @@ public: ...@@ -43,9 +43,11 @@ public:
"OutputWorkspace2", "", Direction::Output, PropertyMode::Optional)); "OutputWorkspace2", "", Direction::Output, PropertyMode::Optional));
} }
void exec() { void exec() {
boost::shared_ptr<WorkspaceTester> out1(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> out1 =
boost::make_shared<WorkspaceTester>();
out1->init(10, 10, 10); out1->init(10, 10, 10);
boost::shared_ptr<WorkspaceTester> out2(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> out2 =
boost::make_shared<WorkspaceTester>();
out2->init(10, 10, 10); out2->init(10, 10, 10);
std::string outName = getPropertyValue("InputWorkspace1") + "+" + std::string outName = getPropertyValue("InputWorkspace1") + "+" +
getPropertyValue("InputWorkspace2") + "+" + getPropertyValue("InputWorkspace2") + "+" +
...@@ -438,7 +440,8 @@ public: ...@@ -438,7 +440,8 @@ public:
void do_test_locking(std::string in1, std::string in2, std::string inout, void do_test_locking(std::string in1, std::string in2, std::string inout,
std::string out1, std::string out2) { std::string out1, std::string out2) {
for (size_t i = 0; i < 6; i++) { for (size_t i = 0; i < 6; i++) {
boost::shared_ptr<WorkspaceTester> ws(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("ws" + Strings::toString(i), AnalysisDataService::Instance().addOrReplace("ws" + Strings::toString(i),
ws); ws);
} }
...@@ -474,7 +477,8 @@ public: ...@@ -474,7 +477,8 @@ public:
/** Have a workspace property that does NOT lock the workspace. /** Have a workspace property that does NOT lock the workspace.
* The failure mode of this test is HANGING. */ * The failure mode of this test is HANGING. */
void test_workspace_notLocking() { void test_workspace_notLocking() {
boost::shared_ptr<WorkspaceTester> ws1(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws1 =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("ws1", ws1); AnalysisDataService::Instance().addOrReplace("ws1", ws1);
{ {
...@@ -511,7 +515,8 @@ public: ...@@ -511,7 +515,8 @@ public:
if (contents1.empty()) { if (contents1.empty()) {
if (group1.empty()) if (group1.empty())
return; return;
boost::shared_ptr<WorkspaceTester> ws(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace(group1, ws); AnalysisDataService::Instance().addOrReplace(group1, ws);
return; return;
} }
...@@ -524,7 +529,8 @@ public: ...@@ -524,7 +529,8 @@ public:
AnalysisDataService::Instance().addOrReplace(group1, wsGroup); AnalysisDataService::Instance().addOrReplace(group1, wsGroup);
std::vector<std::string>::iterator it = names.begin(); std::vector<std::string>::iterator it = names.begin();
for (; it != names.end(); it++) { for (; it != names.end(); it++) {
boost::shared_ptr<WorkspaceTester> ws(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws =
boost::make_shared<WorkspaceTester>();
ws->init(10, 10, 10); ws->init(10, 10, 10);
AnalysisDataService::Instance().addOrReplace(*it, ws); AnalysisDataService::Instance().addOrReplace(*it, ws);
wsGroup->add(*it); wsGroup->add(*it);
......
...@@ -132,7 +132,8 @@ class DataProcessorAlgorithmTest : public CxxTest::TestSuite { ...@@ -132,7 +132,8 @@ class DataProcessorAlgorithmTest : public CxxTest::TestSuite {
alg->initialize(); alg->initialize();
alg->execute(); alg->execute();
boost::shared_ptr<MatrixWorkspace> output(new WorkspaceTester()); boost::shared_ptr<MatrixWorkspace> output =
boost::make_shared<WorkspaceTester>();
setProperty("OutputWorkspace", output); setProperty("OutputWorkspace", output);
} }
}; };
...@@ -161,7 +162,8 @@ public: ...@@ -161,7 +162,8 @@ public:
} }
void test_Nested_History() { void test_Nested_History() {
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_input_workspace", input); AnalysisDataService::Instance().addOrReplace("test_input_workspace", input);
TopLevelAlgorithm alg; TopLevelAlgorithm alg;
...@@ -204,7 +206,8 @@ public: ...@@ -204,7 +206,8 @@ public:
} }
void test_Dont_Record_Nested_History() { void test_Dont_Record_Nested_History() {
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_input_workspace", input); AnalysisDataService::Instance().addOrReplace("test_input_workspace", input);
TopLevelAlgorithm alg; TopLevelAlgorithm alg;
......
...@@ -32,8 +32,10 @@ public: ...@@ -32,8 +32,10 @@ public:
}; };
void test_enable_disable() { void test_enable_disable() {
boost::shared_ptr<WorkspaceTester> ws1(new WorkspaceTester); boost::shared_ptr<WorkspaceTester> ws1 =
boost::shared_ptr<WorkspaceTesterSubClass> ws2(new WorkspaceTesterSubClass); boost::make_shared<WorkspaceTester>();
boost::shared_ptr<WorkspaceTesterSubClass> ws2 =
boost::make_shared<WorkspaceTesterSubClass>();
AnalysisDataService::Instance().addOrReplace("tester", ws1); AnalysisDataService::Instance().addOrReplace("tester", ws1);
AnalysisDataService::Instance().addOrReplace("testersub", ws2); AnalysisDataService::Instance().addOrReplace("testersub", ws2);
......
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
void test_GetSetInstrument_default() { void test_GetSetInstrument_default() {
ExperimentInfo ws; ExperimentInfo ws;
boost::shared_ptr<Instrument> inst1(new Instrument()); boost::shared_ptr<Instrument> inst1 = boost::make_shared<Instrument>();
inst1->setName("MyTestInst"); inst1->setName("MyTestInst");
ws.setInstrument(inst1); ws.setInstrument(inst1);
...@@ -274,7 +274,7 @@ public: ...@@ -274,7 +274,7 @@ public:
ws.mutableSample().setName("test"); ws.mutableSample().setName("test");
OrientedLattice latt(1, 2, 3, 90, 90, 90); OrientedLattice latt(1, 2, 3, 90, 90, 90);
ws.mutableSample().setOrientedLattice(&latt); ws.mutableSample().setOrientedLattice(&latt);
boost::shared_ptr<Instrument> inst1(new Instrument()); boost::shared_ptr<Instrument> inst1 = boost::make_shared<Instrument>();
inst1->setName("MyTestInst"); inst1->setName("MyTestInst");
ws.setInstrument(inst1); ws.setInstrument(inst1);
ws.setModeratorModel(new FakeSource); ws.setModeratorModel(new FakeSource);
...@@ -291,7 +291,7 @@ public: ...@@ -291,7 +291,7 @@ public:
ws.mutableSample().setName("test"); ws.mutableSample().setName("test");
OrientedLattice latt(1, 2, 3, 90, 90, 90); OrientedLattice latt(1, 2, 3, 90, 90, 90);
ws.mutableSample().setOrientedLattice(&latt); ws.mutableSample().setOrientedLattice(&latt);
boost::shared_ptr<Instrument> inst1(new Instrument()); boost::shared_ptr<Instrument> inst1 = boost::make_shared<Instrument>();
inst1->setName("MyTestInst"); inst1->setName("MyTestInst");
ws.setInstrument(inst1); ws.setInstrument(inst1);
ws.setModeratorModel(new FakeSource); ws.setModeratorModel(new FakeSource);
...@@ -308,7 +308,7 @@ public: ...@@ -308,7 +308,7 @@ public:
ws.mutableSample().setName("test"); ws.mutableSample().setName("test");
OrientedLattice latt(1, 2, 3, 90, 90, 90); OrientedLattice latt(1, 2, 3, 90, 90, 90);
ws.mutableSample().setOrientedLattice(&latt); ws.mutableSample().setOrientedLattice(&latt);
boost::shared_ptr<Instrument> inst1(new Instrument()); boost::shared_ptr<Instrument> inst1 = boost::make_shared<Instrument>();
inst1->setName("MyTestInst"); inst1->setName("MyTestInst");
ws.setInstrument(inst1); ws.setInstrument(inst1);
ws.setModeratorModel(new FakeSource); ws.setModeratorModel(new FakeSource);
...@@ -564,7 +564,7 @@ public: ...@@ -564,7 +564,7 @@ public:
NexusTestHelper th(true); NexusTestHelper th(true);
th.createFile(filename); th.createFile(filename);
ExperimentInfo ws; ExperimentInfo ws;
boost::shared_ptr<Instrument> inst1(new Instrument()); boost::shared_ptr<Instrument> inst1 = boost::make_shared<Instrument>();
inst1->setName("GEM"); inst1->setName("GEM");
inst1->setFilename("GEM_Definition.xml"); inst1->setFilename("GEM_Definition.xml");
inst1->setXmlText(""); inst1->setXmlText("");
...@@ -590,7 +590,7 @@ public: ...@@ -590,7 +590,7 @@ public:
NexusTestHelper th(true); NexusTestHelper th(true);
th.createFile(filename); th.createFile(filename);
ExperimentInfo ws; ExperimentInfo ws;
boost::shared_ptr<Instrument> inst1(new Instrument()); boost::shared_ptr<Instrument> inst1 = boost::make_shared<Instrument>();
inst1->setName(""); inst1->setName("");
inst1->setFilename(""); inst1->setFilename("");
inst1->setXmlText(""); inst1->setXmlText("");
...@@ -760,7 +760,7 @@ private: ...@@ -760,7 +760,7 @@ private:
ExperimentInfo_sptr createTestInfoWithChopperPoints(const size_t npoints) { ExperimentInfo_sptr createTestInfoWithChopperPoints(const size_t npoints) {
ExperimentInfo_sptr exptInfo(new ExperimentInfo); ExperimentInfo_sptr exptInfo(new ExperimentInfo);
boost::shared_ptr<Instrument> inst1(new Instrument()); boost::shared_ptr<Instrument> inst1 = boost::make_shared<Instrument>();
inst1->setName("MyTestInst"); inst1->setName("MyTestInst");
auto source = new ObjComponent("source"); auto source = new ObjComponent("source");
inst1->add(source); inst1->add(source);
......
...@@ -74,8 +74,10 @@ public: ...@@ -74,8 +74,10 @@ public:
void test_clear_original_workspaces() { void test_clear_original_workspaces() {
MDGeometry geometry; MDGeometry geometry;
boost::shared_ptr<WorkspaceTester> ws0(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws0 =
boost::shared_ptr<WorkspaceTester> ws1(new WorkspaceTester()); boost::make_shared<WorkspaceTester>();
boost::shared_ptr<WorkspaceTester> ws1 =
boost::make_shared<WorkspaceTester>();
geometry.setOriginalWorkspace(ws0, 0); geometry.setOriginalWorkspace(ws0, 0);
geometry.setOriginalWorkspace(ws1, 1); geometry.setOriginalWorkspace(ws1, 1);
TS_ASSERT_EQUALS(2, geometry.numOriginalWorkspaces()); TS_ASSERT_EQUALS(2, geometry.numOriginalWorkspaces());
...@@ -95,8 +97,10 @@ public: ...@@ -95,8 +97,10 @@ public:
g.setBasisVector(0, VMD(1.2, 3.4)); g.setBasisVector(0, VMD(1.2, 3.4));
g.setBasisVector(1, VMD(1.2, 3.4)); g.setBasisVector(1, VMD(1.2, 3.4));
g.setOrigin(VMD(4, 5)); g.setOrigin(VMD(4, 5));
boost::shared_ptr<WorkspaceTester> ws0(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws0 =
boost::shared_ptr<WorkspaceTester> ws1(new WorkspaceTester()); boost::make_shared<WorkspaceTester>();
boost::shared_ptr<WorkspaceTester> ws1 =
boost::make_shared<WorkspaceTester>();
g.setOriginalWorkspace(ws0, 0); g.setOriginalWorkspace(ws0, 0);
g.setOriginalWorkspace(ws1, 1); g.setOriginalWorkspace(ws1, 1);
g.setTransformFromOriginal(new NullCoordTransform(5), 0); g.setTransformFromOriginal(new NullCoordTransform(5), 0);
...@@ -162,7 +166,8 @@ public: ...@@ -162,7 +166,8 @@ public:
new MDHistoDimension("Qy", "Qy", frame, -2, +2, 0)); new MDHistoDimension("Qy", "Qy", frame, -2, +2, 0));
TS_ASSERT_THROWS_NOTHING(g.addDimension(dim2);) TS_ASSERT_THROWS_NOTHING(g.addDimension(dim2);)
TS_ASSERT_EQUALS(g.getNumDims(), 2); TS_ASSERT_EQUALS(g.getNumDims(), 2);
boost::shared_ptr<WorkspaceTester> ws(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws =
boost::make_shared<WorkspaceTester>();
g.setOriginalWorkspace(ws); g.setOriginalWorkspace(ws);
TS_ASSERT(g.hasOriginalWorkspace()); TS_ASSERT(g.hasOriginalWorkspace());
...@@ -198,7 +203,8 @@ public: ...@@ -198,7 +203,8 @@ public:
void test_OriginalWorkspace() { void test_OriginalWorkspace() {
MDGeometry g; MDGeometry g;
TS_ASSERT(!g.hasOriginalWorkspace()); TS_ASSERT(!g.hasOriginalWorkspace());
boost::shared_ptr<WorkspaceTester> ws(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws =
boost::make_shared<WorkspaceTester>();
g.setOriginalWorkspace(ws); g.setOriginalWorkspace(ws);
TS_ASSERT(g.hasOriginalWorkspace()); TS_ASSERT(g.hasOriginalWorkspace());
} }
...@@ -206,8 +212,10 @@ public: ...@@ -206,8 +212,10 @@ public:
void test_OriginalWorkspace_multiple() { void test_OriginalWorkspace_multiple() {
MDGeometry g; MDGeometry g;
TS_ASSERT(!g.hasOriginalWorkspace()); TS_ASSERT(!g.hasOriginalWorkspace());
boost::shared_ptr<WorkspaceTester> ws0(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws0 =
boost::shared_ptr<WorkspaceTester> ws1(new WorkspaceTester()); boost::make_shared<WorkspaceTester>();
boost::shared_ptr<WorkspaceTester> ws1 =
boost::make_shared<WorkspaceTester>();
g.setOriginalWorkspace(ws0); g.setOriginalWorkspace(ws0);
g.setOriginalWorkspace(ws1, 1); g.setOriginalWorkspace(ws1, 1);
TS_ASSERT(g.hasOriginalWorkspace()); TS_ASSERT(g.hasOriginalWorkspace());
...@@ -221,7 +229,8 @@ public: ...@@ -221,7 +229,8 @@ public:
void test_OriginalWorkspace_gets_deleted() { void test_OriginalWorkspace_gets_deleted() {
MDGeometry g; MDGeometry g;
{ {
boost::shared_ptr<WorkspaceTester> ws(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("MDGeometryTest_originalWS", AnalysisDataService::Instance().addOrReplace("MDGeometryTest_originalWS",
ws); ws);
g.setOriginalWorkspace(ws); g.setOriginalWorkspace(ws);
...@@ -231,7 +240,8 @@ public: ...@@ -231,7 +240,8 @@ public:
TS_ASSERT(g.getOriginalWorkspace()) TS_ASSERT(g.getOriginalWorkspace())
// Create a different workspace and delete that // Create a different workspace and delete that
boost::shared_ptr<WorkspaceTester> ws2(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws2 =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("MDGeometryTest_some_other_ws", AnalysisDataService::Instance().addOrReplace("MDGeometryTest_some_other_ws",
ws2); ws2);
AnalysisDataService::Instance().remove("MDGeometryTest_some_other_ws"); AnalysisDataService::Instance().remove("MDGeometryTest_some_other_ws");
......
...@@ -16,7 +16,8 @@ using namespace Mantid::Geometry; ...@@ -16,7 +16,8 @@ using namespace Mantid::Geometry;
class MatrixWorkspaceMDIteratorTest : public CxxTest::TestSuite { class MatrixWorkspaceMDIteratorTest : public CxxTest::TestSuite {
public: public:
boost::shared_ptr<MatrixWorkspace> makeFakeWS() { boost::shared_ptr<MatrixWorkspace> makeFakeWS() {
boost::shared_ptr<MatrixWorkspace> ws(new WorkspaceTester()); boost::shared_ptr<MatrixWorkspace> ws =
boost::make_shared<WorkspaceTester>();
// Matrix with 4 spectra, 5 bins each // Matrix with 4 spectra, 5 bins each
ws->initialize(4, 6, 5); ws->initialize(4, 6, 5);
NumericAxis *ax1 = new NumericAxis(4); NumericAxis *ax1 = new NumericAxis(4);
......
...@@ -144,7 +144,8 @@ public: ...@@ -144,7 +144,8 @@ public:
} }
void testDetectorMappingCopiedWhenAWorkspaceIsCopied() { void testDetectorMappingCopiedWhenAWorkspaceIsCopied() {
boost::shared_ptr<MatrixWorkspace> parent(new WorkspaceTester); boost::shared_ptr<MatrixWorkspace> parent =
boost::make_shared<WorkspaceTester>();
parent->initialize(1, 1, 1); parent->initialize(1, 1, 1);
parent->getSpectrum(0)->setSpectrumNo(99); parent->getSpectrum(0)->setSpectrumNo(99);
parent->getSpectrum(0)->setDetectorID(999); parent->getSpectrum(0)->setDetectorID(999);
......
...@@ -139,7 +139,8 @@ class NotebookBuilderTest : public CxxTest::TestSuite { ...@@ -139,7 +139,8 @@ class NotebookBuilderTest : public CxxTest::TestSuite {
alg->initialize(); alg->initialize();
alg->execute(); alg->execute();
boost::shared_ptr<MatrixWorkspace> output(new WorkspaceTester()); boost::shared_ptr<MatrixWorkspace> output =
boost::make_shared<WorkspaceTester>();
setProperty("OutputWorkspace", output); setProperty("OutputWorkspace", output);
} }
}; };
...@@ -166,7 +167,8 @@ public: ...@@ -166,7 +167,8 @@ public:
"\"TopLevelAlgorithm(InputWorkspace='test_input_" "\"TopLevelAlgorithm(InputWorkspace='test_input_"
"workspace', " "workspace', "
"OutputWorkspace='test_output_workspace')\","; "OutputWorkspace='test_output_workspace')\",";
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_input_workspace", input); AnalysisDataService::Instance().addOrReplace("test_input_workspace", input);
auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1); auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1);
...@@ -203,7 +205,8 @@ public: ...@@ -203,7 +205,8 @@ public:
std::string result_code = std::string result_code =
" \"input\" : \"BasicAlgorithm(PropertyA='FirstOne')\","; " \"input\" : \"BasicAlgorithm(PropertyA='FirstOne')\",";
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_input_workspace", input); AnalysisDataService::Instance().addOrReplace("test_input_workspace", input);
auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1); auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1);
...@@ -242,7 +245,8 @@ public: ...@@ -242,7 +245,8 @@ public:
std::string result_code = std::string result_code =
" \"input\" : \"BasicAlgorithm(PropertyA='FirstOne')\","; " \"input\" : \"BasicAlgorithm(PropertyA='FirstOne')\",";
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_input_workspace", input); AnalysisDataService::Instance().addOrReplace("test_input_workspace", input);
auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1); auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1);
...@@ -291,7 +295,8 @@ public: ...@@ -291,7 +295,8 @@ public:
"\"TopLevelAlgorithm(InputWorkspace=r'test_inp\\\\ut_" "\"TopLevelAlgorithm(InputWorkspace=r'test_inp\\\\ut_"
"workspace', " "workspace', "
"OutputWorkspace='test_output_workspace')\","; "OutputWorkspace='test_output_workspace')\",";
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_inp\\ut_workspace", AnalysisDataService::Instance().addOrReplace("test_inp\\ut_workspace",
input); input);
......
...@@ -286,7 +286,7 @@ public: ...@@ -286,7 +286,7 @@ public:
void test_Multiple_Samples() { void test_Multiple_Samples() {
Sample sample; Sample sample;
sample.setName("test name for test_Multiple_Sample"); sample.setName("test name for test_Multiple_Sample");
boost::shared_ptr<Sample> sample2 = boost::shared_ptr<Sample>(new Sample()); auto sample2 = boost::make_shared<Sample>();
sample2->setName("test name for test_Multiple_Sample - 2"); sample2->setName("test name for test_Multiple_Sample - 2");
TS_ASSERT_EQUALS(sample.size(), 1); TS_ASSERT_EQUALS(sample.size(), 1);
...@@ -315,7 +315,7 @@ public: ...@@ -315,7 +315,7 @@ public:
sample.setWidth(1.234); sample.setWidth(1.234);
OrientedLattice latt(4, 5, 6, 90, 91, 92); OrientedLattice latt(4, 5, 6, 90, 91, 92);
sample.setOrientedLattice(&latt); sample.setOrientedLattice(&latt);
boost::shared_ptr<Sample> sample2 = boost::shared_ptr<Sample>(new Sample()); auto sample2 = boost::make_shared<Sample>();
sample2->setName("test name for test_Multiple_Sample - 2"); sample2->setName("test name for test_Multiple_Sample - 2");
sample.addSample(sample2); sample.addSample(sample2);
TS_ASSERT(sample.getShape().getShapeXML() != ""); TS_ASSERT(sample.getShape().getShapeXML() != "");
......
...@@ -139,7 +139,8 @@ class ScriptBuilderTest : public CxxTest::TestSuite { ...@@ -139,7 +139,8 @@ class ScriptBuilderTest : public CxxTest::TestSuite {
alg->initialize(); alg->initialize();
alg->execute(); alg->execute();
boost::shared_ptr<MatrixWorkspace> output(new WorkspaceTester()); boost::shared_ptr<MatrixWorkspace> output =
boost::make_shared<WorkspaceTester>();
setProperty("OutputWorkspace", output); setProperty("OutputWorkspace", output);
} }
}; };
...@@ -166,7 +167,8 @@ public: ...@@ -166,7 +167,8 @@ public:
"workspace', " "workspace', "
"OutputWorkspace='test_output_workspace')", "OutputWorkspace='test_output_workspace')",
""}; ""};
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_input_workspace", input); AnalysisDataService::Instance().addOrReplace("test_input_workspace", input);
auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1); auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1);
...@@ -209,7 +211,8 @@ public: ...@@ -209,7 +211,8 @@ public:
"# End of child algorithms of TopLevelAlgorithm", "", "", "# End of child algorithms of TopLevelAlgorithm", "", "",
}; };
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_input_workspace", input); AnalysisDataService::Instance().addOrReplace("test_input_workspace", input);
auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1); auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1);
...@@ -253,7 +256,8 @@ public: ...@@ -253,7 +256,8 @@ public:
"", "", "", "",
}; };
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_input_workspace", input); AnalysisDataService::Instance().addOrReplace("test_input_workspace", input);
auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1); auto alg = AlgorithmFactory::Instance().create("TopLevelAlgorithm", 1);
...@@ -300,7 +304,8 @@ public: ...@@ -300,7 +304,8 @@ public:
"workspace', " "workspace', "
"OutputWorkspace='test_output_workspace')", "OutputWorkspace='test_output_workspace')",
""}; ""};
boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> input =
boost::make_shared<WorkspaceTester>();
AnalysisDataService::Instance().addOrReplace("test_inp\\ut_workspace", AnalysisDataService::Instance().addOrReplace("test_inp\\ut_workspace",
input); input);
......
...@@ -69,7 +69,8 @@ private: ...@@ -69,7 +69,8 @@ private:
/// Make a simple group /// Make a simple group
WorkspaceGroup_sptr makeGroup() { WorkspaceGroup_sptr makeGroup() {
for (size_t i = 0; i < 3; i++) { for (size_t i = 0; i < 3; i++) {
boost::shared_ptr<WorkspaceTester> ws(new WorkspaceTester()); boost::shared_ptr<WorkspaceTester> ws =
boost::make_shared<WorkspaceTester>();
ws->initialize(2, 3, 4); ws->initialize(2, 3, 4);
AnalysisDataService::Instance().addOrReplace("ws" + Strings::toString(i), AnalysisDataService::Instance().addOrReplace("ws" + Strings::toString(i),
ws); ws);
...@@ -238,7 +239,8 @@ public: ...@@ -238,7 +239,8 @@ public:
AnalysisDataService::Instance().add("name", group); AnalysisDataService::Instance().add("name", group);
TSM_ASSERT("Empty group is not similar", !group->areNamesSimilar()); TSM_ASSERT("Empty group is not similar", !group->areNamesSimilar());
boost::shared_ptr<WorkspaceTester> ws(new WorkspaceTester());