12 #ifndef PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 13 # define PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 1 14 #endif // !PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 26 #define BOOST_TEST_MODULE ( ProviderPack_test ) 27 #include <boost/test/unit_test.hpp> 30 #include "lardata/DetectorInfo/ProviderPack.h" 108 (decltype(SP1)::has<svc::ProviderA>(),
"We don't believe to have ProviderA!!");
110 static_assert(std::is_same<decltype(myA),
svc::ProviderA const*>(),
111 "Failed to get the element of type A");
112 BOOST_TEST(myA == &providerA);
116 (decltype(SP1)::has<svc::ProviderB>(),
"We don't believe to have ProviderB!!");
118 static_assert(std::is_same<decltype(myB),
svc::ProviderB const*>(),
119 "Failed to get the element of type B");
120 BOOST_TEST(myB == &providerB);
124 (decltype(SP1)::has<svc::ProviderC>(),
"We don't believe to have ProviderC!!");
126 static_assert(std::is_same<decltype(myC),
svc::ProviderC const*>(),
127 "Failed to get the element of type C");
128 BOOST_TEST(myC == &providerC);
133 SP1.set(&providerA2);
135 BOOST_TEST(myA == &providerA2);
139 #if PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 140 BOOST_TEST_MESSAGE(
" (test to get a non-existing provider type skipped)");
143 #endif // !PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 147 (!decltype(SP1)::has<svc::ProviderD>(),
"We believe to have ProviderD!!");
161 #if PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 163 (
" (test to create a pack with many providers with same type skipped)");
167 #endif // !PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS
static unsigned int max_count
A service provider class.
Provider const * get() const
Returns the provider with the specified type.
A service provider class.
static unsigned int max_count
BOOST_AUTO_TEST_CASE(test_ProviderPack)
ProviderPack< Providers... > makeProviderPack(Providers const *...providers)
Function to create a ProviderPack from the function arguments.
A service provider class.
static unsigned int max_count
A service provider class.
Container for a list of pointers to providers.
std::string to_string(ModuleType const mt)
static unsigned int max_count