From 248b1bbf1fed37237b19992e05894cf1d1e38506 Mon Sep 17 00:00:00 2001
From: Bhuvan Bezawada <bhuvan_777@outlook.com>
Date: Thu, 9 Aug 2018 15:27:54 +0100
Subject: [PATCH] Updated c++ unit tests for iterator

re #23145
---
 .../Geometry/test/DetectorInfoIteratorTest.h  | 35 ++++++-------------
 1 file changed, 11 insertions(+), 24 deletions(-)

diff --git a/Framework/Geometry/test/DetectorInfoIteratorTest.h b/Framework/Geometry/test/DetectorInfoIteratorTest.h
index cb6f5ea0583..67c516b7b31 100644
--- a/Framework/Geometry/test/DetectorInfoIteratorTest.h
+++ b/Framework/Geometry/test/DetectorInfoIteratorTest.h
@@ -1,11 +1,6 @@
 #ifndef MANTID_GEOMETRY_DETECTORINFOITERATORTEST_H_
 #define MANTID_GEOMETRY_DETECTORINFOITERATORTEST_H_
 
-#include <algorithm>
-#include <boost/make_shared.hpp>
-#include <cxxtest/TestSuite.h>
-#include <set>
-
 #include "MantidBeamline/DetectorInfo.h"
 #include "MantidGeometry/Instrument/Detector.h"
 #include "MantidGeometry/Instrument/DetectorInfo.h"
@@ -17,10 +12,15 @@
 #include "MantidKernel/V3D.h"
 #include "MantidTestHelpers/ComponentCreationHelper.h"
 
-using namespace Mantid::Geometry;
+#include <algorithm>
+#include <boost/make_shared.hpp>
+#include <cxxtest/TestSuite.h>
+#include <set>
+
+using Mantid::detid_t;
 using Mantid::Kernel::V3D;
 using namespace ComponentCreationHelper;
-using Mantid::detid_t;
+using namespace Mantid::Geometry;
 
 class DetectorInfoIteratorTest : public CxxTest::TestSuite {
 public:
@@ -147,38 +147,25 @@ public:
     TS_ASSERT(iter == detectorInfo.begin());
   }
 
-  void test_iterator_position() {
-    // Get the DetectorInfo object
-    auto detectorInfo = create_detector_info_object();
-    auto iter = detectorInfo.begin();
-
-    for (int i = 0; i < 11; i++) {
-      TS_ASSERT_EQUALS(iter->position(), i);
-      ++iter;
-    }
-  }
-
   void test_copy_iterator() {
     // Get the DetectorInfo object
     auto detectorInfo = create_detector_info_object();
     auto iter = detectorInfo.begin();
 
+    // Create a copy
     auto iterCopy = DetectorInfoIterator(iter);
 
+    // Check
     TS_ASSERT_EQUALS(iter->getIndex(), 0);
     TS_ASSERT_EQUALS(iterCopy->getIndex(), 0);
 
-    TS_ASSERT_EQUALS(iter->position(), 0);
-    TS_ASSERT_EQUALS(iterCopy->position(), 0);
-
+    // Increment
     ++iter;
     ++iterCopy;
 
+    // Check again
     TS_ASSERT_EQUALS(iter->getIndex(), 1);
     TS_ASSERT_EQUALS(iterCopy->getIndex(), 1);
-
-    TS_ASSERT_EQUALS(iter->position(), 1);
-    TS_ASSERT_EQUALS(iterCopy->position(), 1);
   }
 };
 
-- 
GitLab