8 #define BOOST_TEST_MODULE (keymap test) 10 #include "boost/test/unit_test.hpp" 19 using namespace fhicl;
23 BOOST_AUTO_TEST_SUITE(types_keymap_test)
28 auto map = KeyMap::get<Atom<int>>(
"atom");
30 BOOST_TEST(map == ref, boost::test_tools::per_element{});
36 auto map = KeyMap::get<Sequence<int>>(
"sequence");
37 auto ref = {
"sequence",
"sequence[0]"};
38 BOOST_TEST(map == ref, boost::test_tools::per_element{});
44 auto map = KeyMap::get<Sequence<int, 2>>(
"sequence");
45 auto ref = {
"sequence",
"sequence[0]",
"sequence[1]"};
46 BOOST_TEST(map == ref, boost::test_tools::per_element{});
52 auto map = KeyMap::get<Tuple<int, double, bool>>(
"tuple");
53 auto ref = {
"tuple",
"tuple[0]",
"tuple[1]",
"tuple[2]"};
54 BOOST_TEST(map == ref, boost::test_tools::per_element{});
60 auto map = KeyMap::get<Tuple<Sequence<int>, double,
bool>>(
"tuple");
61 auto ref = {
"tuple",
"tuple[0]",
"tuple[0][0]",
"tuple[1]",
"tuple[2]"};
62 BOOST_TEST(map == ref, boost::test_tools::per_element{});
68 auto map = KeyMap::get<Tuple<Sequence<int, 2>, double,
bool>>(
"tuple");
70 "tuple",
"tuple[0]",
"tuple[0][0]",
"tuple[0][1]",
"tuple[1]",
"tuple[2]"};
71 BOOST_TEST(map == ref, boost::test_tools::per_element{});
77 auto map = KeyMap::get<Tuple<Tuple<int, float>, double,
bool>>(
"tuple");
79 "tuple",
"tuple[0]",
"tuple[0][0]",
"tuple[0][1]",
"tuple[1]",
"tuple[2]"};
80 BOOST_TEST(map == ref, boost::test_tools::per_element{});
86 auto map = KeyMap::get<Sequence<Tuple<int, float>>>(
"seqtuple");
87 auto ref = {
"seqtuple",
"seqtuple[0]",
"seqtuple[0][0]",
"seqtuple[0][1]"};
88 BOOST_TEST(map == ref, boost::test_tools::per_element{});
94 auto map = KeyMap::get<Sequence<Tuple<int, float>, 2>>(
"seqtuple");
95 auto ref = {
"seqtuple",
102 BOOST_TEST(map == ref, boost::test_tools::per_element{});
108 auto map = KeyMap::get<Sequence<Sequence<int>>>(
"seqseq");
109 auto ref = {
"seqseq",
"seqseq[0]",
"seqseq[0][0]"};
110 BOOST_TEST(map == ref, boost::test_tools::per_element{});
116 auto map = KeyMap::get<Sequence<Sequence<int, 2>>>(
"seqseq");
117 auto ref = {
"seqseq",
"seqseq[0]",
"seqseq[0][0]",
"seqseq[0][1]"};
118 BOOST_TEST(map == ref, boost::test_tools::per_element{});
124 auto map = KeyMap::get<Sequence<Sequence<int>, 2>>(
"seqseq");
126 "seqseq",
"seqseq[0]",
"seqseq[0][0]",
"seqseq[1]",
"seqseq[1][0]"};
127 BOOST_TEST(map == ref, boost::test_tools::per_element{});
133 auto map = KeyMap::get<Sequence<Sequence<int, 2>, 2>>(
"seqseq");
134 auto ref = {
"seqseq",
141 BOOST_TEST(map == ref, boost::test_tools::per_element{});
144 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(one_atom_t)