From d7a5f0784caf16a950cf26fe1c59cffc5a4a674b Mon Sep 17 00:00:00 2001
From: Matt King <matthew.king@stfc.ac.uk>
Date: Tue, 2 Feb 2016 15:15:51 +0000
Subject: [PATCH] changes to System and Unit tests in regards to re-rotating
 source

Refs #15136
---
 Framework/Algorithms/src/ReflectometryReductionOne.cpp      | 5 +++++
 Framework/Algorithms/test/ReflectometryReductionOneTest.h   | 6 +++---
 Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py | 5 +++++
 .../analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py | 5 +++++
 4 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/Framework/Algorithms/src/ReflectometryReductionOne.cpp b/Framework/Algorithms/src/ReflectometryReductionOne.cpp
index 8f465304950..4b4e63bd811 100644
--- a/Framework/Algorithms/src/ReflectometryReductionOne.cpp
+++ b/Framework/Algorithms/src/ReflectometryReductionOne.cpp
@@ -394,12 +394,17 @@ Mantid::API::MatrixWorkspace_sptr ReflectometryReductionOne::toIvsQ(
 
   // Rotate the source back to its original position
   if (rotationTheta != 0.0) {
+    // for IvsLam Workspace
     auto rotateSource = this->createChildAlgorithm("RotateSource");
     rotateSource->setChild(true);
     rotateSource->initialize();
     rotateSource->setProperty("Workspace", toConvert);
     rotateSource->setProperty("Angle", -rotationTheta);
     rotateSource->execute();
+    // for IvsQ Workspace
+    rotateSource->setProperty("Workspace", inQ);
+    rotateSource->setProperty("Angle", -rotationTheta);
+    rotateSource->execute();
   }
 
   return inQ;
diff --git a/Framework/Algorithms/test/ReflectometryReductionOneTest.h b/Framework/Algorithms/test/ReflectometryReductionOneTest.h
index 39b9d056c5c..0f3a49f2efd 100644
--- a/Framework/Algorithms/test/ReflectometryReductionOneTest.h
+++ b/Framework/Algorithms/test/ReflectometryReductionOneTest.h
@@ -207,7 +207,7 @@ public:
 
     TS_ASSERT_EQUALS(m_tinyReflWS->getInstrument()->getSource()->getPos(),
                      outLam->getInstrument()->getSource()->getPos());
-    TS_ASSERT_DIFFERS(outLam->getInstrument()->getSource()->getPos(),
+    TS_ASSERT_EQUALS(outLam->getInstrument()->getSource()->getPos(),
                       outQ->getInstrument()->getSource()->getPos());
   }
 
@@ -270,8 +270,8 @@ public:
     double outTheta = alg->getProperty("ThetaOut");
 
     TS_ASSERT_DELTA(45.0, outTheta, 0.00001);
-    TS_ASSERT_DIFFERS(source->getPos(),
-                      inQ->getInstrument()->getSource()->getPos())
+    TS_ASSERT_EQUALS(source->getPos(),
+        inQ->getInstrument()->getSource()->getPos());
     // convert from degrees to radians for sin() function
     double outThetaInRadians = outTheta * M_PI / 180;
 
diff --git a/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py b/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py
index c764a1a3e6a..bd905d870a7 100644
--- a/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py
+++ b/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAuto.py
@@ -33,6 +33,11 @@ class OFFSPECReflRedOneAuto(stresstesting.MantidStressTest):
         return True
 
     def validate(self):
+        '''
+        we only wish to check the Q-range in this system test. It is not necessary
+        to check the Instrument definition or Instrument Parameters
+        '''
+        self.disableChecking = ["Instrument"]
         return ("ivq_75_76_78","OFFSPECReflRedOneAuto_good_v2.nxs")
 
     def requiredFiles(self):
diff --git a/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py b/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py
index 6d6c93211c3..a88d0ec051e 100644
--- a/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py
+++ b/Testing/SystemTests/tests/analysis/OFFSPECReflRedOneAutoPolarizationCorrection.py
@@ -35,6 +35,11 @@ class OFFSPECReflRedOneAutoPolarizationCorrection(stresstesting.MantidStressTest
         return True
 
     def validate(self):
+        '''
+        we only wish to check the data from PolarizationCorrection in this system test.
+        It is not necessary to check the Instrument definition or Instrument Parameters
+        '''
+        self.disableChecking = ["Instrument"]
         return ("_IvsLam_polCorr", "OFFSPECReflRedOneAutoPolarizationCorrection_good_v2.nxs")
 
     def requiredFiles(self):
-- 
GitLab