diff options
author | Mike Kelly <mike.kelly@arm.com> | 2021-10-14 12:35:58 +0100 |
---|---|---|
committer | Mike Kelly <mike.kelly@arm.com> | 2021-10-14 12:35:58 +0100 |
commit | e2d611e4502fb5dce8b8a398ccfc8d7ef29da96b (patch) | |
tree | 79d9178420924d57ed0ab23db46ff57159279886 /test/Concurrent.cpp | |
parent | 4bd8f7c96e01e081276c376fe5c34018e7b70d17 (diff) | |
download | android-nn-driver-e2d611e4502fb5dce8b8a398ccfc8d7ef29da96b.tar.gz |
IVGCVSW-6428 Remove asserts
* Changed asserts to check for errors and return appropriate values or
throw exceptions
* Changed unit tests to use Doctest's long macro names as the short
macro names clashed with Android's Logging macros
* Removed unused #includes
* Clarified ambiguous #includes
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: Ice92a37590df727fd581d3be5ff2716665f26a13
Diffstat (limited to 'test/Concurrent.cpp')
-rw-r--r-- | test/Concurrent.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/test/Concurrent.cpp b/test/Concurrent.cpp index 2ea6eb06..4113a8da 100644 --- a/test/Concurrent.cpp +++ b/test/Concurrent.cpp @@ -1,15 +1,13 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // -#include "DriverTestHelpers.hpp" -#include "../1.0/HalPolicy.hpp" +#include "DriverTestHelpers.hpp" -#include <doctest/doctest.h> #include <log/log.h> -TEST_SUITE("ConcurrentDriverTests") +DOCTEST_TEST_SUITE("ConcurrentDriverTests") { using ArmnnDriver = armnn_driver::ArmnnDriver; using DriverOptions = armnn_driver::DriverOptions; @@ -25,7 +23,7 @@ using namespace armnn_driver; // The main point of this test is to check that multiple requests can be // executed without waiting for the callback from previous execution. // The operations performed are not significant. -TEST_CASE("ConcurrentExecute") +DOCTEST_TEST_CASE("ConcurrentExecute") { ALOGI("ConcurrentExecute: entry"); @@ -63,7 +61,7 @@ TEST_CASE("ConcurrentExecute") } } - CHECK(maxRequests == preparedModelsSize); + DOCTEST_CHECK(maxRequests == preparedModelsSize); // construct the request data V1_0::DataLocation inloc = {}; @@ -110,7 +108,7 @@ TEST_CASE("ConcurrentExecute") ALOGI("ConcurrentExecute: waiting for callbacks"); for (size_t i = 0; i < maxRequests; ++i) { - ARMNN_ASSERT(cb[i]); + DOCTEST_CHECK(cb[i]); cb[i]->wait(); } @@ -118,7 +116,7 @@ TEST_CASE("ConcurrentExecute") ALOGI("ConcurrentExecute: validating results"); for (size_t i = 0; i < maxRequests; ++i) { - CHECK(outdata[i][0] == 152); + DOCTEST_CHECK(outdata[i][0] == 152); } ALOGI("ConcurrentExecute: exit"); } |