9 #define BOOST_TEST_MODULE (return value defaults) 11 #include "boost/test/unit_test.hpp" 20 using namespace fhicl;
24 BOOST_AUTO_TEST_SUITE(types_return_value_defaults_test)
30 BOOST_TEST(
test() == 4);
38 BOOST_TEST(
test() == ref, boost::test_tools::per_element{});
40 for (
auto const& elem : ref)
41 BOOST_TEST(elem ==
test(i++));
49 BOOST_TEST(
test() == ref, boost::test_tools::per_element{});
52 for (
auto const& elem : ref)
53 BOOST_TEST(elem ==
test(i++));
60 BOOST_TEST(
test.get<0>() == 4);
61 BOOST_TEST(
test.get<1>() == 1.5);
62 BOOST_TEST(
test.get<2>() ==
false);
70 BOOST_TEST(
test.get<0>() == ref, boost::test_tools::per_element{});
71 BOOST_TEST(
test.get<1>() == 4.6);
72 BOOST_TEST(
test.get<2>() ==
true);
80 BOOST_TEST(
test.get<0>() == ref, boost::test_tools::per_element{});
81 BOOST_TEST(
test.get<1>() == 0.2);
82 BOOST_TEST(
test.get<2>() ==
false);
89 {{4, 3.7f}, 8.1,
true}};
90 auto const tuple0 =
test.get<0>();
91 BOOST_TEST(std::get<0>(tuple0) == 4);
92 BOOST_TEST(std::get<1>(tuple0) == 3.7
f);
93 BOOST_TEST(
test.get<1>() == 8.1);
94 BOOST_TEST(
test.get<2>() ==
true);
100 std::vector<std::tuple<int, float>> ref_vec{std::make_tuple(2, 5.4
f),
101 std::make_tuple(4, 104.5
f),
102 std::make_tuple(8, 15.3
f)};
104 {{2, 5.4f}, {4, 104.5f}, {8, 15.3f}}};
106 for (
auto const& elem :
test()) {
107 BOOST_TEST(std::get<0>(elem) == std::get<0>(ref_vec.at(i)));
108 BOOST_TEST(std::get<1>(elem) == std::get<1>(ref_vec.at(i++)));
115 std::array<std::tuple<int, float>, 2> ref_vec{
116 {std::make_tuple(1, 2.3
f), std::make_tuple(9, 3.2
f)}};
120 for (
auto const& elem :
test()) {
121 BOOST_TEST(std::get<0>(elem) == std::get<0>(ref_vec.at(i)));
122 BOOST_TEST(std::get<1>(elem) == std::get<1>(ref_vec.at(i++)));
129 auto ref_vec = std::vector<std::vector<int>>{{1, 5, 7}, {2}};
132 for (
auto const&
val :
test()) {
133 auto ref = ref_vec.at(i++);
134 BOOST_TEST(
val == ref);
138 for (
auto const& ref : ref_vec) {
140 BOOST_TEST(
val == ref);
147 auto ref_vec = std::vector<std::array<int, 2>>{{{1, 2}}};
150 for (
auto const&
val :
test()) {
151 auto ref = ref_vec.at(i++);
152 BOOST_TEST(
val == ref);
159 std::array<std::vector<int>, 2> ref_vec{
160 {std::vector<int>{4}, std::vector<int>{{1, 4, 9, 1}}}};
164 for (
auto const&
val :
test()) {
165 auto ref = ref_vec.at(i++);
166 BOOST_TEST(
val == ref);
173 std::array<std::array<int, 2>, 2> ref_vec{
174 {std::array<int, 2>{{6, 7}}, std::array<int, 2>{{2, 1}}}};
178 for (
auto const&
val :
test()) {
179 auto ref = ref_vec.at(i++);
180 BOOST_TEST(
val == ref);
183 BOOST_AUTO_TEST_SUITE_END()
ChannelGroupService::Name Name
yes & test(std::ostream &)
BOOST_AUTO_TEST_CASE(one_atom_t)