mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 06:22:53 +00:00
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
This commit is contained in:
@@ -317,12 +317,20 @@ TEST_P(EvsAidlTest, CameraOpenClean) {
|
||||
// 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 @@ TEST_P(EvsAidlTest, CameraOpenClean) {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user