summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Jeong <ericjeong@google.com>2023-05-10 21:22:10 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-05-10 21:22:10 +0000
commit83dac16a39c15d888797dacdf52396bc42289657 (patch)
tree48760faeba8170bff5b29e245c7ae1c6bf212254
parent7fda914a602f07230eae30b4d0aa3adb0173c202 (diff)
parent7b887bacbf8d66599c5425deb42d24528bab7c9d (diff)
downloadinterfaces-83dac16a39c15d888797dacdf52396bc42289657.tar.gz
Fix VtsAidlPowerPolicyTargetTest failure am: 7b887bacbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/hardware/interfaces/+/23141258 Change-Id: I789f88de6709f69e1539487dd09e1f7c1b391d61 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp9
1 files 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 <aidl/android/frameworks/automotive/powerpolicy/CarPowerPolicyFilter.h>
#include <aidl/android/frameworks/automotive/powerpolicy/ICarPowerPolicyServer.h>
#include <aidl/android/frameworks/automotive/powerpolicy/PowerComponent.h>
+#include <android-base/stringprintf.h>
#include <android/binder_auto_utils.h>
#include <android/binder_manager.h>
#include <android/binder_status.h>
@@ -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<PowerComponent>()) {
+ 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;
}
}