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 --- src/armnn/test/InstrumentTests.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/armnn/test/InstrumentTests.cpp') diff --git a/src/armnn/test/InstrumentTests.cpp b/src/armnn/test/InstrumentTests.cpp index e0d0d94700..447a4c9d58 100644 --- a/src/armnn/test/InstrumentTests.cpp +++ b/src/armnn/test/InstrumentTests.cpp @@ -2,7 +2,7 @@ // Copyright © 2017 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // -#include +#include #include "WallClockTimer.hpp" @@ -11,13 +11,13 @@ using namespace armnn; -BOOST_AUTO_TEST_SUITE(Instruments) - -BOOST_AUTO_TEST_CASE(WallClockTimerInMicroseconds) +TEST_SUITE("Instruments") +{ +TEST_CASE("WallClockTimerInMicroseconds") { WallClockTimer wallClockTimer; - BOOST_CHECK_EQUAL(wallClockTimer.GetName(), "WallClockTimer"); + CHECK((std::string(wallClockTimer.GetName()) == std::string("WallClockTimer"))); // start the timer wallClockTimer.Start(); @@ -28,17 +28,17 @@ BOOST_AUTO_TEST_CASE(WallClockTimerInMicroseconds) // stop the timer wallClockTimer.Stop(); - BOOST_CHECK_EQUAL(wallClockTimer.GetMeasurements().front().m_Name, WallClockTimer::WALL_CLOCK_TIME); + CHECK((wallClockTimer.GetMeasurements().front().m_Name == WallClockTimer::WALL_CLOCK_TIME)); // check that WallClockTimer measurement should be >= 10 microseconds - BOOST_CHECK_GE(wallClockTimer.GetMeasurements().front().m_Value, std::chrono::microseconds(10).count()); + CHECK_GE(wallClockTimer.GetMeasurements().front().m_Value, std::chrono::microseconds(10).count()); } -BOOST_AUTO_TEST_CASE(WallClockTimerInNanoseconds) +TEST_CASE("WallClockTimerInNanoseconds") { WallClockTimer wallClockTimer; - BOOST_CHECK_EQUAL(wallClockTimer.GetName(), "WallClockTimer"); + CHECK((std::string(wallClockTimer.GetName()) == std::string("WallClockTimer"))); // start the timer wallClockTimer.Start(); @@ -49,14 +49,14 @@ BOOST_AUTO_TEST_CASE(WallClockTimerInNanoseconds) // stop the timer wallClockTimer.Stop(); - BOOST_CHECK_EQUAL(wallClockTimer.GetMeasurements().front().m_Name, WallClockTimer::WALL_CLOCK_TIME); + CHECK((wallClockTimer.GetMeasurements().front().m_Name == WallClockTimer::WALL_CLOCK_TIME)); // delta is 0.5 microseconds const auto delta = std::chrono::duration_cast>(std::chrono::nanoseconds(500)); // check that WallClockTimer measurement should be >= 0.5 microseconds - BOOST_CHECK_GE(wallClockTimer.GetMeasurements().front().m_Value, delta.count()); + CHECK_GE(wallClockTimer.GetMeasurements().front().m_Value, delta.count()); } -BOOST_AUTO_TEST_SUITE_END() +} -- cgit v1.2.1