Belle II Software  release-08-01-10
Range.test.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <gtest/gtest.h>
9 
10 #include <tracking/trackFindingCDC/utilities/Range.h>
11 
12 #include <tracking/trackFindingCDC/utilities/GetValueType.h>
13 #include <tracking/trackFindingCDC/utilities/GetIterator.h>
14 #include <map>
15 
16 using namespace Belle2;
17 using namespace TrackFindingCDC;
18 
19 namespace {
20  TEST(TrackFindingCDCTest, utilities_Range_works_with_equal_range)
21  {
22  using IntMap = std::map<int, int>;
23  IntMap myMap;
24  myMap.emplace(1, 2);
25  myMap.emplace(3, 4);
26 
27  using IntMapIterator = GetIterator<IntMap>;
28  using IntPair = GetValueType<IntMap>;
29 
30  for (const IntPair& intPair : Range<IntMapIterator>(myMap.equal_range(1))) {
31  EXPECT_EQ(1, intPair.first);
32  }
33  }
34 }
A pair of iterators usable with the range base for loop.
Definition: Range.h:25
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Abstract base class for different kinds of events.