From cd25aa64aa1f23b65a2f9de6201d270d50406cc4 Mon Sep 17 00:00:00 2001
From: Anthony Lim <anthony.lim@stfc.ac.uk>
Date: Mon, 2 Oct 2017 08:36:05 +0100
Subject: [PATCH] refs #20714 made some notes in test

---
 .../inc/MantidAlgorithms/PhaseQuadMuon.h      |  4 ++--
 Framework/Algorithms/src/PhaseQuadMuon.cpp    |  4 ++--
 Framework/Algorithms/test/PhaseQuadMuonTest.h | 23 +++++++++++++++----
 3 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/Framework/Algorithms/inc/MantidAlgorithms/PhaseQuadMuon.h b/Framework/Algorithms/inc/MantidAlgorithms/PhaseQuadMuon.h
index 967087d773d..f60a710f68a 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/PhaseQuadMuon.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/PhaseQuadMuon.h
@@ -63,10 +63,10 @@ private:
   API::MatrixWorkspace_sptr squash(const API::MatrixWorkspace_sptr &ws,
                                    const API::ITableWorkspace_sptr &phase,
                                    const std::vector<double> &n0);
- size_t findName(const std::string pattern, const std::vector<std::string> &names);
+ int findName(const std::string pattern, const std::vector<std::string> &names);
 };
 
 } // namespace Algorithms
 } // namespace Mantid
 
-#endif /*MANTID_ALGORITHM_PHASEQUAD_H_*/
\ No newline at end of file
+#endif /*MANTID_ALGORITHM_PHASEQUAD_H_*/
diff --git a/Framework/Algorithms/src/PhaseQuadMuon.cpp b/Framework/Algorithms/src/PhaseQuadMuon.cpp
index da6db27257a..43d9a5ab1de 100644
--- a/Framework/Algorithms/src/PhaseQuadMuon.cpp
+++ b/Framework/Algorithms/src/PhaseQuadMuon.cpp
@@ -128,14 +128,14 @@ std::map<std::string, std::string> PhaseQuadMuon::validateInputs() {
   return result;
 }
 
-size_t PhaseQuadMuon::findName(const std::string pattern, const std::vector<std::string> &names) {
+int PhaseQuadMuon::findName(const std::string pattern, const std::vector<std::string> &names) {
 	auto it = std::find_if(names.begin(), names.end(), [pattern](const std::string& s) {
 		if (s == pattern) { return true; }
 		else { return false; } });
 	if (it == names.end()) {
 		return -1;
 	}
-	return std::distance(names.begin(), it);
+	return static_cast<int>(std::distance(names.begin(), it));
 }
 
 
diff --git a/Framework/Algorithms/test/PhaseQuadMuonTest.h b/Framework/Algorithms/test/PhaseQuadMuonTest.h
index 005d3b23360..b19308f1dd8 100644
--- a/Framework/Algorithms/test/PhaseQuadMuonTest.h
+++ b/Framework/Algorithms/test/PhaseQuadMuonTest.h
@@ -13,10 +13,10 @@ using namespace Mantid::DataObjects;
 using namespace Mantid::API;
 
 namespace {
-void populatePhaseTable(ITableWorkspace_sptr phaseTable) {
-  phaseTable->addColumn("int", "DetectorID");
-  phaseTable->addColumn("double", "DetectorAsymmetry");
-  phaseTable->addColumn("double", "DetectorPhase");
+void populatePhaseTable(ITableWorkspace_sptr phaseTable, std::vector<std::string> names) {
+  phaseTable->addColumn("int", names[0]);
+  phaseTable->addColumn("double", names[1]);
+  phaseTable->addColumn("double",names[2]);
   for (int i = 0; i < 16; i++) {
     TableRow phaseRow1 = phaseTable->appendRow();
     phaseRow1 << i << 1. << 0.;
@@ -24,7 +24,9 @@ void populatePhaseTable(ITableWorkspace_sptr phaseTable) {
     phaseRow2 << i << 1. << 1.57;
   }
 }
-
+void populatePhaseTable(ITableWorkspace_sptr phaseTable) {
+  populatePhaseTable(phaseTable,{"DetectorID", "Asymmetry", "Phase"});
+}
 IAlgorithm_sptr setupAlg(MatrixWorkspace_sptr inputWs, bool isChildAlg) {
   // Create and populate a detector table
   boost::shared_ptr<ITableWorkspace> phaseTable(
@@ -103,6 +105,17 @@ public:
     TS_ASSERT_DELTA(specImE[20], 0.0031, 0.0001);
     TS_ASSERT_DELTA(specImE[50], 0.0035, 0.0001);
   }
+  // add test for no phase
+
+ // add test for no asymm
+
+ // add test for two phase
+
+ // add test for two asymm
+
+ // add test for different order
+
+
 };
 
 class PhaseQuadMuonTestPerformance : public CxxTest::TestSuite {
-- 
GitLab