ATLAS Offline Software
Loading...
Searching...
No Matches
ProductGenTest.cxx File Reference
#include "gtest/gtest.h"
#include "TrigHLTJetHypo/../src/ProductGen.h"
#include <vector>
Include dependency graph for ProductGenTest.cxx:

Go to the source code of this file.

Typedefs

using res = std::pair<std::vector<unsigned int>, bool>
using vec = std::vector<unsigned int>

Functions

 TEST (ProductGenTester, noargs)
 TEST (ProductGenTester, empty)
 TEST (ProductGenTester, zeroend)
 TEST (ProductGenTester, ends12)

Typedef Documentation

◆ res

using res = std::pair<std::vector<unsigned int>, bool>

Definition at line 9 of file ProductGenTest.cxx.

◆ vec

using vec = std::vector<unsigned int>

Definition at line 10 of file ProductGenTest.cxx.

Function Documentation

◆ TEST() [1/4]

TEST ( ProductGenTester ,
empty  )

Definition at line 17 of file ProductGenTest.cxx.

17 {
18 std::vector<std::size_t> ends;
19 ProductGen gen(ends);
20 EXPECT_TRUE(gen.next().empty());
21}

◆ TEST() [2/4]

TEST ( ProductGenTester ,
ends12  )

Definition at line 31 of file ProductGenTest.cxx.

31 {
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}

◆ TEST() [3/4]

TEST ( ProductGenTester ,
noargs  )

Definition at line 12 of file ProductGenTest.cxx.

12 {
14 EXPECT_TRUE(gen.next().empty());
15}

◆ TEST() [4/4]

TEST ( ProductGenTester ,
zeroend  )

Definition at line 23 of file ProductGenTest.cxx.

23 {
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}