Fix failure vts tests:

- setCdmaBroadcastConfig
- getCdmaBroadcastConfig
- setCdmaBroadcastActivation
- pullLceData
- setAllowedCarriers
- setAllowedCarriers
- sendEnvelope
- sendEnvelopeWithStatus
- cancelPendingUssd
- sendCDMAFeatureCode

Test: mma -j30; adb shell binary
Bug: 62960543, 62584347
Change-Id: Ie907cdb464a44d92be47d898151d71eb2d83a11c
This commit is contained in:
sqian 2017-06-27 17:24:59 -07:00 committed by Shuo Qian
parent 0b11bd5206
commit 006a3c4b08
4 changed files with 23 additions and 14 deletions

View file

@ -123,7 +123,8 @@ TEST_F(RadioHidlTest, setCdmaBroadcastConfig) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::NONE);
}
}
@ -140,7 +141,7 @@ TEST_F(RadioHidlTest, getCdmaBroadcastConfig) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError());
ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE);
}
}
@ -159,7 +160,8 @@ TEST_F(RadioHidlTest, setCdmaBroadcastActivation) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::NONE);
}
}

View file

@ -184,7 +184,7 @@ TEST_F(RadioHidlTest, setBandMode) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE);
}
}
@ -216,7 +216,7 @@ TEST_F(RadioHidlTest, setPreferredNetworkType) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE);
}
}
@ -707,7 +707,8 @@ TEST_F(RadioHidlTest, pullLceData) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE || CheckOEMError() ||
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
radioRsp->rspInfo.error == RadioError::NONE);
}
}
@ -747,7 +748,7 @@ TEST_F(RadioHidlTest, setAllowedCarriers) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || CheckGeneralError());
}
/* Reset back to no carrier restriction */
@ -761,7 +762,7 @@ TEST_F(RadioHidlTest, setAllowedCarriers) {
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE);
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || CheckGeneralError());
}
}

View file

@ -37,7 +37,8 @@ TEST_F(RadioHidlTest, sendEnvelope) {
std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::NONE);
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
}
// Test with sending random string
@ -54,7 +55,8 @@ TEST_F(RadioHidlTest, sendEnvelope) {
std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl;
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::NONE);
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
}
}
@ -153,7 +155,8 @@ TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
}
// Test with sending random string
@ -168,6 +171,7 @@ TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() ||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
}
}

View file

@ -214,7 +214,8 @@ TEST_F(RadioHidlTest, cancelPendingUssd) {
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::INVALID_STATE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::NONE);
}
}
@ -371,7 +372,8 @@ TEST_F(RadioHidlTest, sendCDMAFeatureCode) {
radioRsp->rspInfo.error == RadioError::NONE ||
radioRsp->rspInfo.error == RadioError::INVALID_CALL_ID ||
radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE ||
radioRsp->rspInfo.error == RadioError::MODEM_ERR);
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
radioRsp->rspInfo.error == RadioError::MODE_NOT_SUPPORTED);
}
}