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

Commit 0cc4f07a authored by Matthew Sedam's avatar Matthew Sedam Committed by Android (Google) Code Review
Browse files

Merge "Use GTEST_SKIP when a function is not supported on older HAL versions"

parents bb331d3f 121b6d6b
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -88,21 +88,21 @@ TEST_P(ContextHubAidl, TestEnableTestMode) {
    Status status = contextHub->setTestMode(true);
    if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
        status.transactionError() == android::UNKNOWN_TRANSACTION) {
        return;  // not supported -> old API; or not implemented
    }

        GTEST_SKIP() << "Not supported -> old API; or not implemented";
    } else {
        ASSERT_TRUE(status.isOk());
    }
}

TEST_P(ContextHubAidl, TestDisableTestMode) {
    Status status = contextHub->setTestMode(false);
    if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
        status.transactionError() == android::UNKNOWN_TRANSACTION) {
        return;  // not supported -> old API; or not implemented
    }

        GTEST_SKIP() << "Not supported -> old API; or not implemented";
    } else {
        ASSERT_TRUE(status.isOk());
    }
}

class EmptyContextHubCallback : public android::hardware::contexthub::BnContextHubCallback {
  public:
@@ -186,12 +186,12 @@ TEST_P(ContextHubAidl, TestGetPreloadedNanoapps) {
    Status status = contextHub->getPreloadedNanoappIds(&preloadedNanoappIds);
    if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
        status.transactionError() == android::UNKNOWN_TRANSACTION) {
        return;  // not supported -> old API; or not implemented
    }

        GTEST_SKIP() << "Not supported -> old API; or not implemented";
    } else {
        ASSERT_TRUE(status.isOk());
        ASSERT_FALSE(preloadedNanoappIds.empty());
    }
}

// Helper callback that puts the TransactionResult for the expectedTransactionId into a
// promise