Unit test for intervals_fhicl.h
header.
More...
Go to the source code of this file.
#define BOOST_TEST_MODULE ( intervals_fhicl_test ) |
BOOST_AUTO_TEST_CASE |
( |
intervals_testcase |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
points_testcase |
| ) |
|
BOOST_AUTO_TEST_CASE |
( |
quantities_fhicl_testcase |
| ) |
|
void test_makeInterval |
( |
| ) |
|
Definition at line 57 of file intervals_fhicl_test.cc.
63 auto t = util::quantities::makeInterval<microseconds>(
"-7e1 ms"sv);
65 BOOST_TEST(
t == -70000_us);
66 BOOST_TEST(
t == -70_ms);
68 t = util::quantities::makeInterval<microseconds>(
"7e1ms"sv);
69 BOOST_TEST(
t == 70000_us);
70 BOOST_TEST(
t == 70_ms);
72 t = util::quantities::makeInterval<microseconds>(
"7e1"sv,
true);
73 BOOST_TEST(
t == 70_us);
76 util::quantities::makeInterval<microseconds>(
"7e1"sv),
81 util::quantities::makeInterval<microseconds>(
"7g ms"sv),
86 util::quantities::makeInterval<microseconds>(
"g7 ms"sv),
91 util::quantities::makeInterval<microseconds>(
""sv),
96 util::quantities::makeInterval<microseconds>(
""sv,
true),
microseconds_as<> microseconds
Type of time interval stored in microseconds, in double precision.
microsecond microseconds
Alias for common language habits.
Literal constants for time quantities.
String representing a quantity has no unit.
String representing a quantity has an invalid number.
Definition at line 104 of file intervals_fhicl_test.cc.
110 auto t = util::quantities::makePoint<microsecond>(
"-7e1 ms"sv);
111 static_assert(std::is_same_v<decltype(
t),
microsecond>);
112 BOOST_TEST(
t == -70000_us);
113 BOOST_TEST(
t == -70_ms);
115 t = util::quantities::makePoint<microsecond>(
"7e1ms"sv);
116 BOOST_TEST(
t == 70000_us);
117 BOOST_TEST(
t == 70_ms);
119 t = util::quantities::makePoint<microsecond>(
"7e1"sv,
true);
120 BOOST_TEST(
t == 70_us);
123 util::quantities::makePoint<microsecond>(
"7e1"sv),
128 util::quantities::makePoint<microsecond>(
"7g ms"sv),
133 util::quantities::makePoint<microsecond>(
"g7 ms"sv),
138 util::quantities::makePoint<microsecond>(
""sv),
143 util::quantities::makePoint<microsecond>(
""sv,
true),
microsecond_as<> microsecond
Type of time stored in microseconds, in double precision.
microsecond_as<> microsecond
Type of time point stored in microseconds, in double precision.
Literal constants for time quantities.
String representing a quantity has no unit.
String representing a quantity has an invalid number.
Definition at line 151 of file intervals_fhicl_test.cc.
168 std::string const configStr {
"start: 2ms duration: 16ms" };
173 auto validatedConfig = validateConfig<Config>(configStr);
174 BOOST_TEST(validatedConfig.start() == expectedStart);
175 BOOST_TEST(validatedConfig.end() == expectedEnd);
176 BOOST_TEST(validatedConfig.duration() == expectedDuration);
ChannelGroupService::Name Name
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
typename config_impl< T >::type Config
An interval (duration, length, distance) between two quantity points.
Literal constants for time quantities.
Definition at line 182 of file intervals_fhicl_test.cc.
203 pset.
put(
"start", expectedStart);
204 pset.
put(
"duration", expectedDuration);
206 auto validatedConfig = validateConfig<Config>(pset);
207 BOOST_TEST(validatedConfig.start() == expectedStart);
208 BOOST_TEST(validatedConfig.end() == expectedEnd);
209 BOOST_TEST(validatedConfig.duration() == expectedDuration);
ChannelGroupService::Name Name
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
typename config_impl< T >::type Config
An interval (duration, length, distance) between two quantity points.
Literal constants for time quantities.
void put(std::string const &key)
template<typename Config >
Definition at line 30 of file intervals_fhicl_test.cc.
34 std::cout <<
"===> FHiCL configuration:";
35 if (pset.is_empty()) std::cout <<
" <empty>";
36 else std::cout <<
"\n" << pset.to_indented_string();
38 validatedConfig.print_allowed_configuration
39 (std::cout <<
"===> Expected configuration: ");
42 validatedConfig.validate_ParameterSet(pset);
43 return validatedConfig();
ChannelGroupService::Name Name
QTextStream & endl(QTextStream &s)
template<typename Config >