diff options
author | sqian <shuoq@google.com> | 2017-06-09 09:24:26 -0700 |
---|---|---|
committer | sqian <shuoq@google.com> | 2017-06-09 14:47:24 -0700 |
commit | 10a619ab6d9c8d3b0d1a82aa96639cf1bd8029bc (patch) | |
tree | 33917963fba18f03542b0f5dff6a1813237c8004 | |
parent | 11e9b588c4e39481f44b53d9947440a08e836c02 (diff) | |
download | platform_hardware_interfaces-10a619ab6d9c8d3b0d1a82aa96639cf1bd8029bc.tar.gz platform_hardware_interfaces-10a619ab6d9c8d3b0d1a82aa96639cf1bd8029bc.tar.bz2 platform_hardware_interfaces-10a619ab6d9c8d3b0d1a82aa96639cf1bd8029bc.zip |
Fix vts tests:
- setCdmaSubscriptionSource
- nvReadItem
- nvWriteItem
- nvWriteCdmaPrl
- getHardwareConfig
- sendEnvelope
- sendTerminalResponseToSim
Apply ag/2373104/ to prevent merge conflicts
Will update .hal file seperately.
Test: adb shell <vts_binary>
Bug: 35671595
Bug: 35800570
Change-Id: I651af50f122f37721778b1088df40fa6e12ac6e4
Merged-In: I651af50f122f37721778b1088df40fa6e12ac6e4
-rw-r--r-- | radio/1.0/vts/functional/radio_hidl_hal_misc.cpp | 27 | ||||
-rw-r--r-- | radio/1.0/vts/functional/radio_hidl_hal_stk.cpp | 14 | ||||
-rw-r--r-- | radio/1.0/vts/functional/radio_hidl_hal_voice.cpp | 1 |
3 files changed, 28 insertions, 14 deletions
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp index 1df5802dd0..9e4f66880f 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp @@ -184,7 +184,7 @@ TEST_F(RadioHidlTest, setBandMode) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE); } } @@ -216,7 +216,7 @@ TEST_F(RadioHidlTest, setPreferredNetworkType) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE); } } @@ -441,8 +441,10 @@ TEST_F(RadioHidlTest, setCdmaSubscriptionSource) { 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); + std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl; + ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::SIM_ABSENT || + radioRsp->rspInfo.error == RadioError::SUBSCRIPTION_NOT_AVAILABLE || + radioRsp->rspInfo.error == RadioError::NONE); } } @@ -508,7 +510,7 @@ TEST_F(RadioHidlTest, nvReadItem) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE); } } @@ -527,7 +529,7 @@ TEST_F(RadioHidlTest, nvWriteItem) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE); } } @@ -544,7 +546,7 @@ TEST_F(RadioHidlTest, nvWriteCdmaPrl) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE); } } @@ -598,7 +600,7 @@ TEST_F(RadioHidlTest, getHardwareConfig) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::NONE); } } @@ -649,6 +651,7 @@ TEST_F(RadioHidlTest, setRadioCapability) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { + std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl; ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS || radioRsp->rspInfo.error == RadioError::INVALID_STATE); @@ -667,6 +670,7 @@ 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); @@ -743,7 +747,7 @@ TEST_F(RadioHidlTest, setAllowedCarriers) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE); } /* Reset back to no carrier restriction */ @@ -757,7 +761,7 @@ TEST_F(RadioHidlTest, setAllowedCarriers) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE); } } @@ -773,7 +777,7 @@ TEST_F(RadioHidlTest, getAllowedCarriers) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE); + EXPECT_EQ(radioRsp->rspInfo.error, RadioError::NONE); } } @@ -823,6 +827,7 @@ TEST_F(RadioHidlTest, setSimCardPower) { 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::NONE || radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED); } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp index 0d86099f9d..774df98d4b 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp @@ -34,8 +34,10 @@ TEST_F(RadioHidlTest, sendEnvelope) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { + std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl; ASSERT_TRUE(CheckGeneralError() || - radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS); + radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS || + radioRsp->rspInfo.error == RadioError::NONE); } // Test with sending random string @@ -49,8 +51,10 @@ TEST_F(RadioHidlTest, sendEnvelope) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { + std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl; ASSERT_TRUE(CheckGeneralError() || - radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS); + radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS || + radioRsp->rspInfo.error == RadioError::NONE); } } @@ -70,7 +74,10 @@ TEST_F(RadioHidlTest, sendTerminalResponseToSim) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { - EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); + std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl; + ASSERT_TRUE(CheckGeneralError() || + radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS || + radioRsp->rspInfo.error == RadioError::NONE); } serial = GetRandomSerialNumber(); @@ -85,6 +92,7 @@ TEST_F(RadioHidlTest, sendTerminalResponseToSim) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { + std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl; ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS); } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp index 8fe04fd874..d57360fd40 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp @@ -365,6 +365,7 @@ TEST_F(RadioHidlTest, sendCDMAFeatureCode) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); if (cardStatus.cardState == CardState::ABSENT) { + std::cout << static_cast<int>(radioRsp->rspInfo.error) << std::endl; ASSERT_TRUE(CheckGeneralError() || radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS || radioRsp->rspInfo.error == RadioError::NONE || |