From 5b7b69a216d4efdda4e07f85e5a22301a3ed1205 Mon Sep 17 00:00:00 2001 From: Michael Wedel <michael.wedel@psi.ch> Date: Thu, 26 Mar 2015 22:41:56 +0100 Subject: [PATCH] Refs #11174. Adding small tolerance to test PolarizationCorrectionTest failed, because the error on the output workspace of the algorithm is 2.2e-16 instead of 0.0. I could not find out why, so I added a small tolerance to the unit test. --- .../Framework/Algorithms/test/PolarizationCorrectionTest.h | 1 + .../Framework/TestHelpers/src/WorkspaceCreationHelper.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/Framework/Algorithms/test/PolarizationCorrectionTest.h b/Code/Mantid/Framework/Algorithms/test/PolarizationCorrectionTest.h index ea8ebf25def..e1c508f6424 100644 --- a/Code/Mantid/Framework/Algorithms/test/PolarizationCorrectionTest.h +++ b/Code/Mantid/Framework/Algorithms/test/PolarizationCorrectionTest.h @@ -178,6 +178,7 @@ public: checkAlg->setChild(true); checkAlg->setProperty("Workspace1", groupWS->getItem(i)); checkAlg->setProperty("Workspace2", outWS->getItem(i)); + checkAlg->setProperty("Tolerance", 3e-16); checkAlg->execute(); const std::string result = checkAlg->getProperty("Result"); TS_ASSERT_EQUALS("Success!", result); diff --git a/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp b/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp index addcd3b9212..1b5c6875f77 100644 --- a/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp +++ b/Code/Mantid/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp @@ -81,10 +81,8 @@ Workspace2D_sptr Create1DWorkspaceConstant(int size, double value, double error) { MantidVecPtr x1, y1, e1; x1.access().resize(size, 1); - y1.access().resize(size); - std::fill(y1.access().begin(), y1.access().end(), value); - e1.access().resize(size); - std::fill(e1.access().begin(), e1.access().end(), error); + y1.access().resize(size, value); + e1.access().resize(size, error); Workspace2D_sptr retVal(new Workspace2D); retVal->initialize(1, size, size); retVal->setX(0, x1); -- GitLab