Belle II Software  release-05-01-25
Range.test.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost <oliver.frost@desy.de> *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <gtest/gtest.h>
11 
12 #include <tracking/trackFindingCDC/utilities/Range.h>
13 
14 #include <tracking/trackFindingCDC/utilities/GetValueType.h>
15 #include <tracking/trackFindingCDC/utilities/GetIterator.h>
16 #include <map>
17 
18 using namespace Belle2;
19 using namespace TrackFindingCDC;
20 
21 namespace {
22  TEST(TrackFindingCDCTest, utilities_Range_works_with_equal_range)
23  {
24  using IntMap = std::map<int, int>;
25  IntMap myMap;
26  myMap.emplace(1, 2);
27  myMap.emplace(3, 4);
28 
29  using IntMapIterator = GetIterator<IntMap>;
30  using IntPair = GetValueType<IntMap>;
31 
32  for (const IntPair& intPair : Range<IntMapIterator>(myMap.equal_range(1))) {
33  EXPECT_EQ(1, intPair.first);
34  }
35  }
36 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Range
Represents a range of arithmetic types.
Definition: Range.h:39
Belle2::TEST
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Definition: utilityFunctions.cc:18