Fix some stk api Radio Vts tests.
Bug: 37502436 Test: Manual vts Change-Id: Idd9a1fd38413aed89aaa152cb9a91c001f18b339 Merged-in: Idd9a1fd38413aed89aaa152cb9a91c001f18b339
This commit is contained in:
parent
827e291043
commit
2ab0ec0626
2 changed files with 18 additions and 13 deletions
|
@ -34,7 +34,8 @@ TEST_F(RadioHidlTest, sendEnvelope) {
|
|||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
|
||||
if (cardStatus.cardState == CardState::ABSENT) {
|
||||
EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
|
||||
ASSERT_TRUE(CheckGeneralError() ||
|
||||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
|
||||
}
|
||||
|
||||
// Test with sending random string
|
||||
|
@ -48,7 +49,8 @@ TEST_F(RadioHidlTest, sendEnvelope) {
|
|||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
|
||||
if (cardStatus.cardState == CardState::ABSENT) {
|
||||
EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
|
||||
ASSERT_TRUE(CheckGeneralError() ||
|
||||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,7 +85,8 @@ TEST_F(RadioHidlTest, sendTerminalResponseToSim) {
|
|||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
|
||||
if (cardStatus.cardState == CardState::ABSENT) {
|
||||
EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
|
||||
ASSERT_TRUE(CheckGeneralError() ||
|
||||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,12 +104,10 @@ TEST_F(RadioHidlTest, handleStkCallSetupRequestFromSim) {
|
|||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
|
||||
if (cardStatus.cardState == CardState::ABSENT) {
|
||||
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
|
||||
radioRsp->rspInfo.error == RadioError::SYSTEM_ERR ||
|
||||
radioRsp->rspInfo.error == RadioError::NO_MEMORY ||
|
||||
ASSERT_TRUE(CheckGeneralError() ||
|
||||
radioRsp->rspInfo.error == RadioError::NONE ||
|
||||
radioRsp->rspInfo.error == RadioError::MODEM_ERR ||
|
||||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
|
||||
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
|
||||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,7 +124,8 @@ TEST_F(RadioHidlTest, reportStkServiceIsRunning) {
|
|||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
|
||||
if (cardStatus.cardState == CardState::ABSENT) {
|
||||
EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
|
||||
ASSERT_TRUE(CheckGeneralError() ||
|
||||
radioRsp->rspInfo.error == RadioError::NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +146,8 @@ TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
|
|||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
|
||||
if (cardStatus.cardState == CardState::ABSENT) {
|
||||
EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
|
||||
ASSERT_TRUE(CheckGeneralError() ||
|
||||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
|
||||
}
|
||||
|
||||
// Test with sending random string
|
||||
|
@ -158,6 +161,7 @@ TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
|
|||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
|
||||
if (cardStatus.cardState == CardState::ABSENT) {
|
||||
ASSERT_FALSE(RadioError::NONE == radioRsp->rspInfo.error);
|
||||
ASSERT_TRUE(CheckGeneralError() ||
|
||||
radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,10 +65,11 @@ bool RadioHidlTest::CheckGeneralError() {
|
|||
radioRsp->rspInfo.error == RadioError::NO_MEMORY ||
|
||||
radioRsp->rspInfo.error == RadioError::INTERNAL_ERR ||
|
||||
radioRsp->rspInfo.error == RadioError::SYSTEM_ERR ||
|
||||
radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
|
||||
radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED ||
|
||||
radioRsp->rspInfo.error == RadioError::CANCELLED);
|
||||
}
|
||||
|
||||
bool RadioHidlTest::CheckOEMError() {
|
||||
return (radioRsp->rspInfo.error >= RadioError::OEM_ERROR_1 &&
|
||||
radioRsp->rspInfo.error <= RadioError::OEM_ERROR_25);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue