7 #define BOOST_TEST_MODULE (tableAs test) 9 #include "boost/test/unit_test.hpp" 19 using namespace fhicl;
31 Person(
string name,
unsigned age) : name_{name}, age_{age} {}
36 return (name_ == p.name_) && (age_ == p.age_);
54 return Person{config.name(), config.age()};
60 return os <<
"Name: " << p.name_ <<
" Age: " << p.age_;
65 string street_address;
72 return a.street_address == b.street_address &&
73 a.phone_number == b.phone_number;
77 struct ContactInfoConfig {
83 convert(ContactInfoConfig
const& config)
85 return {config.street_address(), config.phone_number()};
92 return os << info.street_address <<
", " << info.phone_number;
101 Name(
"contact_info")};
105 Fixture() : FixtureBase(
"tableAs_t.fcl") {}
110 BOOST_FIXTURE_TEST_SUITE(tableAs_test, Fixture)
114 auto const mother =
config().mother();
115 auto const ref = Person{
"Angela", 32};
116 BOOST_TEST(mother == ref);
121 auto const father =
config().father();
122 auto const ref = Person{
"John", 30};
123 BOOST_TEST(father == ref);
128 auto const kids =
config().kids();
129 auto const ref = {Person{
"Alice", 1},
131 Person{
"Charlie", 3},
132 Person{
"Danielle", 4},
134 BOOST_TEST(kids == ref, boost::test_tools::per_element{});
140 BOOST_TEST(
config().contact_info(info));
141 auto const ref = ContactInfo{
"123 S. 45th Ave.",
"(123) 456-7890"};
142 BOOST_TEST(info == ref);
145 BOOST_AUTO_TEST_SUITE_END()
ChannelGroupService::Name Name
bool operator!=(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept
def convert(inputfile, outputfile="wire-cell-garfield-fine-response.json.bz2", average=False, shaped=False)
BOOST_AUTO_TEST_CASE(tableAs_simple)
std::ostream & operator<<(std::ostream &, ParameterSetID const &)
bool operator==(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept