Merge "Update VTS tests so that more tests pass for O." into oc-dr1-dev

This commit is contained in:
TreeHugger Robot 2017-07-24 23:26:12 +00:00 committed by Android (Google) Code Review
commit 45a97e51bb
5 changed files with 53 additions and 32 deletions

View file

@ -79,7 +79,7 @@ TEST_F(RadioHidlTest, setupDataCall) {
radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
radioRsp->rspInfo.error == RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW ||
radioRsp->rspInfo.error == RadioError::OP_NOT_ALLOWED_DURING_VOICE_CALL ||
CheckOEMError());
radioRsp->rspInfo.error == RadioError::SIM_ABSENT || CheckOEMError());
}
}
@ -98,7 +98,9 @@ TEST_F(RadioHidlTest, deactivateDataCall) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
EXPECT_EQ(RadioError::INVALID_CALL_ID, radioRsp->rspInfo.error);
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::INVALID_CALL_ID ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT || CheckOEMError());
}
}
@ -116,7 +118,8 @@ TEST_F(RadioHidlTest, getDataCallList) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE);
radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -220,6 +223,8 @@ TEST_F(RadioHidlTest, setDataProfile) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
// TODO(shuoq): Will add error check when we know the expected error from QC
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}

View file

@ -317,6 +317,7 @@ TEST_F(RadioHidlTest, getIccCardStatus) {
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_SIM_STATE ||
radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT ||
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
}

View file

@ -675,9 +675,11 @@ TEST_F(RadioHidlTest, startLceService) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED ||
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -695,7 +697,8 @@ TEST_F(RadioHidlTest, stopLceService) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED ||
radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -755,20 +758,20 @@ TEST_F(RadioHidlTest, setAllowedCarriers) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || CheckGeneralError());
}
}
/* Reset back to no carrier restriction */
memset(&carriers, 0, sizeof(carriers));
carriers.allowedCarriers.resize(0);
carriers.excludedCarriers.resize(0);
/* Reset back to no carrier restriction */
memset(&carriers, 0, sizeof(carriers));
carriers.allowedCarriers.resize(0);
carriers.excludedCarriers.resize(0);
radio->setAllowedCarriers(++serial, true, carriers);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
radio->setAllowedCarriers(++serial, true, carriers);
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::NONE || CheckGeneralError());
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || CheckGeneralError());
}
}
@ -842,4 +845,4 @@ TEST_F(RadioHidlTest, setSimCardPower) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
}
}
}

View file

@ -36,7 +36,8 @@ TEST_F(RadioHidlTest, sendSms) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_STATE);
radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
EXPECT_EQ(0, radioRsp->sendSmsResult.errorCode);
}
}
@ -62,7 +63,8 @@ TEST_F(RadioHidlTest, sendSMSExpectMore) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_STATE);
radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -145,7 +147,8 @@ TEST_F(RadioHidlTest, sendCdmaSms) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_STATE);
radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -237,7 +240,8 @@ TEST_F(RadioHidlTest, getSmscAddress) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -257,7 +261,8 @@ TEST_F(RadioHidlTest, setSmscAddress) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_SMS_FORMAT);
radioRsp->rspInfo.error == RadioError::INVALID_SMS_FORMAT ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -285,7 +290,8 @@ TEST_F(RadioHidlTest, writeSmsToSim) {
radioRsp->rspInfo.error == RadioError::ENCODING_ERR ||
radioRsp->rspInfo.error == RadioError::NO_RESOURCES ||
radioRsp->rspInfo.error == RadioError::NETWORK_NOT_READY ||
radioRsp->rspInfo.error == RadioError::INVALID_SMSC_ADDRESS);
radioRsp->rspInfo.error == RadioError::INVALID_SMSC_ADDRESS ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -308,7 +314,8 @@ TEST_F(RadioHidlTest, deleteSmsOnSim) {
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY ||
radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -361,7 +368,8 @@ TEST_F(RadioHidlTest, writeSmsToRuim) {
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY ||
radioRsp->rspInfo.error == RadioError::INVALID_SMSC_ADDRESS);
radioRsp->rspInfo.error == RadioError::INVALID_SMSC_ADDRESS ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -413,7 +421,8 @@ TEST_F(RadioHidlTest, deleteSmsOnRuim) {
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::NO_SUCH_ENTRY ||
radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}
@ -434,6 +443,7 @@ TEST_F(RadioHidlTest, reportSmsMemoryStatus) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}

View file

@ -156,7 +156,8 @@ TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
// Test with sending random string
@ -172,6 +173,7 @@ TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
}
}