Bugfix: Only run ClCustomAllocatorCpuAccNegativeTest if Neon Enabled

 * Also call DeregisterAllocator on CpuAcc backend.
 * Removed problematic ClCustomAllocatorGpuAccNullptrTest unit test.

Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: Ia2894c82a2b5de1c8d662551ea07b9123dd682cb
diff --git a/src/backends/cl/test/ClCustomAllocatorTests.cpp b/src/backends/cl/test/ClCustomAllocatorTests.cpp
index 86e1182..a9b9e41 100644
--- a/src/backends/cl/test/ClCustomAllocatorTests.cpp
+++ b/src/backends/cl/test/ClCustomAllocatorTests.cpp
@@ -11,6 +11,9 @@
 #include <armnn/Utils.hpp>
 #include <armnn/BackendRegistry.hpp>
 #include <cl/ClBackend.hpp>
+#if defined(ARMCOMPUTENEON_ENABLED)
+#include <neon/NeonBackend.hpp>
+#endif
 
 #include <doctest/doctest.h>
 
@@ -166,6 +169,9 @@
     backendRegistry.DeregisterAllocator(ClBackend::GetIdStatic());
 }
 
+// Only run this test if NEON is enabled
+#if defined(ARMCOMPUTENEON_ENABLED)
+
 TEST_CASE("ClCustomAllocatorCpuAccNegativeTest")
 {
     using namespace armnn;
@@ -197,30 +203,9 @@
     CHECK(errMessages.size() > 0);
 
     auto& backendRegistry = armnn::BackendRegistryInstance();
-    backendRegistry.DeregisterAllocator(ClBackend::GetIdStatic());
+    backendRegistry.DeregisterAllocator(NeonBackend::GetIdStatic());
 }
 
-TEST_CASE("ClCustomAllocatorGpuAccNullptrTest")
-{
-    using namespace armnn;
-
-    // Create ArmNN runtime
-    IRuntime::CreationOptions options; // default options
-    auto customAllocator = std::make_shared<SampleClBackendCustomAllocator>();
-    options.m_CustomAllocatorMap = {{"GpuAcc", nullptr}};
-
-    try
-    {
-        IRuntimePtr run = IRuntime::Create(options);
-        FAIL("Should have thrown an exception in RuntimeImpl::RuntimeImpl().");
-    }
-    catch (const armnn::Exception& e)
-    {
-        // Caught successfully
-    }
-
-    auto& backendRegistry = armnn::BackendRegistryInstance();
-    backendRegistry.DeregisterAllocator(ClBackend::GetIdStatic());
-}
+#endif
 
 } // test suite ClCustomAllocatorTests
\ No newline at end of file