diff options
Diffstat (limited to 'test/DriverTestHelpers.hpp')
-rw-r--r-- | test/DriverTestHelpers.hpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/test/DriverTestHelpers.hpp b/test/DriverTestHelpers.hpp index d37fbf26..98be0903 100644 --- a/test/DriverTestHelpers.hpp +++ b/test/DriverTestHelpers.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once @@ -10,10 +10,16 @@ #include "../ArmnnDriver.hpp" #include <iosfwd> -#include <boost/test/unit_test.hpp> - #include <android/hidl/allocator/1.0/IAllocator.h> +// Some of the short name macros from 'third-party/doctest/doctest.h' clash with macros in +// 'system/core/base/include/android-base/logging.h' so we use the full DOCTEST macro names +#ifndef DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES +#define DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES +#endif // DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES + +#include <doctest/doctest.h> + using RequestArgument = V1_0::RequestArgument; using ::android::hidl::allocator::V1_0::IAllocator; @@ -167,7 +173,7 @@ android::sp<IMemory> AddPoolAndGetData(uint32_t size, V1_0::Request& request) android::sp<IAllocator> allocator = IAllocator::getService("ashmem"); allocator->allocate(sizeof(T) * size, [&](bool success, const hidl_memory& mem) { - BOOST_TEST(success); + DOCTEST_CHECK(success); pool = mem; }); @@ -180,13 +186,15 @@ android::sp<IMemory> AddPoolAndGetData(uint32_t size, V1_0::Request& request) } template<typename T> -void AddPoolAndSetData(uint32_t size, V1_0::Request& request, const T* data) +android::sp<IMemory> AddPoolAndSetData(uint32_t size, V1_0::Request& request, const T* data) { android::sp<IMemory> memory = AddPoolAndGetData<T>(size, request); T* dst = static_cast<T*>(static_cast<void*>(memory->getPointer())); memcpy(dst, data, size * sizeof(T)); + + return memory; } template<typename HalPolicy, |