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>
44 operator std::string()
const
59 virtual operator
std::
string()
const
73 virtual operator std::string()
const override
87 operator std::string()
const
101 operator std::string()
const
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);
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
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.
A service provider class.
static unsigned int max_count
A service provider class derived from B.
ProviderPack< Providers...> makeProviderPack(Providers const *...providers)
Function to create a ProviderPack from the function arguments.
virtual ~ProviderB() noexcept=default
A service provider class.
static unsigned int max_count
static unsigned int max_count
A service provider class.
std::string to_string(WindowPattern const &pattern)
Container for a list of pointers to providers.
Data structure containing constant pointers to classes.
static unsigned int max_count