From 9ae2141c878b75f2ec3a313504bc5ecaf4dc40a3 Mon Sep 17 00:00:00 2001
From: Peter Parker <peter.parker@stfc.ac.uk>
Date: Thu, 3 Oct 2013 11:05:20 +0100
Subject: [PATCH] Refs #8028 - Ensure that X values are carried over to alg
 result.

* Add setX() line as per Russell's suggestion.
* Cover the X data with a unit test.
---
 .../Framework/Algorithms/src/PointByPointVCorrection.cpp       | 2 ++
 .../Framework/Algorithms/test/PointByPointVCorrectionTest.h    | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/Code/Mantid/Framework/Algorithms/src/PointByPointVCorrection.cpp b/Code/Mantid/Framework/Algorithms/src/PointByPointVCorrection.cpp
index 9d0f7cd96cc..511c0f8b3b9 100644
--- a/Code/Mantid/Framework/Algorithms/src/PointByPointVCorrection.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/PointByPointVCorrection.cpp
@@ -83,6 +83,8 @@ void PointByPointVCorrection::exec()
 		PARALLEL_START_INTERUPT_REGION
 
     const MantidVec& X=inputWS1->readX(i);
+    outputWS->setX( i, inputWS1->refX(i) );
+
     const MantidVec& Y1=inputWS1->readY(i);
     const MantidVec& Y2=inputWS2->readY(i);
     const MantidVec& E1=inputWS1->readE(i);
diff --git a/Code/Mantid/Framework/Algorithms/test/PointByPointVCorrectionTest.h b/Code/Mantid/Framework/Algorithms/test/PointByPointVCorrectionTest.h
index e49cec9c0e5..2ce87609e0d 100644
--- a/Code/Mantid/Framework/Algorithms/test/PointByPointVCorrectionTest.h
+++ b/Code/Mantid/Framework/Algorithms/test/PointByPointVCorrectionTest.h
@@ -51,6 +51,9 @@ public:
     TS_ASSERT_THROWS_NOTHING( output = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("out") );
 
     // Check a few values
+    TS_ASSERT_DELTA( output->readX(1)[4], 6.5, 0.0001 );
+    TS_ASSERT_DELTA( output->readX(1)[1], 2.0, 0.0001 );
+    TS_ASSERT_DELTA( output->readX(0)[0], 0.5, 0.000001 );
     TS_ASSERT_DELTA( output->readY(1)[4], 2.9999, 0.0001 );
     TS_ASSERT_DELTA( output->readY(1)[1], 2.9999, 0.0001 );
     TS_ASSERT_DELTA( output->readY(0)[0], 2.0, 0.000001 );
-- 
GitLab