9 #include <boost/test/unit_test.hpp>
24 std::string
name =
"";
28 struct FeatureSelector {
31 bool operator()(
const Object&
object)
const {
32 return object.feature == select_on;
38 std::string select_on =
"";
40 bool operator()(
const Object&
object)
const {
41 return object.name == select_on;
45 struct CombineFixture {
46 FeatureSelector selectObjectFeature = {1};
47 NameSelector selectObjectName = {
"same_name"};
48 Object obj = {1,
"same_name"};
49 Object objWrongFeature = {2,
"same_name"};
50 Object objWrongName = {1,
"another_name"};
55 BOOST_AUTO_TEST_SUITE(FatrasSelectorHelpers)
61 BOOST_TEST(not minEta(central));
67 BOOST_TEST(not minAbsEta(central));
75 BOOST_TEST(maxEta(central));
76 BOOST_TEST(not maxEta(
forward));
81 BOOST_TEST(maxAbsEta(central));
82 BOOST_TEST(not maxAbsEta(
forward));
88 BOOST_TEST(not rangeEta(central));
89 BOOST_TEST(not rangeEta(
forward));
93 BOOST_TEST(not rangeAbsEta(central));
94 BOOST_TEST(rangeAbsEta(
forward));
100 select.
get<FeatureSelector>() = f.selectObjectFeature;
101 BOOST_TEST(select(f.obj));
102 BOOST_TEST(not select(f.objWrongFeature));
103 BOOST_TEST(select(f.objWrongName));
109 select.
get<FeatureSelector>() = f.selectObjectFeature;
110 select.
get<NameSelector>() = f.selectObjectName;
111 BOOST_TEST(select(f.obj));
112 BOOST_TEST(not select(f.objWrongFeature));
113 BOOST_TEST(not select(f.objWrongName));
119 select.
get<FeatureSelector>() = f.selectObjectFeature;
120 BOOST_TEST(select(f.obj));
121 BOOST_TEST(not select(f.objWrongFeature));
122 BOOST_TEST(select(f.objWrongName));
128 select.
get<FeatureSelector>() = f.selectObjectFeature;
129 select.
get<NameSelector>() = f.selectObjectName;
130 BOOST_TEST(select(f.obj));
131 BOOST_TEST(select(f.objWrongFeature));
132 BOOST_TEST(select(f.objWrongName));
135 BOOST_AUTO_TEST_SUITE_END()