From 7b887bacbf8d66599c5425deb42d24528bab7c9d Mon Sep 17 00:00:00 2001 From: Eric Jeong Date: Wed, 10 May 2023 11:39:14 -0700 Subject: Fix VtsAidlPowerPolicyTargetTest failure - MINIMUM_CUSTOM_COMPONENT_VALUE is not a component, so we should skip it in the test. Bug: 279522876 Test: atest VtsAidlPowerPolicyTargetTest Change-Id: I41364aa3cc1e96368c1425f48504f196b13ff584 --- automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp b/automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp index 402d291..454c3f1 100644 --- a/automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp +++ b/automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,7 @@ using ::android::ProcessState; using ::android::status_t; using ::android::String16; using ::android::UNKNOWN_ERROR; +using ::android::base::StringPrintf; using ::ndk::ScopedAStatus; using ::ndk::SpAIBinder; @@ -76,9 +78,12 @@ TEST_P(PowerPolicyAidlTest, TestGetCurrentPowerPolicy) { TEST_P(PowerPolicyAidlTest, TestGetPowerComponentState) { bool state; for (const auto componentId : ndk::enum_range()) { + if (componentId >= PowerComponent::MINIMUM_CUSTOM_COMPONENT_VALUE) { + continue; + } ScopedAStatus status = powerPolicyServer->getPowerComponentState(componentId, &state); - - ASSERT_TRUE(status.isOk()); + std::string errMsg = StringPrintf("Getting state of component(%d) fails", componentId); + ASSERT_TRUE(status.isOk()) << errMsg; } } -- cgit v1.2.3