diff options
author | Amruth Ramachandran <amruthr@google.com> | 2019-04-01 18:35:47 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-04-01 18:35:47 -0700 |
commit | 019d89b77f165b16c07606037645035e149a0d3c (patch) | |
tree | dcdf166cb015eac2f0ad339102fefbe5403211ca /radio | |
parent | 3c8de391ab861db3e29212eda0f3b3b67068ec3d (diff) | |
parent | 139f8bd94218c0da63760989e700f65f6be36981 (diff) | |
download | android_hardware_interfaces-019d89b77f165b16c07606037645035e149a0d3c.tar.gz android_hardware_interfaces-019d89b77f165b16c07606037645035e149a0d3c.tar.bz2 android_hardware_interfaces-019d89b77f165b16c07606037645035e149a0d3c.zip |
Add VTS test for getDataRegistrationState am: 7c06193d09 am: af32ed1e54
am: 139f8bd942
Change-Id: I210493d3dfe019b347d8fa1228e386f5d9bb0d25
Diffstat (limited to 'radio')
-rw-r--r-- | radio/1.4/vts/functional/radio_hidl_hal_api.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp index 76d87585a..2093c2547 100644 --- a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp @@ -758,3 +758,40 @@ TEST_F(RadioHidlTest_v1_4, setInitialAttachApn_1_4) { {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE})); } } + +/* + * Test IRadio.getDataRegistrationStateResponse_1_4() for the response returned. + */ +TEST_F(RadioHidlTest_v1_4, getDataRegistrationState_1_4) { + int rat; + serial = GetRandomSerialNumber(); + + Return<void> res = radio_v1_4->getDataRegistrationState(serial); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_4->rspInfo.type); + EXPECT_EQ(serial, radioRsp_v1_4->rspInfo.serial); + + ALOGI("getDataRegistrationStateResponse_1_4, rspInfo.error = %s\n", + toString(radioRsp_v1_4->rspInfo.error).c_str()); + + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_4->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED})); + + rat = radioRsp_v1_4->dataRegResp.base.rat; + /* + * - Expect Valid vopsinfo when device is on LTE + * - Expect empty vopsInfo when device is not on LTE + */ + if (rat == ((int )::android::hardware::radio::V1_4::RadioTechnology::LTE) + || (rat == (int )::android::hardware::radio::V1_4::RadioTechnology::LTE_CA)) { + + EXPECT_EQ(::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo::hidl_discriminator + ::lteVopsInfo, radioRsp_v1_4->dataRegResp.vopsInfo.getDiscriminator()); + } else { + + EXPECT_EQ(::android::hardware::radio::V1_4::DataRegStateResult::VopsInfo::hidl_discriminator + ::noinit, radioRsp_v1_4->dataRegResp.vopsInfo.getDiscriminator()); + } +} |