diff options
author | Xusong Wang <xusongw@google.com> | 2022-01-18 17:46:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-01-18 17:46:51 +0000 |
commit | 571fe74987f7bb37963ade7b3195655667b8ba61 (patch) | |
tree | f865d9e26e519533008b4733272ab428721bf9ca /neuralnetworks/aidl/utils/test/DeviceTest.cpp | |
parent | 82d45061f976d9fd5d2b966eaf80651ab69eaed5 (diff) | |
parent | 7f5c7d293c2dad462dc9c0f1f1a160fb2c2c9a9b (diff) |
Merge changes from topic "nnapi-reusable-execution-hal"
* changes:
Reusable execution at HAL level -- HAL.
Define AIDL reusable execution interface.
Diffstat (limited to 'neuralnetworks/aidl/utils/test/DeviceTest.cpp')
-rw-r--r-- | neuralnetworks/aidl/utils/test/DeviceTest.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/neuralnetworks/aidl/utils/test/DeviceTest.cpp b/neuralnetworks/aidl/utils/test/DeviceTest.cpp index 0366e7dff0..fb13af8d9f 100644 --- a/neuralnetworks/aidl/utils/test/DeviceTest.cpp +++ b/neuralnetworks/aidl/utils/test/DeviceTest.cpp @@ -17,6 +17,7 @@ #include "MockBuffer.h" #include "MockDevice.h" #include "MockPreparedModel.h" +#include "TestUtils.h" #include <aidl/android/hardware/neuralnetworks/BnDevice.h> #include <android/binder_auto_utils.h> @@ -146,26 +147,7 @@ constexpr auto makeDeadObjectFailure = [] { return ndk::ScopedAStatus::fromStatus(STATUS_DEAD_OBJECT); }; -class DeviceTest : public ::testing::TestWithParam<nn::Version> { - protected: - const nn::Version kVersion = GetParam(); -}; - -std::string printDeviceTest(const testing::TestParamInfo<nn::Version>& info) { - const nn::Version version = info.param; - CHECK(!version.runtimeOnlyFeatures); - switch (version.level) { - case nn::Version::Level::FEATURE_LEVEL_5: - return "v1"; - case nn::Version::Level::FEATURE_LEVEL_6: - return "v2"; - case nn::Version::Level::FEATURE_LEVEL_7: - return "v3"; - default: - LOG(FATAL) << "Invalid AIDL version: " << version; - return "invalid"; - } -} +class DeviceTest : public VersionedAidlUtilsTestBase {}; } // namespace @@ -894,9 +876,6 @@ TEST_P(DeviceTest, allocateDeadObject) { EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); } -INSTANTIATE_TEST_SUITE_P(TestDevice, DeviceTest, - ::testing::Values(nn::kVersionFeatureLevel5, nn::kVersionFeatureLevel6, - nn::kVersionFeatureLevel7), - printDeviceTest); +INSTANTIATE_VERSIONED_AIDL_UTILS_TEST(DeviceTest, kAllAidlVersions); } // namespace aidl::android::hardware::neuralnetworks::utils |