Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9cf7c9f1 authored by Changyeon Jo's avatar Changyeon Jo
Browse files

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
parent dc817607
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -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 {
                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