From 20aa01c238d373997420db2a17531b78a0d87ba4 Mon Sep 17 00:00:00 2001 From: Yomna Nasser Date: Mon, 4 Oct 2021 21:55:12 +0000 Subject: [PATCH] VTS fix for getAllowedNetworkTypesBitmap and setAllowedNetworkTypesBitmap Fix VTS for getAllowedNetworkTypesBitmap and setAllowedNetworkTypesBitmap, which should not rely on getRadioHalCapabilities. Bug: b/199809900 Test: atest VtsHalRadioV1_6TargetTest Change-Id: I0b50e7e6c0d406a62f7a1e2ea8ac9bc3a71d8aeb --- .../1.6/vts/functional/radio_hidl_hal_api.cpp | 56 ++++++++----------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp index 710616eaf1..d24bb88e4c 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp @@ -32,23 +32,17 @@ TEST_P(RadioHidlTest_v1_6, setAllowedNetworkTypesBitmap) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - - if (getRadioHalCapabilities()) { - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_v1_6->rspInfo.error, - {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); - } else { - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_v1_6->rspInfo.error, - {::android::hardware::radio::V1_6::RadioError::NONE, - ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, - ::android::hardware::radio::V1_6::RadioError::OPERATION_NOT_ALLOWED, - ::android::hardware::radio::V1_6::RadioError::MODE_NOT_SUPPORTED, - ::android::hardware::radio::V1_6::RadioError::INTERNAL_ERR, - ::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, - ::android::hardware::radio::V1_6::RadioError::MODEM_ERR, - ::android::hardware::radio::V1_6::RadioError::NO_RESOURCES})); - } + ASSERT_TRUE( + CheckAnyOfErrors(radioRsp_v1_6->rspInfo.error, + {::android::hardware::radio::V1_6::RadioError::NONE, + ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, + ::android::hardware::radio::V1_6::RadioError::OPERATION_NOT_ALLOWED, + ::android::hardware::radio::V1_6::RadioError::MODE_NOT_SUPPORTED, + ::android::hardware::radio::V1_6::RadioError::INTERNAL_ERR, + ::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, + ::android::hardware::radio::V1_6::RadioError::MODEM_ERR, + ::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED, + ::android::hardware::radio::V1_6::RadioError::NO_RESOURCES})); } /* @@ -74,23 +68,17 @@ TEST_P(RadioHidlTest_v1_6, getAllowedNetworkTypesBitmap) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - - if (getRadioHalCapabilities()) { - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_v1_6->rspInfo.error, - {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); - } else { - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_v1_6->rspInfo.error, - {::android::hardware::radio::V1_6::RadioError::NONE, - ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, - ::android::hardware::radio::V1_6::RadioError::OPERATION_NOT_ALLOWED, - ::android::hardware::radio::V1_6::RadioError::MODE_NOT_SUPPORTED, - ::android::hardware::radio::V1_6::RadioError::INTERNAL_ERR, - ::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, - ::android::hardware::radio::V1_6::RadioError::MODEM_ERR, - ::android::hardware::radio::V1_6::RadioError::NO_RESOURCES})); - } + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_6->rspInfo.error, + {::android::hardware::radio::V1_6::RadioError::NONE, + ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, + ::android::hardware::radio::V1_6::RadioError::OPERATION_NOT_ALLOWED, + ::android::hardware::radio::V1_6::RadioError::MODE_NOT_SUPPORTED, + ::android::hardware::radio::V1_6::RadioError::INTERNAL_ERR, + ::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, + ::android::hardware::radio::V1_6::RadioError::MODEM_ERR, + ::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED, + ::android::hardware::radio::V1_6::RadioError::NO_RESOURCES})); } }