From cd7544e4ea0dc9fdee80447688bf4b8d64cc2ec8 Mon Sep 17 00:00:00 2001 From: FrancisMurtagh Date: Mon, 28 Jan 2019 17:19:41 +0000 Subject: IVGCVSW-2548 Add member function to check layer pointer not null Change-Id: I48c8795e546e3a36414ae88316908519d5879628 --- src/armnn/test/TestLayerVisitor.cpp | 5 +++++ src/armnn/test/TestLayerVisitor.hpp | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/armnn/test/TestLayerVisitor.cpp b/src/armnn/test/TestLayerVisitor.cpp index 24d3c0b181..5cb7bdfca5 100644 --- a/src/armnn/test/TestLayerVisitor.cpp +++ b/src/armnn/test/TestLayerVisitor.cpp @@ -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 diff --git a/src/armnn/test/TestLayerVisitor.hpp b/src/armnn/test/TestLayerVisitor.hpp index 16227fb7f5..1998fb9b3b 100644 --- a/src/armnn/test/TestLayerVisitor.hpp +++ b/src/armnn/test/TestLayerVisitor.hpp @@ -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, -- cgit v1.2.1