summaryrefslogtreecommitdiff
path: root/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp
diff options
context:
space:
mode:
authorMichael Butler <butlermichael@google.com>2021-11-17 16:33:35 -0800
committerMichael Butler <butlermichael@google.com>2021-11-18 23:56:54 +0000
commit60a7b86cf070a9f582ef36900e463f877fa784fe (patch)
tree8b43c031effce5ea6b0b7e25d140aff21a2541dc /neuralnetworks/utils/common/test/ResilientDeviceTest.cpp
parent34f0a8f418c45ec51bd5053e27011aed4b9b4695 (diff)
Rename Version::ANDROID_* to kVersionFeatureLevel* -- hal
Prior to this change, version constants (e.g., Version::ANDROID_S) were public static constants to make the version constants look as if they were enum values. However, this method prevented versions from being constexpr, because the Version type was incomplete by that point in time. This change moves these version constants outside of the Version struct, and makes them constexpr. They have the new names: * Version::ANDROID_OC_MR1 -> kVersionFeatureLevel1 * Version::ANDROID_P -> kVersionFeatureLevel2 * Version::ANDROID_Q -> kVersionFeatureLevel3 * Version::ANDROID_R -> kVersionFeatureLevel4 * Version::ANDROID_S -> kVersionFeatureLevel5 * Version::FEATURE_LEVEL_6 -> kVersionFeatureLevel6 * Version::EXPERIMENTAL -> kVersionFeatureLevelExperimental Bug: 206975939 Test: mma Change-Id: Ibf5f2fdb1459a69c51865aa5fdcd0cb0c3a88ade
Diffstat (limited to 'neuralnetworks/utils/common/test/ResilientDeviceTest.cpp')
-rw-r--r--neuralnetworks/utils/common/test/ResilientDeviceTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp b/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp
index 2e93a1155c..0488b6359b 100644
--- a/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp
+++ b/neuralnetworks/utils/common/test/ResilientDeviceTest.cpp
@@ -53,7 +53,7 @@ SharedMockDevice createConfiguredMockDevice() {
// Setup default actions for each relevant call.
constexpr auto getName_ret = []() -> const std::string& { return kName; };
constexpr auto getVersionString_ret = []() -> const std::string& { return kVersionString; };
- const auto kFeatureLevel = nn::Version::ANDROID_OC_MR1;
+ constexpr auto kFeatureLevel = nn::kVersionFeatureLevel1;
constexpr auto kDeviceType = nn::DeviceType::ACCELERATOR;
constexpr auto getSupportedExtensions_ret = []() -> const std::vector<nn::Extension>& {
return kExtensions;
@@ -141,7 +141,7 @@ TEST(ResilientDeviceTest, cachedData) {
TEST(ResilientDeviceTest, getFeatureLevel) {
// setup call
const auto [mockDevice, mockDeviceFactory, device] = setup();
- const auto kFeatureLevel = nn::Version::ANDROID_OC_MR1;
+ constexpr auto kFeatureLevel = nn::kVersionFeatureLevel1;
EXPECT_CALL(*mockDevice, getFeatureLevel()).Times(1).WillOnce(Return(kFeatureLevel));
// run test
@@ -591,7 +591,7 @@ TEST(ResilientDeviceTest, recoverCacheMismatchGetFeatureLevel) {
const auto recoveredMockDevice = createConfiguredMockDevice();
EXPECT_CALL(*recoveredMockDevice, getFeatureLevel())
.Times(1)
- .WillOnce(Return(nn::Version::ANDROID_P));
+ .WillOnce(Return(nn::kVersionFeatureLevel2));
EXPECT_CALL(*mockDeviceFactory, Call(false)).Times(1).WillOnce(Return(recoveredMockDevice));
// run test