ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypoUnitTests
tests
ProductGenTest.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "gtest/gtest.h"
6
#include "
TrigHLTJetHypo/../src/ProductGen.h
"
7
#include <vector>
8
9
using
res
= std::pair<std::vector<unsigned int>,
bool
>;
10
using
vec
= std::vector<unsigned int>;
11
12
TEST
(ProductGenTester, noargs) {
13
ProductGen
gen;
14
EXPECT_TRUE(gen.next().empty());
15
}
16
17
TEST
(ProductGenTester,
empty
) {
18
std::vector<std::size_t> ends;
19
ProductGen
gen(ends);
20
EXPECT_TRUE(gen.next().empty());
21
}
22
23
TEST
(ProductGenTester, zeroend) {
24
ProductGen
gen(std::vector<std::size_t>({0,2}));
25
26
// no values due to and end value of 0.
27
EXPECT_TRUE(gen.next().empty());
28
}
29
30
31
TEST
(ProductGenTester, ends12) {
32
ProductGen
gen(std::vector<std::size_t>({2, 3}));
33
34
std::vector<std::size_t> exp{0, 0};
35
EXPECT_EQ(gen.next(), exp);
36
37
exp = std::vector<std::size_t>{1, 0};
38
EXPECT_EQ(gen.next(), exp);
39
40
exp = std::vector<std::size_t>{0, 1};
41
EXPECT_EQ(gen.next(), exp);
42
43
exp = std::vector<std::size_t>{1, 1};
44
EXPECT_EQ(gen.next(), exp);
45
46
exp = std::vector<std::size_t>{0, 2};
47
EXPECT_EQ(gen.next(), exp);
48
49
exp = std::vector<std::size_t>{1, 2};
50
EXPECT_EQ(gen.next(), exp);
51
52
EXPECT_TRUE(gen.next().empty());
53
}
54
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
res
std::pair< std::vector< unsigned int >, bool > res
Definition
JetGroupProductTest.cxx:11
TEST
TEST(ProductGenTester, noargs)
Definition
ProductGenTest.cxx:12
ProductGen.h
empty
static const Attributes_t empty
Definition
XmlStreamer.cxx:16
ProductGen
Definition
ProductGen.h:13
Generated on
for ATLAS Offline Software by
1.17.0