9 #include <boost/test/unit_test.hpp>
31 struct FeatureSelector {
34 bool operator()(
const Object&
object)
const {
35 return object.feature == select_on;
43 bool operator()(
const Object&
object)
const {
44 return object.name == select_on;
48 struct CombineFixture {
49 FeatureSelector selectObjectFeature = {1};
50 NameSelector selectObjectName = {
"same_name"};
51 Object obj = {1,
"same_name"};
52 Object objWrongFeature = {2,
"same_name"};
53 Object objWrongName = {1,
"another_name"};
58 BOOST_AUTO_TEST_SUITE(FatrasSelectorHelpers)
63 BOOST_CHECK(not minEta(backward));
64 BOOST_CHECK(not minEta(central));
65 BOOST_CHECK(minEta(forward));
69 BOOST_CHECK(minAbsEta(backward));
70 BOOST_CHECK(not minAbsEta(central));
71 BOOST_CHECK(minAbsEta(forward));
77 BOOST_CHECK(maxEta(backward));
78 BOOST_CHECK(maxEta(central));
79 BOOST_CHECK(not maxEta(forward));
83 BOOST_CHECK(not maxAbsEta(backward));
84 BOOST_CHECK(maxAbsEta(central));
85 BOOST_CHECK(not maxAbsEta(forward));
90 BOOST_CHECK(rangeEta(backward));
91 BOOST_CHECK(not rangeEta(central));
92 BOOST_CHECK(not rangeEta(forward));
95 BOOST_CHECK(rangeAbsEta(backward));
96 BOOST_CHECK(not rangeAbsEta(central));
97 BOOST_CHECK(rangeAbsEta(forward));
103 select.
get<FeatureSelector>() = f.selectObjectFeature;
104 BOOST_CHECK(select(f.obj));
105 BOOST_CHECK(not select(f.objWrongFeature));
106 BOOST_CHECK(select(f.objWrongName));
112 select.
get<FeatureSelector>() = f.selectObjectFeature;
113 select.
get<NameSelector>() = f.selectObjectName;
114 BOOST_CHECK(select(f.obj));
115 BOOST_CHECK(not select(f.objWrongFeature));
116 BOOST_CHECK(not select(f.objWrongName));
122 select.
get<FeatureSelector>() = f.selectObjectFeature;
123 BOOST_CHECK(select(f.obj));
124 BOOST_CHECK(not select(f.objWrongFeature));
125 BOOST_CHECK(select(f.objWrongName));
131 select.
get<FeatureSelector>() = f.selectObjectFeature;
132 select.
get<NameSelector>() = f.selectObjectName;
133 BOOST_CHECK(select(f.obj));
134 BOOST_CHECK(select(f.objWrongFeature));
135 BOOST_CHECK(select(f.objWrongName));
138 BOOST_AUTO_TEST_SUITE_END()