Allow REQUEST_NOT_SUPPORTED as an error for startNetworkScan

We are trying to tighten the APIs. However for this case since the
documentation was not updated, we are allowing NOT_SUPPORTED for
now and will be cleaned up in a later release.

Test: run vts -m VtsHalRadioV1_2Target
Bug: 110118713
Change-Id: Id9dd3d7bac99bed36ceb9c906189f1fea78d5a2c
This commit is contained in:
Amit Mahajan 2018-06-15 11:16:28 -07:00
parent f3d1d3aed3
commit a7587b5a7f

View file

@ -43,7 +43,13 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan) {
if (cardStatus.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::SIM_ABSENT}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::NONE}));
// REQUEST_NOT_SUPPORTED should not be allowed as it is not an optional API. However, the
// comments in the hal were not updated to indicate that, hence allowing it as a valid
// error for now. This should be fixed correctly, possibly in a future version of the hal
// (b/110421924). This is being allowed because some vendors do not support
// this request on dual sim devices.
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -69,7 +75,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidArgument) {
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -105,7 +112,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidInterval1) {
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -141,7 +149,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidInterval2) {
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -177,7 +186,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidMaxSearchTime1) {
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -213,7 +223,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidMaxSearchTime2) {
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -249,7 +260,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity1) {
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -285,7 +297,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity2) {
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::INVALID_ARGUMENTS}));
CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -320,7 +333,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_GoodRequest1) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::NONE, RadioError::SIM_ABSENT}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::NONE}));
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@ -356,7 +370,8 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_GoodRequest2) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::NONE, RadioError::SIM_ABSENT}));
} else if (cardStatus.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::NONE}));
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
}