7 #define BOOST_TEST_MODULE (tupleAs test) 9 #include "boost/test/unit_test.hpp" 19 using namespace fhicl;
26 ThreeNumbers(
int i,
int j,
int k) : i_{i}, j_{j}, k_{k} {}
35 Person(
string name,
unsigned age) : name_{name}, age_{age} {}
40 return (name_ == p.name_) && (age_ == p.age_);
53 return os <<
"Name: " << p.name_ <<
" Age: " << p.age_;
58 ToVector(
int j, vector<int>
const& v)
61 value_.push_back(j * number);
71 ThreeNumbers{1, 3, 5}};
79 std::vector<Person>{{
"Billy", 10}, {
"Susie", 14}}};
83 Fixture() : FixtureBase(
"tupleAs_t.fcl") {}
88 BOOST_FIXTURE_TEST_SUITE(tupleAs_test, Fixture)
92 ThreeNumbers
const& tn1 =
config().tn1();
93 BOOST_TEST(tn1.i_ == 1);
94 BOOST_TEST(tn1.j_ == 9);
95 BOOST_TEST(tn1.k_ == 17);
100 ThreeNumbers
const& tn2 =
config().tn2();
101 BOOST_TEST(tn2.i_ == 1);
102 BOOST_TEST(tn2.j_ == 3);
103 BOOST_TEST(tn2.k_ == 5);
108 ToVector
const& v =
config().toVector();
109 auto const ref = {5, 10, 15, 20};
110 BOOST_TEST(v.value_ == ref, boost::test_tools::per_element{});
115 auto const& people =
config().people();
116 auto const ref = {Person{
"Alice", 1},
118 Person{
"Charlie", 3},
119 Person{
"Danielle", 4},
121 BOOST_TEST(people == ref, boost::test_tools::per_element{});
126 auto const& people =
config().kids();
127 auto const ref = {Person{
"Billy", 10}, Person{
"Susie", 14}};
128 BOOST_TEST(people == ref, boost::test_tools::per_element{});
131 BOOST_AUTO_TEST_SUITE_END()
ChannelGroupService::Name Name
::geo::Vector_t toVector(Vector const &v)
Convert the specified vector into a geo::Vector_t.
bool operator!=(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept
typename config_impl< T >::type Config
BOOST_AUTO_TEST_CASE(tupleAs_simple)
std::ostream & operator<<(std::ostream &, ParameterSetID const &)
bool operator==(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept