IVGCVSW-2548 Add member function to check layer pointer not null
authorFrancisMurtagh <francis.murtagh@arm.com>
Mon, 28 Jan 2019 17:19:41 +0000 (17:19 +0000)
committerFrancisMurtagh <francis.murtagh@arm.com>
Mon, 28 Jan 2019 17:19:41 +0000 (17:19 +0000)
Change-Id: I48c8795e546e3a36414ae88316908519d5879628

src/armnn/test/TestLayerVisitor.cpp
src/armnn/test/TestLayerVisitor.hpp

index 24d3c0b..5cb7bdf 100644 (file)
@@ -25,4 +25,9 @@ void TestLayerVisitor::CheckLayerName(const char* name)
     }
 };
 
+void TestLayerVisitor::CheckLayerPointer(const IConnectableLayer* layer)
+{
+    BOOST_CHECK(layer != nullptr);
+};
+
 } //namespace armnn
\ No newline at end of file
index 16227fb..1998fb9 100644 (file)
@@ -16,11 +16,19 @@ protected:
 
     void CheckLayerName(const char* name);
 
+    void CheckLayerPointer(const IConnectableLayer* layer);
+
 private:
     const char* m_LayerName;
 
 public:
-    explicit TestLayerVisitor(const char* name) : m_LayerName(name) {};
+    explicit TestLayerVisitor(const char* name) : m_LayerName(name)
+    {
+        if (name == nullptr)
+        {
+            m_LayerName = "";
+        }
+    };
 
     virtual void VisitInputLayer(const IConnectableLayer* layer,
                                  LayerBindingId id,