Go to the source code of this file.
#define BOOST_TEST_MODULE (make_tool_t) |
BOOST_AUTO_TEST_CASE |
( |
tool_class |
| ) |
|
Definition at line 27 of file make_tool_t.cc.
30 ps.
put(
"tool_type",
"ClassTool"s);
31 auto t1 = art::make_tool<arttest::ClassTool>(
ps);
32 BOOST_TEST(
t1->addOne(17) == 18);
static constexpr double ps
void put(std::string const &key)
BOOST_AUTO_TEST_CASE |
( |
tool_function |
| ) |
|
Definition at line 35 of file make_tool_t.cc.
38 ps.
put(
"tool_type",
"FunctionTool"s);
40 auto addOne1 = art::make_tool<decltype(arttest::addOne)>(
ps,
"addOne");
41 auto addOne2 = art::make_tool<int(int)>(
ps,
"addOne");
42 BOOST_TEST(addOne1(i) == 18);
43 BOOST_TEST(addOne2(i) == 18);
static constexpr double ps
void put(std::string const &key)
BOOST_AUTO_TEST_CASE |
( |
nested_function_tools |
| ) |
|
Definition at line 46 of file make_tool_t.cc.
48 std::ostringstream ss;
49 ss <<
"tool_type: NestedFunctionTool\n" 51 <<
" tool_type: FunctionTool" 53 auto const&
ps = pset_from_oss(ss);
55 art::make_tool<decltype(arttest::callThroughToAddOne)>(
56 ps,
"callThroughToAddOne");
static constexpr double ps
int callThroughToAddOne(fhicl::ParameterSet const &pset, int const i)
BOOST_AUTO_TEST_CASE |
( |
nested_class_tools |
| ) |
|
Definition at line 61 of file make_tool_t.cc.
63 std::ostringstream ss;
64 ss <<
"tool_type: NestedClassTool\n" 66 <<
" tool_type: ClassTool" 68 auto const&
ps = pset_from_oss(ss);
69 auto t = art::make_tool<arttest::NestedClassTool>(
ps);
70 BOOST_TEST(
t->callThroughToAddOne(17) == 18);
static constexpr double ps
BOOST_AUTO_TEST_CASE |
( |
nested_function_in_class_tools |
| ) |
|
Definition at line 73 of file make_tool_t.cc.
75 std::ostringstream ss;
76 ss <<
"tool_type: NestedFunctionInClassTool\n" 78 <<
" tool_type: FunctionTool" 80 auto const&
ps = pset_from_oss(ss);
81 auto t = art::make_tool<arttest::NestedFunctionInClassTool>(
ps);
82 BOOST_TEST(
t->callThroughToAddOne(17) == 18);
static constexpr double ps
BOOST_AUTO_TEST_CASE |
( |
polymorphic_tools |
| ) |
|
Definition at line 85 of file make_tool_t.cc.
90 ps.
put(
"tool_type",
"AddNumber");
91 ps.
put(
"incrementBy", 7);
92 art::make_tool<arttest::OperationBase>(
ps)->adjustNumber(i);
97 ps.
put(
"tool_type",
"SubtractNumber");
98 art::make_tool<arttest::OperationBase>(
ps)->adjustNumber(i);
103 ps.
put(
"tool_type",
"MultiplyNumber");
104 art::make_tool<arttest::OperationBase>(
ps)->adjustNumber(i);
static constexpr double ps
void put(std::string const &key)