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/InstrumentTests.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/InstrumentTests.cpp')
-rw-r--r-- | src/armnn/test/InstrumentTests.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
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 <boost/test/unit_test.hpp> +#include <doctest/doctest.h> #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::duration<double, std::micro>>(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() +} |