Merge "Patch for setSimCardPower_1_1"

This commit is contained in:
Treehugger Robot 2018-08-15 17:50:47 +00:00 committed by Gerrit Code Review
commit b4e998e812

View file

@ -33,17 +33,17 @@ TEST_F(RadioHidlTest_v1_1, setSimCardPower_1_1) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_1->rspInfo.error, ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_1->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED,
RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE})); RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE}));
/* Wait some time for setting sim power down and then verify it */ if (radioRsp_v1_1->rspInfo.error == RadioError::NONE) {
updateSimCardStatus(); /* Wait some time for setting sim power down and then verify it */
auto startTime = std::chrono::system_clock::now(); updateSimCardStatus();
while (cardStatus.cardState != CardState::ABSENT && auto startTime = std::chrono::system_clock::now();
while (cardStatus.cardState != CardState::ABSENT &&
std::chrono::duration_cast<chrono::seconds>(std::chrono::system_clock::now() - startTime) std::chrono::duration_cast<chrono::seconds>(std::chrono::system_clock::now() - startTime)
.count() < 80) { .count() < 80) {
/* Set 2 seconds as interval to check card status */ /* Set 2 seconds as interval to check card status */
sleep(2); sleep(2);
updateSimCardStatus(); updateSimCardStatus();
} }
if (radioRsp_v1_1->rspInfo.error == RadioError::NONE) {
EXPECT_EQ(CardState::ABSENT, cardStatus.cardState); EXPECT_EQ(CardState::ABSENT, cardStatus.cardState);
} }
@ -65,7 +65,7 @@ TEST_F(RadioHidlTest_v1_1, setSimCardPower_1_1) {
radioRsp_v1_1->rspInfo.error == RadioError::NONE) { radioRsp_v1_1->rspInfo.error == RadioError::NONE) {
/* Wait some time for resetting back to sim power on and then verify it */ /* Wait some time for resetting back to sim power on and then verify it */
updateSimCardStatus(); updateSimCardStatus();
startTime = std::chrono::system_clock::now(); auto startTime = std::chrono::system_clock::now();
while (cardStatus.cardState != CardState::PRESENT && while (cardStatus.cardState != CardState::PRESENT &&
std::chrono::duration_cast<chrono::seconds>(std::chrono::system_clock::now() - std::chrono::duration_cast<chrono::seconds>(std::chrono::system_clock::now() -
startTime) startTime)