diff --git a/Framework/Algorithms/test/SmoothNeighboursTest.h b/Framework/Algorithms/test/SmoothNeighboursTest.h index 90c4019429e06cff41a656b979fc18ea49f58729..913f5af58075cd70b72c32c02a33a6769f3e6769 100644 --- a/Framework/Algorithms/test/SmoothNeighboursTest.h +++ b/Framework/Algorithms/test/SmoothNeighboursTest.h @@ -423,4 +423,43 @@ public: } }; +class SmoothNeighboursTestPerformance : public CxxTest::TestSuite { +public: + // This pair of boilerplate methods prevent the suite being created statically + // This means the constructor isn't called when running other tests + static SmoothNeighboursTestPerformance *createSuite() { + return new SmoothNeighboursTestPerformance(); + } + static void destroySuite(SmoothNeighboursTestPerformance *suite) { + AnalysisDataService::Instance().clear(); + delete suite; + } + SmoothNeighboursTestPerformance() { FrameworkManager::Instance(); } + + void setUp() override { + inWS = + WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(500, 10); + } + + void testNeighboursAndFlatWeighting() { + // Test with number of neighbours and flat weighting + + SmoothNeighbours alg; + TS_ASSERT_THROWS_NOTHING(alg.initialize()); + TS_ASSERT(alg.isInitialized()); + alg.setProperty("InputWorkspace", inWS); + alg.setProperty("OutputWorkspace", "testMW"); + alg.setProperty("PreserveEvents", false); + alg.setProperty("WeightedSum", "Flat"); + alg.setProperty("NumberOfNeighbours", 200); + alg.setProperty("IgnoreMaskedDetectors", true); + alg.setProperty("Radius", 10.0); + alg.setProperty("RadiusUnits", "NumberOfPixels"); + alg.execute(); + } + +private: + MatrixWorkspace_sptr inWS; +}; + #endif /*SMOOTHNEIGHBOURSTEST_H_*/ diff --git a/Framework/Algorithms/test/SofQWCentreTest.h b/Framework/Algorithms/test/SofQWCentreTest.h index 716be282fb78b93b933fc1d1670f9dd222cccb66..c4812947bdf55caec441862b82a479689ad98650 100644 --- a/Framework/Algorithms/test/SofQWCentreTest.h +++ b/Framework/Algorithms/test/SofQWCentreTest.h @@ -58,4 +58,21 @@ public: } }; +class SofQWCentreTestPerformance : public CxxTest::TestSuite { +public: + // This pair of boilerplate methods prevent the suite being created statically + // This means the constructor isn't called when running other tests + static SofQWCentreTestPerformance *createSuite() { + return new SofQWCentreTestPerformance(); + } + static void destroySuite(SofQWCentreTestPerformance *suite) { + AnalysisDataService::Instance().clear(); + delete suite; + } + + void testExec() { + auto result = SofQWTest::runSQW<Mantid::Algorithms::SofQWCentre>(); + } +}; + #endif /*SOFQWTEST_H_*/ diff --git a/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h b/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h index 643372f8b01a05c8f6a8f920da332b3f9bcbfa8d..0bb9b1d3c28d6bccfe4bafcbc2730dd5d3542bea 100644 --- a/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h +++ b/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h @@ -85,4 +85,22 @@ public: } }; +class SofQWNormalisedPolygonTestPerformance : public CxxTest::TestSuite { +public: + // This pair of boilerplate methods prevent the suite being created statically + // This means the constructor isn't called when running other tests + static SofQWNormalisedPolygonTestPerformance *createSuite() { + return new SofQWNormalisedPolygonTestPerformance(); + } + static void destroySuite(SofQWNormalisedPolygonTestPerformance *suite) { + AnalysisDataService::Instance().clear(); + delete suite; + } + + void testExec() { + auto result = + SofQWTest::runSQW<Mantid::Algorithms::SofQWNormalisedPolygon>(); + } +}; + #endif /* MANTID_ALGORITHMS_SOFQW2TEST_H_ */ diff --git a/Framework/Algorithms/test/Stitch1DTest.h b/Framework/Algorithms/test/Stitch1DTest.h index 5d7d626fc607dded67ba15bb4823102e901c1263..27480ca336b5e9dc548e4911d4e1b02f41212264 100644 --- a/Framework/Algorithms/test/Stitch1DTest.h +++ b/Framework/Algorithms/test/Stitch1DTest.h @@ -29,37 +29,40 @@ using Mantid::HistogramData::LinearGenerator; double roundSix(double i) { return floor(i * 1000000 + 0.5) / 1000000; } -class Stitch1DTest : public CxxTest::TestSuite { -private: - MatrixWorkspace_sptr createWorkspace(const HistogramX &xData, - const HistogramY &yData, - const HistogramE &eData, - const int nSpec = 1) { - - Workspace2D_sptr outWS = boost::make_shared<Workspace2D>(); - outWS->initialize(nSpec, xData.size(), yData.size()); - for (int i = 0; i < nSpec; ++i) { - outWS->mutableY(i) = yData; - outWS->mutableE(i) = eData; - outWS->mutableX(i) = xData; - } +namespace { +MatrixWorkspace_sptr createWorkspace(const HistogramX &xData, + const HistogramY &yData, + const HistogramE &eData, + const int nSpec = 1) { + + Workspace2D_sptr outWS = boost::make_shared<Workspace2D>(); + outWS->initialize(nSpec, xData.size(), yData.size()); + for (int i = 0; i < nSpec; ++i) { + outWS->mutableY(i) = yData; + outWS->mutableE(i) = eData; + outWS->mutableX(i) = xData; + } - outWS->getAxis(0)->unit() = UnitFactory::Instance().create("Wavelength"); + outWS->getAxis(0)->unit() = UnitFactory::Instance().create("Wavelength"); - return outWS; - } + return outWS; +} - MatrixWorkspace_sptr create1DWorkspace(const HistogramX &xData, - const HistogramY &yData) { - Workspace2D_sptr outWS = boost::make_shared<Workspace2D>(); - outWS->initialize(1, xData.size(), yData.size()); - outWS->mutableY(0) = yData; - outWS->mutableX(0) = xData; +MatrixWorkspace_sptr create1DWorkspace(const HistogramX &xData, + const HistogramY &yData) { + Workspace2D_sptr outWS = boost::make_shared<Workspace2D>(); + outWS->initialize(1, xData.size(), yData.size()); + outWS->mutableY(0) = yData; + outWS->mutableX(0) = xData; - outWS->getAxis(0)->unit() = UnitFactory::Instance().create("Wavelength"); + outWS->getAxis(0)->unit() = UnitFactory::Instance().create("Wavelength"); - return outWS; - } + return outWS; +} +} + +class Stitch1DTest : public CxxTest::TestSuite { +private: MatrixWorkspace_sptr a; MatrixWorkspace_sptr b; @@ -630,4 +633,43 @@ public: } }; +class Stitch1DTestPerformance : public CxxTest::TestSuite { +public: + // This pair of boilerplate methods prevent the suite being created statically + // This means the constructor isn't called when running other tests + static Stitch1DTestPerformance *createSuite() { + return new Stitch1DTestPerformance(); + } + static void destroySuite(Stitch1DTestPerformance *suite) { + AnalysisDataService::Instance().clear(); + delete suite; + } + + void setUp() { + HistogramX x1(1000, LinearGenerator(0, 0.02)); + HistogramX x2(1000, LinearGenerator(19, 0.02)); + HistogramY y1(999, 1); + HistogramY y2(999, 2); + + ws1 = create1DWorkspace(x1, y1); + ws2 = create1DWorkspace(x2, y2); + } + + void testExec() { + Stitch1D alg; + alg.setChild(true); + alg.setRethrows(true); + alg.initialize(); + alg.setProperty("LHSWorkspace", ws1); + alg.setProperty("RHSWorkspace", ws2); + alg.setProperty("Params", "0.2"); + alg.setPropertyValue("OutputWorkspace", "dummy_value"); + alg.execute(); + } + +private: + MatrixWorkspace_sptr ws1; + MatrixWorkspace_sptr ws2; +}; + #endif /* MANTID_ALGORITHMS_STITCH1DTEST_H_ */