aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backends/backendsCommon/test/BackendRegistryTests.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/backends/backendsCommon/test/BackendRegistryTests.cpp b/src/backends/backendsCommon/test/BackendRegistryTests.cpp
index d9c19d659c..ba407d2908 100644
--- a/src/backends/backendsCommon/test/BackendRegistryTests.cpp
+++ b/src/backends/backendsCommon/test/BackendRegistryTests.cpp
@@ -117,18 +117,14 @@ TEST_CASE("ThrowBackendUnavailableException")
const BackendId mockBackendId("MockDynamicBackend");
- const std::string exceptionMessage("Neon support not found on device, could not register CpuAcc Backend.\n");
+ const std::string exceptionMessage("Mock error message to test unavailable backend");
- // Register the mock backend with a factory function lambda equivalent to NeonRegisterInitializer
+ // Register the mock backend with a factory function lambda that always throws
BackendRegistryInstance().Register(mockBackendId,
[exceptionMessage]()
{
- if (false)
- {
- return IBackendInternalUniquePtr(new RefBackend);
- }
- ARMNN_LOG(info) << "Neon support not found on device, could not register CpuAcc Backend.";
throw armnn::BackendUnavailableException(exceptionMessage);
+ return IBackendInternalUniquePtr(); // Satisfy return type
});
// Get the factory function of the mock backend
@@ -138,12 +134,12 @@ TEST_CASE("ThrowBackendUnavailableException")
{
// Call the factory function as done during runtime backend registering
auto backend = factoryFunc();
+ FAIL("Expected exception to have been thrown");
}
catch (const BackendUnavailableException& e)
{
// Caught
CHECK_EQ(e.what(), exceptionMessage);
- MESSAGE("ThrowBackendUnavailableExceptionImpl: BackendUnavailableException caught.");
}
}