8 #include "gtest/gtest.h"
13 using res = std::pair<std::vector<unsigned int>,
bool>;
14 using vec = std::vector<unsigned int>;
16 TEST(JetGroupUnionTester, empty) {
17 std::vector<std::size_t> siblings;
20 auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>(
nullptr);
24 EXPECT_TRUE(jgu.
next(collector).empty());
28 TEST(JetGroupUnionTester, one_elementary_cond) {
29 std::vector<std::size_t> siblings{0};
32 satisfiedBy[0] = std::vector<std::size_t> {0, 1, 2};
34 auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>(
nullptr);
38 auto exp = std::vector<std::size_t>{0, 1, 2};
39 EXPECT_EQ(jgu.
next(collector),
exp);
40 EXPECT_TRUE(jgu.
next(collector).empty());
44 TEST(JetGroupUnionTester, two_elem_nooverlap) {
45 std::vector<std::size_t> siblings{0, 1};
48 satisfiedBy[0] = std::vector<std::size_t> {0, 1, 2};
49 satisfiedBy[1] = std::vector<std::size_t> {3, 4, 5};
50 auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>(
nullptr);
54 auto exp = std::vector<std::size_t>{0, 1, 2, 3, 4, 5};
55 EXPECT_EQ(jgu.
next(collector),
exp);
56 EXPECT_TRUE(jgu.
next(collector).empty());
59 TEST(JetGroupUnionTester, two_elem_withoverlap) {
60 std::vector<std::size_t> siblings{0, 1};
63 satisfiedBy[0] = std::vector<std::size_t> {0, 1, 2};
64 satisfiedBy[1] = std::vector<std::size_t> {3, 1, 5};
66 auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>(
nullptr);
70 auto exp = std::vector<std::size_t>{0, 1, 2, 3, 5};
71 EXPECT_EQ(jgu.
next(collector),
exp);
72 EXPECT_TRUE(jgu.
next(collector).empty());