From 1625efc870f1a8b7c6e6382277ddbb245f91a294 Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Thu, 10 Jun 2021 18:24:34 +0100 Subject: IVGCVSW-5963 'Move unit tests to new framework' * Used doctest in ArmNN unit tests Signed-off-by: Sadik Armagan Change-Id: Ia9cf5fc72775878885c5f864abf2c56b3a935f1a --- .../backendsCommon/test/BackendRegistryTests.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/backends/backendsCommon/test/BackendRegistryTests.cpp') 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 #include -#include +#include 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() +} -- cgit v1.2.1