9 #include <boost/test/unit_test.hpp>
25 std::string
name =
"";
29 struct FeatureSelector {
32 bool operator()(
const Object&
object)
const {
33 return object.feature == select_on;
39 std::string select_on =
"";
41 bool operator()(
const Object&
object)
const {
42 return object.name == select_on;
46 struct CombineFixture {
47 FeatureSelector selectObjectFeature = {1};
48 NameSelector selectObjectName = {
"same_name"};
49 Object obj = {1,
"same_name"};
50 Object objWrongFeature = {2,
"same_name"};
51 Object objWrongName = {1,
"another_name"};
56 BOOST_AUTO_TEST_SUITE(FatrasSelectorHelpers)
62 BOOST_CHECK(not minEta(central));
68 BOOST_CHECK(not minAbsEta(central));
69 BOOST_CHECK(minAbsEta(
forward));
76 BOOST_CHECK(maxEta(central));
77 BOOST_CHECK(not maxEta(
forward));
81 BOOST_CHECK(not maxAbsEta(
backward));
82 BOOST_CHECK(maxAbsEta(central));
83 BOOST_CHECK(not maxAbsEta(
forward));
89 BOOST_CHECK(not rangeEta(central));
90 BOOST_CHECK(not rangeEta(
forward));
94 BOOST_CHECK(not rangeAbsEta(central));
95 BOOST_CHECK(rangeAbsEta(
forward));
101 select.
get<FeatureSelector>() = f.selectObjectFeature;
102 BOOST_CHECK(select(f.obj));
103 BOOST_CHECK(not select(f.objWrongFeature));
104 BOOST_CHECK(select(f.objWrongName));
110 select.
get<FeatureSelector>() = f.selectObjectFeature;
111 select.
get<NameSelector>() = f.selectObjectName;
112 BOOST_CHECK(select(f.obj));
113 BOOST_CHECK(not select(f.objWrongFeature));
114 BOOST_CHECK(not select(f.objWrongName));
120 select.
get<FeatureSelector>() = f.selectObjectFeature;
121 BOOST_CHECK(select(f.obj));
122 BOOST_CHECK(not select(f.objWrongFeature));
123 BOOST_CHECK(select(f.objWrongName));
129 select.
get<FeatureSelector>() = f.selectObjectFeature;
130 select.
get<NameSelector>() = f.selectObjectName;
131 BOOST_CHECK(select(f.obj));
132 BOOST_CHECK(select(f.objWrongFeature));
133 BOOST_CHECK(select(f.objWrongName));
136 BOOST_AUTO_TEST_SUITE_END()