10 #define BOOST_TEST_MODULE (return values from fcl) 13 #include "boost/test/unit_test.hpp" 21 using namespace fhicl;
27 constexpr
auto tolerance = std::numeric_limits<double>::epsilon();
28 constexpr
auto ftolerance = std::numeric_limits<float>::epsilon();
50 Fixture() : FixtureBase(
"return_values_from_fcl_t.fcl") {}
55 BOOST_FIXTURE_TEST_SUITE(values_from_fcl, Fixture)
60 BOOST_TEST(
config().atom() == 5);
68 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
76 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
82 BOOST_TEST(
config().tuple.get<0>() == 5);
84 BOOST_TEST(
config().tuple.get<2>() ==
true);
90 auto ref = {4, 1, 4, 67, 89};
92 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
94 BOOST_TEST(
config().tupWithVec.get<2>() ==
false);
102 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
104 BOOST_TEST(
config().tupWithArr.get<2>() ==
true);
110 auto tuple0 =
config().tupWithTup.get<0>();
111 BOOST_TEST(std::get<0>(tuple0) == 4);
112 BOOST_TEST(std::get<1>(tuple0) == 175.218
f, ftolerance);
114 BOOST_TEST(
config().tupWithTup.get<2>() ==
false);
120 vector<int>
const nums{11, 22};
121 vector<string>
const strs{
"Decay in orbit",
"Radiative pion capture"};
124 for (
auto const& elem :
config().vecWithTup()) {
125 BOOST_TEST(std::get<0>(elem) == nums.at(i));
126 BOOST_TEST(std::get<1>(elem) == strs.at(i++));
134 vector<string>
const prefixes = {
"Tchaikovsky wrote ",
"Mahler wrote "};
135 vector<int>
const nums{6, 9};
136 string const str =
" symphonies";
139 for (
auto const& elem :
config().arrWithTup()) {
140 BOOST_TEST(std::get<0>(elem) == prefixes.at(i));
141 BOOST_TEST(std::get<1>(elem) == nums.at(i++));
142 BOOST_TEST(std::get<2>(elem) == str);
149 using vec_t = vector<int>;
150 auto ref_vec = {vec_t{1, 4, 6, 8}, vec_t{1, 3}, vec_t{6}};
151 auto it = ref_vec.begin();
153 for (
auto const&
val :
config().vecOfVec()) {
155 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
159 for (
auto const& ref : ref_vec) {
161 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
168 using array_t = array<int, 2>;
169 auto ref_vec = {array_t{{1, 6}}, array_t{{2, 12}}, array_t{{3, 18}}};
170 auto it = ref_vec.begin();
172 for (
auto const&
val :
config().vecOfArr()) {
174 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
181 auto ref_vec = {vector<int>{1, 2, 3, 4, 5, 6, 7}, vector<int>{8, 9, 10}};
182 auto it = ref_vec.begin();
184 for (
auto const&
val :
config().arrOfVec()) {
186 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
193 auto ref_vec = {array<int, 2>{{1, 0}}, array<int, 2>{{0, 1}}};
194 auto it = ref_vec.begin();
196 for (
auto const&
val :
config().arrOfArr()) {
198 BOOST_TEST(
val == ref, boost::test_tools::per_element{});
202 BOOST_AUTO_TEST_SUITE_END()
ChannelGroupService::Name Name
BOOST_AUTO_TEST_CASE(atom)