summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorNate Jiang <qiangjiang@google.com>2019-05-29 16:41:19 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-05-29 16:41:19 -0700
commit36e0b2aba970be6fa9ba9f53355c8556c61718b2 (patch)
treea220505e7f5f51a82ef482eb69196504ab438ff8 /wifi
parentba7ccb21f79d97beae346593d910c82c72c571c9 (diff)
parent1289d1fefa92163a8a0affcbef1f14444bbf99b2 (diff)
downloadplatform_hardware_interfaces-36e0b2aba970be6fa9ba9f53355c8556c61718b2.tar.gz
platform_hardware_interfaces-36e0b2aba970be6fa9ba9f53355c8556c61718b2.tar.bz2
platform_hardware_interfaces-36e0b2aba970be6fa9ba9f53355c8556c61718b2.zip
Merge "[VTS][AWARE]Setting callbacktype type to invalid value before invoking HIDL call" into qt-dev
am: 1289d1fefa Change-Id: I0aad72e050a780a4050ff53fe8aa7e03ccd56f08
Diffstat (limited to 'wifi')
-rw-r--r--wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp3
-rw-r--r--wifi/1.2/vts/functional/wifi_nan_iface_hidl_test.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp
index 85bcccd230..64b4fb6d1a 100644
--- a/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp
@@ -91,12 +91,12 @@ class WifiNanIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
};
/* Test code calls this function to wait for data/event callback */
+ /* Must set callbackType = INVALID before call this function */
inline std::cv_status wait(CallbackType waitForCallbackType) {
std::unique_lock<std::mutex> lock(mtx_);
EXPECT_NE(INVALID, waitForCallbackType); // can't ASSERT in a non-void-returning method
- callbackType = INVALID;
std::cv_status status = std::cv_status::no_timeout;
auto now = std::chrono::system_clock::now();
while (count_ == 0) {
@@ -469,6 +469,7 @@ TEST(WifiNanIfaceHidlTestNoFixture, FailOnIfaceInvalid) {
*/
TEST_F(WifiNanIfaceHidlTest, getCapabilitiesRequest) {
uint16_t inputCmdId = 10;
+ callbackType = INVALID;
ASSERT_EQ(WifiStatusCode::SUCCESS,
HIDL_INVOKE(iwifiNanIface, getCapabilitiesRequest, inputCmdId).code);
// wait for a callback
diff --git a/wifi/1.2/vts/functional/wifi_nan_iface_hidl_test.cpp b/wifi/1.2/vts/functional/wifi_nan_iface_hidl_test.cpp
index cc36faeafc..4dbc82bd99 100644
--- a/wifi/1.2/vts/functional/wifi_nan_iface_hidl_test.cpp
+++ b/wifi/1.2/vts/functional/wifi_nan_iface_hidl_test.cpp
@@ -100,13 +100,13 @@ class WifiNanIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
};
/* Test code calls this function to wait for data/event callback */
+ /* Must set callbackType = INVALID before call this function */
inline std::cv_status wait(CallbackType waitForCallbackType) {
std::unique_lock<std::mutex> lock(mtx_);
EXPECT_NE(INVALID, waitForCallbackType); // can't ASSERT in a
// non-void-returning method
- callbackType = INVALID;
std::cv_status status = std::cv_status::no_timeout;
auto now = std::chrono::system_clock::now();
while (count_ == 0) {
@@ -475,6 +475,7 @@ TEST(WifiNanIfaceHidlTestNoFixture, Create) {
*/
TEST_F(WifiNanIfaceHidlTest, enableRequest_1_2InvalidArgs) {
uint16_t inputCmdId = 10;
+ callbackType = INVALID;
NanEnableRequest nanEnableRequest = {};
NanConfigRequestSupplemental nanConfigRequestSupp = {};
ASSERT_EQ(WifiStatusCode::SUCCESS,
@@ -509,6 +510,7 @@ TEST_F(WifiNanIfaceHidlTest, enableRequest_1_2ShimInvalidArgs) {
*/
TEST_F(WifiNanIfaceHidlTest, configRequest_1_2InvalidArgs) {
uint16_t inputCmdId = 10;
+ callbackType = INVALID;
NanConfigRequest nanConfigRequest = {};
NanConfigRequestSupplemental nanConfigRequestSupp = {};
ASSERT_EQ(WifiStatusCode::SUCCESS,