aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test/BackendRegistryTests.cpp
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2021-06-10 18:24:34 +0100
committerSadik Armagan <sadik.armagan@arm.com>2021-06-11 10:33:16 +0000
commit1625efc870f1a8b7c6e6382277ddbb245f91a294 (patch)
tree39fbbaa15ed7eb81337b082c2d20b0af68b91c02 /src/backends/backendsCommon/test/BackendRegistryTests.cpp
parent958e0ba61e940a8d11955cf2a10f681c7c47e1fa (diff)
downloadarmnn-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/backends/backendsCommon/test/BackendRegistryTests.cpp')
-rw-r--r--src/backends/backendsCommon/test/BackendRegistryTests.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/backends/backendsCommon/test/BackendRegistryTests.cpp b/src/backends/backendsCommon/test/BackendRegistryTests.cpp
index ce8acbbf2a..d9c19d659c 100644
--- a/src/backends/backendsCommon/test/BackendRegistryTests.cpp
+++ b/src/backends/backendsCommon/test/BackendRegistryTests.cpp
@@ -9,7 +9,7 @@
#include <armnn/backends/IBackendInternal.hpp>
#include <reference/RefBackend.hpp>
-#include <boost/test/unit_test.hpp>
+#include <doctest/doctest.h>
namespace
{
@@ -33,20 +33,20 @@ private:
}
-BOOST_AUTO_TEST_SUITE(BackendRegistryTests)
-
-BOOST_AUTO_TEST_CASE(SwapRegistry)
+TEST_SUITE("BackendRegistryTests")
+{
+TEST_CASE("SwapRegistry")
{
using namespace armnn;
auto nFactories = BackendRegistryInstance().Size();
{
SwapRegistryStorage helper;
- BOOST_TEST(BackendRegistryInstance().Size() == 0);
+ CHECK(BackendRegistryInstance().Size() == 0);
}
- BOOST_TEST(BackendRegistryInstance().Size() == nFactories);
+ CHECK(BackendRegistryInstance().Size() == nFactories);
}
-BOOST_AUTO_TEST_CASE(TestRegistryHelper)
+TEST_CASE("TestRegistryHelper")
{
using namespace armnn;
SwapRegistryStorage helper;
@@ -64,19 +64,19 @@ BOOST_AUTO_TEST_CASE(TestRegistryHelper)
);
// sanity check: the factory has not been called yet
- BOOST_TEST(called == false);
+ CHECK(called == false);
auto factoryFunction = BackendRegistryInstance().GetFactory("HelloWorld");
// sanity check: the factory still not called
- BOOST_TEST(called == false);
+ CHECK(called == false);
factoryFunction();
- BOOST_TEST(called == true);
+ CHECK(called == true);
BackendRegistryInstance().Deregister("HelloWorld");
}
-BOOST_AUTO_TEST_CASE(TestDirectCallToRegistry)
+TEST_CASE("TestDirectCallToRegistry")
{
using namespace armnn;
SwapRegistryStorage helper;
@@ -92,15 +92,15 @@ BOOST_AUTO_TEST_CASE(TestDirectCallToRegistry)
);
// sanity check: the factory has not been called yet
- BOOST_TEST(called == false);
+ CHECK(called == false);
auto factoryFunction = BackendRegistryInstance().GetFactory("HelloWorld");
// sanity check: the factory still not called
- BOOST_TEST(called == false);
+ CHECK(called == false);
factoryFunction();
- BOOST_TEST(called == true);
+ CHECK(called == true);
BackendRegistryInstance().Deregister("HelloWorld");
}
@@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(TestDirectCallToRegistry)
// of Neon not being detected the exception is raised and so the backend is not added to the supportedBackends
// list
-BOOST_AUTO_TEST_CASE(ThrowBackendUnavailableException)
+TEST_CASE("ThrowBackendUnavailableException")
{
using namespace armnn;
@@ -142,9 +142,9 @@ BOOST_AUTO_TEST_CASE(ThrowBackendUnavailableException)
catch (const BackendUnavailableException& e)
{
// Caught
- BOOST_CHECK_EQUAL(e.what(), exceptionMessage);
- BOOST_TEST_MESSAGE("ThrowBackendUnavailableExceptionImpl: BackendUnavailableException caught.");
+ CHECK_EQ(e.what(), exceptionMessage);
+ MESSAGE("ThrowBackendUnavailableExceptionImpl: BackendUnavailableException caught.");
}
}
-BOOST_AUTO_TEST_SUITE_END()
+}