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 ) 28 #include <boost/test/test_tools.hpp> 31 #include "CoreUtils/ProviderPack.h" 109 (decltype(SP1)::has<svc::ProviderA>(),
"We don't believe to have ProviderA!!");
111 static_assert(std::is_same<decltype(myA),
svc::ProviderA const*>(),
112 "Failed to get the element of type A");
113 BOOST_TEST(myA == &providerA);
117 (decltype(SP1)::has<svc::ProviderB>(),
"We don't believe to have ProviderB!!");
119 static_assert(std::is_same<decltype(myB),
svc::ProviderB const*>(),
120 "Failed to get the element of type B");
121 BOOST_TEST(myB == &providerB);
125 (decltype(SP1)::has<svc::ProviderC>(),
"We don't believe to have ProviderC!!");
127 static_assert(std::is_same<decltype(myC),
svc::ProviderC const*>(),
128 "Failed to get the element of type C");
129 BOOST_TEST(myC == &providerC);
134 SP1.set(&providerA2);
136 BOOST_TEST(myA == &providerA2);
140 #if PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 141 BOOST_TEST_MESSAGE(
" (test to get a non-existing provider type skipped)");
144 #endif // !PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 148 (!decltype(SP1)::has<svc::ProviderD>(),
"We believe to have ProviderD!!");
162 #if PROVIDERPACK_TEST_SKIP_COMPILATION_ERRORS 164 (
" (test to create a pack with many providers with same type skipped)");
168 #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)
Container for a list of pointers to providers.
A service provider class.
static unsigned int max_count
A service provider class.
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