11 #define BOOST_TEST_MODULE ( quantities_fhicl_test ) 12 #include <boost/test/unit_test.hpp> 25 #include <type_traits> 29 template <
typename Config>
34 std::cout <<
"===> FHiCL configuration:";
35 if (pset.
is_empty()) std::cout <<
" <empty>";
38 validatedConfig.print_allowed_configuration
39 (std::cout <<
"===> Expected configuration: ");
42 validatedConfig.validate_ParameterSet(pset);
43 return validatedConfig;
48 template <
typename Config>
51 return validateConfig<Config>(pset);
64 auto t = util::quantities::makeQuantity<microsecond>(
"-7e1 ms"sv);
66 BOOST_TEST(
t == -70000_us);
67 BOOST_TEST(
t == -70_ms);
69 t = util::quantities::makeQuantity<microsecond>(
"7e1ms"sv);
70 BOOST_TEST(
t == 70000_us);
71 BOOST_TEST(
t == 70_ms);
73 t = util::quantities::makeQuantity<microsecond>(
"7e1"sv,
true);
74 BOOST_TEST(
t == 70_us);
77 util::quantities::makeQuantity<microsecond>(
"7e1"sv),
82 util::quantities::makeQuantity<microsecond>(
"7g ms"sv),
87 util::quantities::makeQuantity<microsecond>(
"g7 ms"sv),
92 util::quantities::makeQuantity<microsecond>(
""sv),
97 util::quantities::makeQuantity<microsecond>(
""sv,
true),
124 auto validatedConfig = validateConfig<Config>(configStr)();
125 BOOST_TEST(validatedConfig.start() == expectedStart);
126 BOOST_TEST(validatedConfig.end() == expectedEnd);
152 auto validatedConfig = validateConfig<Config>(pset)();
153 BOOST_TEST(validatedConfig.start() == expectedStart);
154 BOOST_TEST(validatedConfig.end() == expectedEnd);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
void test_writeQuantity()
static ParameterSet make(intermediate_table const &tbl)
microsecond_as<> microsecond
Type of time stored in microseconds, in double precision.
ChannelGroupService::Name Name
BOOST_AUTO_TEST_CASE(quantities_testcase)
typename config_impl< T >::type Config
Utilities to read and write quantities in FHiCL configuration.
A value measured in the specified unit.
std::string to_indented_string() const
Literal constants for time quantities.
String representing a quantity has no unit.
Dimensioned variables representing space or time quantities.
fhicl::Table< Config > validateConfig(fhicl::ParameterSet const &pset)
String representing a quantity has an invalid number.
void put(std::string const &key)
QTextStream & endl(QTextStream &s)