ATLAS Offline Software
CombinationsGeneratorTest.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include "gtest/gtest.h"
10 #include <vector>
11 
12 using vec = std::vector<size_t>;
13 
14 TEST(CombinationsGeneratorTester, n3k1) {
16  // return value from bump() says whether the generator has cycled.
17  EXPECT_EQ (vec{0}, gen.get());
18  EXPECT_EQ (false, gen.bump());
19  EXPECT_EQ (vec{1}, gen.get());
20  EXPECT_EQ (false, gen.bump());
21  EXPECT_EQ (vec{2}, gen.get());
22  EXPECT_EQ (true, gen.bump());
23 }
24 
25 TEST(CombinationsGeneratorTester, n3k2) {
27  vec v0 {0,1};
28  vec v1 {0,2};
29  vec v2 {1,2};
30  EXPECT_EQ (v0, gen.get());
31  EXPECT_EQ (false, gen.bump());
32  EXPECT_EQ (v1, gen.get());
33  EXPECT_EQ (false, gen.bump());
34  EXPECT_EQ (v2, gen.get());
35  EXPECT_EQ (true, gen.bump());
36 }
37 
38 TEST(CombinationsGeneratorTester, n3k3) {
40  vec v0 {0,1,2};
41  EXPECT_EQ (v0, gen.get());
42  EXPECT_EQ (true, gen.bump());
43 }
44 
45 TEST(CombinationsGeneratorTester, n3k0) {
47  vec v0 {};
48  EXPECT_EQ (v0, gen.get());
49  EXPECT_EQ (true, gen.bump());
50 }
51 
52 TEST(CombinationsGeneratorTester, n3k4) {
54  vec v0 {};
55  EXPECT_EQ (v0, gen.get());
56  EXPECT_EQ (true, gen.bump());
57 }
58 
59 
60 
TEST
TEST(CombinationsGeneratorTester, n3k1)
Definition: CombinationsGeneratorTest.cxx:14
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Definition: CombinationsGeneratorTest.cxx:6
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
CombinationsGenerator.h
CombinationsGenerator
Definition: CombinationsGenerator.h:24
master.gen
gen
Definition: master.py:32
parseMapping.v0
def v0
Definition: parseMapping.py:149
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
checker_macros.h
Define macros for attributes used to control the static checker.