10 #define BOOST_TEST_MODULE (keymap test with tables) 12 #include "boost/test/unit_test.hpp" 23 using namespace fhicl;
35 BOOST_AUTO_TEST_SUITE(types_keymap_test)
40 auto map = KeyMap::get<Table<S>>(
"table");
50 BOOST_TEST(map == ref, boost::test_tools::per_element{});
56 auto map = KeyMap::get<Sequence<Table<S>>>(
"seqtable");
58 auto ref = {
"seqtable",
61 "seqtable[0].sequence",
62 "seqtable[0].sequence[0]",
63 "seqtable[0].sequence[1]",
65 "seqtable[0].tuple[0]",
66 "seqtable[0].tuple[1]",
67 "seqtable[0].tuple[2]"};
68 BOOST_TEST(map == ref, boost::test_tools::per_element{});
74 auto map = KeyMap::get<Sequence<Table<S>, 2>>(
"seqtable");
75 auto ref = {
"seqtable",
78 "seqtable[0].sequence",
79 "seqtable[0].sequence[0]",
80 "seqtable[0].sequence[1]",
82 "seqtable[0].tuple[0]",
83 "seqtable[0].tuple[1]",
84 "seqtable[0].tuple[2]",
87 "seqtable[1].sequence",
88 "seqtable[1].sequence[0]",
89 "seqtable[1].sequence[1]",
91 "seqtable[1].tuple[0]",
92 "seqtable[1].tuple[1]",
93 "seqtable[1].tuple[2]"};
94 BOOST_TEST(map == ref, boost::test_tools::per_element{});
100 auto map = KeyMap::get<Tuple<Table<S>,
int,
double>>(
"tuptable");
101 auto ref = {
"tuptable",
104 "tuptable[0].sequence",
105 "tuptable[0].sequence[0]",
106 "tuptable[0].sequence[1]",
108 "tuptable[0].tuple[0]",
109 "tuptable[0].tuple[1]",
110 "tuptable[0].tuple[2]",
113 BOOST_TEST(map == ref, boost::test_tools::per_element{});
119 auto map = KeyMap::get<Tuple<Sequence<Table<S>>,
int,
double>>(
"seqtuptable");
120 auto ref = {
"seqtuptable",
123 "seqtuptable[0][0].atom",
124 "seqtuptable[0][0].sequence",
125 "seqtuptable[0][0].sequence[0]",
126 "seqtuptable[0][0].sequence[1]",
127 "seqtuptable[0][0].tuple",
128 "seqtuptable[0][0].tuple[0]",
129 "seqtuptable[0][0].tuple[1]",
130 "seqtuptable[0][0].tuple[2]",
133 BOOST_TEST(map == ref, boost::test_tools::per_element{});
140 KeyMap::get<Tuple<Sequence<Table<S>, 2>,
int,
double>>(
"seqtuptable");
141 auto ref = {
"seqtuptable",
144 "seqtuptable[0][0].atom",
145 "seqtuptable[0][0].sequence",
146 "seqtuptable[0][0].sequence[0]",
147 "seqtuptable[0][0].sequence[1]",
148 "seqtuptable[0][0].tuple",
149 "seqtuptable[0][0].tuple[0]",
150 "seqtuptable[0][0].tuple[1]",
151 "seqtuptable[0][0].tuple[2]",
153 "seqtuptable[0][1].atom",
154 "seqtuptable[0][1].sequence",
155 "seqtuptable[0][1].sequence[0]",
156 "seqtuptable[0][1].sequence[1]",
157 "seqtuptable[0][1].tuple",
158 "seqtuptable[0][1].tuple[0]",
159 "seqtuptable[0][1].tuple[1]",
160 "seqtuptable[0][1].tuple[2]",
163 BOOST_TEST(map == ref, boost::test_tools::per_element{});
169 auto map = KeyMap::get<Sequence<Tuple<Table<S>,
int,
double>>>(
"tupseqtable");
170 auto ref = {
"tupseqtable",
173 "tupseqtable[0][0].atom",
174 "tupseqtable[0][0].sequence",
175 "tupseqtable[0][0].sequence[0]",
176 "tupseqtable[0][0].sequence[1]",
177 "tupseqtable[0][0].tuple",
178 "tupseqtable[0][0].tuple[0]",
179 "tupseqtable[0][0].tuple[1]",
180 "tupseqtable[0][0].tuple[2]",
182 "tupseqtable[0][2]"};
183 BOOST_TEST(map == ref, boost::test_tools::per_element{});
190 KeyMap::get<Sequence<Tuple<Table<S>,
int,
double>, 2>>(
"tupseqtable");
191 auto ref = {
"tupseqtable",
194 "tupseqtable[0][0].atom",
195 "tupseqtable[0][0].sequence",
196 "tupseqtable[0][0].sequence[0]",
197 "tupseqtable[0][0].sequence[1]",
198 "tupseqtable[0][0].tuple",
199 "tupseqtable[0][0].tuple[0]",
200 "tupseqtable[0][0].tuple[1]",
201 "tupseqtable[0][0].tuple[2]",
206 "tupseqtable[1][0].atom",
207 "tupseqtable[1][0].sequence",
208 "tupseqtable[1][0].sequence[0]",
209 "tupseqtable[1][0].sequence[1]",
210 "tupseqtable[1][0].tuple",
211 "tupseqtable[1][0].tuple[0]",
212 "tupseqtable[1][0].tuple[1]",
213 "tupseqtable[1][0].tuple[2]",
215 "tupseqtable[1][2]"};
216 BOOST_TEST(map == ref, boost::test_tools::per_element{});
223 BOOST_TEST(
tf().
test.key() ==
"atom");
228 auto mapseq = km.
result();
229 auto refseq = {
"sequence",
"sequence[0]",
"sequence[1]"};
230 BOOST_TEST(mapseq == refseq, boost::test_tools::per_element{});
236 auto maptup = km.
result();
237 auto reftup = {
"tuple",
"tuple[0]",
"tuple[1]",
"tuple[2]"};
238 BOOST_TEST(maptup == reftup, boost::test_tools::per_element{});
242 BOOST_AUTO_TEST_SUITE_END()
ChannelGroupService::Name Name
static constexpr double km
void walk_over(tt::maybe_const_t< ParameterBase, C > &)
auto const & result() const
BOOST_AUTO_TEST_CASE(table_t)