From 9cf7c9f12b8562123210bb2a9d9de4b00b539b84 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Tue, 26 Mar 2024 02:16:06 +0000 Subject: [PATCH] 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 --- automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index 3419b3c98d..0bbc87c4b0 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -317,12 +317,20 @@ TEST_P(EvsAidlTest, CameraOpenClean) { // Verify methods for extended info const auto id = 0xFFFFFFFF; // meaningless id std::vector values; + bool isSupported = false; auto status = pCam->setExtendedInfo(id, values); if (isLogicalCam) { EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() == static_cast(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(EvsResult::INVALID_ARG)); + } } status = pCam->getExtendedInfo(id, &values); @@ -330,7 +338,12 @@ TEST_P(EvsAidlTest, CameraOpenClean) { EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() == static_cast(EvsResult::NOT_SUPPORTED)); } else { - EXPECT_TRUE(status.isOk()); + if (isSupported) { + EXPECT_TRUE(status.isOk()); + } else { + EXPECT_TRUE(!status.isOk() && status.getServiceSpecificError() == + static_cast(EvsResult::INVALID_ARG)); + } } // Explicitly close the camera so resources are released right away