19 #define BOOST_TEST_MODULE ( ServiceUtil_test ) 22 #include "CoreUtils/UncopiableAndUnmovableClass.h" 23 #include "CoreUtils/ServiceUtil.h" 31 #include <boost/test/test_tools.hpp> 34 #include <type_traits> 55 template struct ServiceProviderRequirementsChecker<MyProvider>;
57 template struct ServiceRequirementsChecker<MyService>;
67 std::unique_ptr<MyService> myServicePtr =
nullptr;
97 GlobalServices.
myServicePtr = std::make_unique<MyService>();
98 BOOST_CHECK_EXCEPTION(gar::providerFrom<MyService>(),
art::Exception,
105 GlobalServices.
myServicePtr = std::make_unique<MyService>(&prov);
106 BOOST_CHECK_EQUAL(gar::providerFrom<MyService>(), &prov);
BOOST_AUTO_TEST_CASE(providerFromTest)
MyService(MyProvider *ptr=nullptr)
std::unique_ptr< MyService > myServicePtr
const std::string instance
GlobalServicesClass GlobalServices
MyService & operator*() const
MyService * operator->() const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
General GArSoft Utilities.
provider_type const * provider() const
An empty class that can't be copied nor moved.
auto const & get(AssnsNode< L, R, D > const &r)