diff options
author | Iris Chang <iris.chang@mediatek.com> | 2017-11-15 04:13:54 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-11-15 04:13:54 +0000 |
commit | eddb1d9a017b6f54526a514cc1191a254ba3876a (patch) | |
tree | be4ba95fcff8f32908ba80ccaf3aaeec93fc8161 | |
parent | 164cfb73d9eef4321ae71e5c4888865a3b3c8592 (diff) | |
parent | 2d47467288f790fa2296659cda8f5290e4efd134 (diff) | |
download | platform_hardware_interfaces-eddb1d9a017b6f54526a514cc1191a254ba3876a.tar.gz platform_hardware_interfaces-eddb1d9a017b6f54526a514cc1191a254ba3876a.tar.bz2 platform_hardware_interfaces-eddb1d9a017b6f54526a514cc1191a254ba3876a.zip |
Merge "VTS: fix RadioHidlTest.getAvailableNetworks issue" am: 89b2d24fb0 am: 0c9df89f88
am: 2d47467288
Change-Id: Id5ddb114f2a31d39d844409b4444fbd4ca77745e
5 files changed, 9 insertions, 9 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 81c6bb5336..cb0a7302fe 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp @@ -141,7 +141,7 @@ TEST_F(RadioHidlTest, getAvailableNetworks) { int serial = GetRandomSerialNumber(); radio->getAvailableNetworks(serial); - EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(std::cv_status::no_timeout, wait(300)); EXPECT_EQ(serial, radioRsp->rspInfo.serial); ASSERT_TRUE(radioRsp->rspInfo.type == RadioResponseType::SOLICITED || radioRsp->rspInfo.type == RadioResponseType::SOLICITED_ACK_EXP); diff --git a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp index 556945bca6..27d19cbf5c 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp @@ -51,13 +51,13 @@ void RadioHidlTest::notify() { cv.notify_one(); } -std::cv_status RadioHidlTest::wait() { +std::cv_status RadioHidlTest::wait(int sec) { std::unique_lock<std::mutex> lock(mtx); std::cv_status status = std::cv_status::no_timeout; auto now = std::chrono::system_clock::now(); while (count == 0) { - status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD)); + status = cv.wait_until(lock, now + std::chrono::seconds(sec)); if (status == std::cv_status::timeout) { return status; } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h b/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h index ab0bd8b1d0..a5e87016ac 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h +++ b/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h @@ -527,9 +527,9 @@ class RadioHidlTest : public ::testing::VtsHalHidlTargetTestBase { void notify(); /* Test code calls this function to wait for response */ - std::cv_status wait(); + std::cv_status wait(int sec = TIMEOUT_PERIOD); sp<IRadio> radio; sp<RadioResponse> radioRsp; sp<RadioIndication> radioInd; -};
\ No newline at end of file +}; diff --git a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp index 22ea48639a..c4bf1cc8ef 100644 --- a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp +++ b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp @@ -52,13 +52,13 @@ void RadioHidlTest_v1_1::notify() { cv.notify_one(); } -std::cv_status RadioHidlTest_v1_1::wait() { +std::cv_status RadioHidlTest_v1_1::wait(int sec) { std::unique_lock<std::mutex> lock(mtx); std::cv_status status = std::cv_status::no_timeout; auto now = std::chrono::system_clock::now(); while (count == 0) { - status = cv.wait_until(lock, now + std::chrono::seconds(TIMEOUT_PERIOD)); + status = cv.wait_until(lock, now + std::chrono::seconds(sec)); if (status == std::cv_status::timeout) { return status; } diff --git a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h index 3e31459169..523b9babe5 100644 --- a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h +++ b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h @@ -550,7 +550,7 @@ class RadioHidlTest_v1_1 : public ::testing::VtsHalHidlTargetTestBase { void notify(); /* Test code calls this function to wait for response */ - std::cv_status wait(); + std::cv_status wait(int sec = TIMEOUT_PERIOD); /* Used for checking General Errors */ bool CheckGeneralError(); @@ -561,4 +561,4 @@ class RadioHidlTest_v1_1 : public ::testing::VtsHalHidlTargetTestBase { sp<::android::hardware::radio::V1_1::IRadio> radio_v1_1; sp<RadioResponse_v1_1> radioRsp_v1_1; sp<RadioIndication_v1_1> radioInd_v1_1; -};
\ No newline at end of file +}; |