Merge "Add VTS for couple of missing APIs and some cleanup for earlier APIs." am: 60449e68d1 am: 516a71e295

am: 0f8a067a04

Change-Id: Ifbdbf6c739e140eb10c8fafdeaa31b92f281a41b
This commit is contained in:
Sanket Padawe 2017-03-22 21:44:37 +00:00 committed by android-build-merger
commit cae250ad67
3 changed files with 55 additions and 26 deletions

View file

@ -416,6 +416,23 @@ TEST_F(RadioHidlTest, getCdmaSubscriptionSource) {
}
}
/*
* Test IRadio.setCdmaSubscriptionSource() for the response returned.
*/
TEST_F(RadioHidlTest, setCdmaSubscriptionSource) {
int serial = 1;
radio->setCdmaSubscriptionSource(++serial, CdmaSubscriptionSource::RUIM_SIM);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::SIM_ABSENT
|| radioRsp->rspInfo.error == RadioError::SUBSCRIPTION_NOT_AVAILABLE);
}
}
/*
* Test IRadio.getVoiceRadioTechnology() for the response returned.
*/
@ -455,7 +472,7 @@ TEST_F(RadioHidlTest, setCellInfoListRate) {
int serial = 1;
// TODO(sanketpadawe): RIL crashes with value of rate = 10
radio->setCellInfoListRate(++serial, 0);
radio->setCellInfoListRate(++serial, 10);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);

View file

@ -28,8 +28,7 @@ TEST_F(RadioHidlTest, getCurrentCalls) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE
|| radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
}
@ -87,8 +86,7 @@ TEST_F(RadioHidlTest, hangupWaitingOrBackground) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@ -106,8 +104,7 @@ TEST_F(RadioHidlTest, hangupForegroundResumeBackground) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@ -125,8 +122,7 @@ TEST_F(RadioHidlTest, switchWaitingOrHoldingAndActive) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@ -144,8 +140,7 @@ TEST_F(RadioHidlTest, conference) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@ -163,8 +158,7 @@ TEST_F(RadioHidlTest, rejectCall) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@ -182,8 +176,7 @@ TEST_F(RadioHidlTest, getLastCallFailCause) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::NONE);
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
}
@ -218,8 +211,7 @@ TEST_F(RadioHidlTest, cancelPendingUssd) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@ -319,8 +311,7 @@ TEST_F(RadioHidlTest, acceptCall) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@ -357,11 +348,30 @@ TEST_F(RadioHidlTest, explicitCallTransfer) {
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
}
/*
* Test IRadio.sendCDMAFeatureCode() for the response returned.
*/
TEST_F(RadioHidlTest, sendCDMAFeatureCode) {
int serial = 1;
radio->sendCDMAFeatureCode(serial, hidl_string());
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR
|| radioRsp->rspInfo.error == RadioError::SYSTEM_ERR);
}
}
@ -414,8 +424,7 @@ TEST_F(RadioHidlTest, stopDtmf) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@ -450,8 +459,7 @@ TEST_F(RadioHidlTest, getMute) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::NONE);
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
}

View file

@ -496,7 +496,9 @@ Return<void> RadioResponse::setLocationUpdatesResponse(
return Void();
}
Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const RadioResponseInfo& /*info*/) {
Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const RadioResponseInfo& info) {
rspInfo = info;
parent.notify();
return Void();
}
@ -539,7 +541,9 @@ Return<void> RadioResponse::getPreferredVoicePrivacyResponse(
return Void();
}
Return<void> RadioResponse::sendCDMAFeatureCodeResponse(const RadioResponseInfo& /*info*/) {
Return<void> RadioResponse::sendCDMAFeatureCodeResponse(const RadioResponseInfo& info) {
rspInfo = info;
parent.notify();
return Void();
}