Verify EVS extended information properly
setExtendedInfo() and getExtendedInfo() are methods that allow our
partners to implement custom commands / metadata. Because id and value
of extended information are opaque to the EVS service, behaviors of EVS
API handling the extended information need to be verified conditionally;
for example, when a test succeeds to set a value, it must be able to
read it back with the same id.
Bug: 329373218
Test: atest VtsHalEvsTargetTest
Change-Id: I965447abca8d1986057dc4a850d8af3f901aaf29
diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp
index 3419b3c..0bbc87c 100644
--- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp
+++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp
@@ -317,12 +317,20 @@
// Verify methods for extended info
const auto id = 0xFFFFFFFF; // meaningless id
std::vector<uint8_t> values;
+ bool isSupported = false;
auto status = pCam->setExtendedInfo(id, values);
if (isLogicalCam) {
EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() ==
static_cast<int>(EvsResult::NOT_SUPPORTED));
} else {
- EXPECT_TRUE(status.isOk());
+ if (status.isOk()) {
+ // 0xFFFFFFFF is valid for EVS HAL implementation under
+ // test.
+ isSupported = true;
+ } else {
+ EXPECT_TRUE(status.getServiceSpecificError() ==
+ static_cast<int>(EvsResult::INVALID_ARG));
+ }
}
status = pCam->getExtendedInfo(id, &values);
@@ -330,7 +338,12 @@
EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() ==
static_cast<int>(EvsResult::NOT_SUPPORTED));
} else {
- EXPECT_TRUE(status.isOk());
+ if (isSupported) {
+ EXPECT_TRUE(status.isOk());
+ } else {
+ EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() ==
+ static_cast<int>(EvsResult::INVALID_ARG));
+ }
}
// Explicitly close the camera so resources are released right away