Go to the source code of this file.
◆ TEST_SUITE()
TEST_SUITE |
( |
"BackendRegistryTests" |
| ) |
|
Definition at line 36 of file BackendRegistryTests.cpp.
References armnn::BackendRegistryInstance(), BackendRegistry::Deregister(), BackendRegistry::GetFactory(), BackendRegistry::Register(), BackendRegistry::Size(), and Exception::what().
38 TEST_CASE(
"SwapRegistry")
40 using namespace armnn;
43 SwapRegistryStorage helper;
49 TEST_CASE(
"TestRegistryHelper")
51 using namespace armnn;
52 SwapRegistryStorage helper;
67 CHECK(called ==
false);
72 CHECK(called ==
false);
75 CHECK(called ==
true);
79 TEST_CASE(
"TestDirectCallToRegistry")
81 using namespace armnn;
82 SwapRegistryStorage helper;
95 CHECK(called ==
false);
100 CHECK(called ==
false);
103 CHECK(called ==
true);
114 TEST_CASE(
"ThrowBackendUnavailableException")
116 using namespace armnn;
118 const BackendId mockBackendId(
"MockDynamicBackend");
120 const std::string exceptionMessage(
"Mock error message to test unavailable backend");
136 auto backend = factoryFunc();
137 FAIL(
"Expected exception to have been thrown");
142 CHECK_EQ(e.
what(), exceptionMessage);
FactoryFunction GetFactory(const BackendId &id) const
void Register(const BackendId &id, FactoryFunction factory)
virtual const char * what() const noexcept override
BackendRegistry & BackendRegistryInstance()
Copyright (c) 2021 ARM Limited and Contributors.
void Deregister(const BackendId &id)
std::unique_ptr< IBackendInternal > IBackendInternalUniquePtr
Class for non-fatal exceptions raised while initialising a backend.