diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2021-06-10 18:24:34 +0100 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2021-06-11 10:33:16 +0000 |
commit | 1625efc870f1a8b7c6e6382277ddbb245f91a294 (patch) | |
tree | 39fbbaa15ed7eb81337b082c2d20b0af68b91c02 /src/armnn/test/TestLayerVisitor.cpp | |
parent | 958e0ba61e940a8d11955cf2a10f681c7c47e1fa (diff) | |
download | armnn-1625efc870f1a8b7c6e6382277ddbb245f91a294.tar.gz |
IVGCVSW-5963 'Move unit tests to new framework'
* Used doctest in ArmNN unit tests
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: Ia9cf5fc72775878885c5f864abf2c56b3a935f1a
Diffstat (limited to 'src/armnn/test/TestLayerVisitor.cpp')
-rw-r--r-- | src/armnn/test/TestLayerVisitor.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/armnn/test/TestLayerVisitor.cpp b/src/armnn/test/TestLayerVisitor.cpp index ba30dbc666..ec405119d1 100644 --- a/src/armnn/test/TestLayerVisitor.cpp +++ b/src/armnn/test/TestLayerVisitor.cpp @@ -3,9 +3,10 @@ // SPDX-License-Identifier: MIT // -#include <boost/test/unit_test.hpp> #include "TestLayerVisitor.hpp" +#include <doctest/doctest.h> + namespace armnn { @@ -13,29 +14,29 @@ void TestLayerVisitor::CheckLayerName(const char* name) { if (name == nullptr) { - BOOST_CHECK(m_LayerName == nullptr); + CHECK(m_LayerName == nullptr); } else if (m_LayerName == nullptr) { - BOOST_CHECK(name == nullptr); + CHECK(name == nullptr); } else { - BOOST_CHECK_EQUAL(m_LayerName, name); + CHECK_EQ(std::string(m_LayerName), std::string(name)); } } void TestLayerVisitor::CheckLayerPointer(const IConnectableLayer* layer) { - BOOST_CHECK(layer != nullptr); + CHECK(layer != nullptr); } void TestLayerVisitor::CheckConstTensors(const ConstTensor& expected, const ConstTensor& actual) { - BOOST_CHECK(expected.GetInfo() == actual.GetInfo()); - BOOST_CHECK(expected.GetNumDimensions() == actual.GetNumDimensions()); - BOOST_CHECK(expected.GetNumElements() == actual.GetNumElements()); - BOOST_CHECK(expected.GetNumBytes() == actual.GetNumBytes()); + CHECK(expected.GetInfo() == actual.GetInfo()); + CHECK(expected.GetNumDimensions() == actual.GetNumDimensions()); + CHECK(expected.GetNumElements() == actual.GetNumElements()); + CHECK(expected.GetNumBytes() == actual.GetNumBytes()); if (expected.GetNumBytes() == actual.GetNumBytes()) { //check data is the same byte by byte @@ -43,7 +44,7 @@ void TestLayerVisitor::CheckConstTensors(const ConstTensor& expected, const Cons const unsigned char* actualPtr = static_cast<const unsigned char*>(actual.GetMemoryArea()); for (unsigned int i = 0; i < expected.GetNumBytes(); i++) { - BOOST_CHECK(*(expectedPtr + i) == *(actualPtr + i)); + CHECK(*(expectedPtr + i) == *(actualPtr + i)); } } } @@ -51,7 +52,7 @@ void TestLayerVisitor::CheckConstTensors(const ConstTensor& expected, const Cons void TestLayerVisitor::CheckOptionalConstTensors(const Optional<ConstTensor>& expected, const Optional<ConstTensor>& actual) { - BOOST_CHECK(expected.has_value() == actual.has_value()); + CHECK(expected.has_value() == actual.has_value()); if (expected.has_value() && actual.has_value()) { CheckConstTensors(expected.value(), actual.value()); |