From 781409825d4f1fc20edadc9688e30eede8954e12 Mon Sep 17 00:00:00 2001 From: Rocky Fang Date: Fri, 16 Jun 2023 00:42:41 +0000 Subject: [PATCH] Ignore NanSessionStateChange test for old HAL Test: Tested on V1 HAL, before this change, it failed. After this change, it showed ignored. Bug: 287400067 Change-Id: I171cfd08da97d0b5830d241a9cd6ce2fa1f899dc --- .../aidl/vts/VtsAidlHalContextHubTargetTest.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index 89a9e23a77..c1cc07cf51 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -385,9 +385,15 @@ TEST_P(ContextHubAidl, TestInvalidHostConnection) { TEST_P(ContextHubAidl, TestNanSessionStateChange) { NanSessionStateUpdate update; update.state = true; - ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk()); - update.state = false; - ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk()); + Status status = contextHub->onNanSessionStateChanged(update); + if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION || + status.transactionError() == android::UNKNOWN_TRANSACTION) { + GTEST_SKIP() << "Not supported -> old API; or not implemented"; + } else { + ASSERT_TRUE(status.isOk()); + update.state = false; + ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk()); + } } std::string PrintGeneratedTest(const testing::TestParamInfo& info) {