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> 124 (decltype(SP1)::has<svc::ProviderA>(),
"We don't believe to have ProviderA!!");
126 static_assert(std::is_same<decltype(myA),
svc::ProviderA const*>(),
127 "Failed to get the element of type A");
128 BOOST_TEST(myA == &providerA);
132 (decltype(SP1)::has<svc::ProviderB>(),
"We don't believe to have ProviderB!!");
134 static_assert(std::is_same<decltype(myB),
svc::ProviderB const*>(),
135 "Failed to get the element of type B");
136 BOOST_TEST(myB == &providerB);
140 (decltype(SP1)::has<svc::ProviderC>(),
"We don't believe to have ProviderC!!");
142 static_assert(std::is_same<decltype(myC),
svc::ProviderC const*>(),
143 "Failed to get the element of type C");
144 BOOST_TEST(myC == &providerC);
149 SP1.set(&providerA2);
151 BOOST_TEST(myA == &providerA2);
155 #if PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 156 BOOST_TEST_MESSAGE(
" (test to get a non-existing provider type skipped)");
159 #endif // !PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 163 (!decltype(SP1)::has<svc::ProviderD>(),
"We believe to have ProviderD!!");
177 #if PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 179 (
" (test to create a pack with many providers with same type skipped)");
183 #endif // !PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 199 (&providerA, &providerB);
An empty class that can't be copied nor moved.
static unsigned int max_count
A service provider class.
Defines classes that can't be copied nor moved.
Provider const * get() const
Returns the provider with the specified type.
Data structure containing constant pointers to classes.
A service provider class.
static unsigned int max_count
BOOST_AUTO_TEST_CASE(test_ProviderPack)
A service provider class derived from B.
ProviderPack< Providers... > makeProviderPack(Providers const *...providers)
Function to create a ProviderPack from the function arguments.
A service provider class.
static unsigned int max_count
static unsigned int max_count
A service provider class.
Container for a list of pointers to providers.
ProviderPack< Providers... > makeProviderPack(Providers const *...providers)
Function to create a ParameterPack from the function arguments.
std::string to_string(ModuleType const mt)
static unsigned int max_count