From 9272727df8c5e42f3afd1315b1018f2af8ccca90 Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Thu, 16 Nov 2017 15:13:12 -0800 Subject: [PATCH] Initialize usb_count in the setup funtion. Spurious wakeups can cause the test thread to return even if the callback was not actually called as the usb_count isnt initialized. Bug: 65469351 Test: mma and pushed locally to the device & tested. --skip-preconditions --module VtsHalUsbV1_0Target Change-Id: Ib0e838cf4a44807142eab6aa5e9df0cc462bb973 --- usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp b/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp index b77398fc65..e01b974ab4 100644 --- a/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp +++ b/usb/1.0/vts/functional/VtsHalUsbV1_0TargetTest.cpp @@ -160,7 +160,7 @@ class UsbHidlTest : public ::testing::VtsHalHidlTargetTestBase { // and the callback thread. std::mutex usb_mtx; std::condition_variable usb_cv; - int usb_count; + int usb_count = 0; }; /*