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

Commit 59e74cad authored by Daniel Zheng's avatar Daniel Zheng
Browse files

health v4 vts test add guard

Add a version guard to vts health hal test to not check for hinge info
if version does not support it

Bug: 318531178
Test: th
Change-Id: Ife4691b3afb31c4189b69f489990419456b3fa24
parent 8d8c85e3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -363,8 +363,14 @@ TEST_P(HealthAidl, getStorageInfo) {
 * Tests the values returned by getHingeInfo() from interface IHealth.
 */
TEST_P(HealthAidl, getHingeInfo) {
    int32_t version{};
    auto status = health->getInterfaceVersion(&version);
    ASSERT_TRUE(status.isOk()) << status;
    if (version < 4) {
        GTEST_SKIP() << "Support for hinge health hal is added in v4";
    }
    std::vector<HingeInfo> value;
    auto status = health->getHingeInfo(&value);
    status = health->getHingeInfo(&value);
    ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
    if (!status.isOk()) return;
    for (auto& hinge : value) {