mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Setting callbacktype type to invalid value before invoking HIDL call" into pie-vts-dev
This commit is contained in:
@@ -91,12 +91,12 @@ class WifiNanIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Test code calls this function to wait for data/event callback */
|
/* 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) {
|
inline std::cv_status wait(CallbackType waitForCallbackType) {
|
||||||
std::unique_lock<std::mutex> lock(mtx_);
|
std::unique_lock<std::mutex> lock(mtx_);
|
||||||
|
|
||||||
EXPECT_NE(INVALID, waitForCallbackType); // can't ASSERT in a non-void-returning method
|
EXPECT_NE(INVALID, waitForCallbackType); // can't ASSERT in a non-void-returning method
|
||||||
|
|
||||||
callbackType = INVALID;
|
|
||||||
std::cv_status status = std::cv_status::no_timeout;
|
std::cv_status status = std::cv_status::no_timeout;
|
||||||
auto now = std::chrono::system_clock::now();
|
auto now = std::chrono::system_clock::now();
|
||||||
while (count_ == 0) {
|
while (count_ == 0) {
|
||||||
@@ -469,6 +469,7 @@ TEST(WifiNanIfaceHidlTestNoFixture, FailOnIfaceInvalid) {
|
|||||||
*/
|
*/
|
||||||
TEST_F(WifiNanIfaceHidlTest, getCapabilitiesRequest) {
|
TEST_F(WifiNanIfaceHidlTest, getCapabilitiesRequest) {
|
||||||
uint16_t inputCmdId = 10;
|
uint16_t inputCmdId = 10;
|
||||||
|
callbackType = INVALID;
|
||||||
ASSERT_EQ(WifiStatusCode::SUCCESS,
|
ASSERT_EQ(WifiStatusCode::SUCCESS,
|
||||||
HIDL_INVOKE(iwifiNanIface, getCapabilitiesRequest, inputCmdId).code);
|
HIDL_INVOKE(iwifiNanIface, getCapabilitiesRequest, inputCmdId).code);
|
||||||
// wait for a callback
|
// wait for a callback
|
||||||
|
|||||||
@@ -100,13 +100,13 @@ class WifiNanIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Test code calls this function to wait for data/event callback */
|
/* 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) {
|
inline std::cv_status wait(CallbackType waitForCallbackType) {
|
||||||
std::unique_lock<std::mutex> lock(mtx_);
|
std::unique_lock<std::mutex> lock(mtx_);
|
||||||
|
|
||||||
EXPECT_NE(INVALID, waitForCallbackType); // can't ASSERT in a
|
EXPECT_NE(INVALID, waitForCallbackType); // can't ASSERT in a
|
||||||
// non-void-returning method
|
// non-void-returning method
|
||||||
|
|
||||||
callbackType = INVALID;
|
|
||||||
std::cv_status status = std::cv_status::no_timeout;
|
std::cv_status status = std::cv_status::no_timeout;
|
||||||
auto now = std::chrono::system_clock::now();
|
auto now = std::chrono::system_clock::now();
|
||||||
while (count_ == 0) {
|
while (count_ == 0) {
|
||||||
@@ -475,6 +475,7 @@ TEST(WifiNanIfaceHidlTestNoFixture, Create) {
|
|||||||
*/
|
*/
|
||||||
TEST_F(WifiNanIfaceHidlTest, enableRequest_1_2InvalidArgs) {
|
TEST_F(WifiNanIfaceHidlTest, enableRequest_1_2InvalidArgs) {
|
||||||
uint16_t inputCmdId = 10;
|
uint16_t inputCmdId = 10;
|
||||||
|
callbackType = INVALID;
|
||||||
NanEnableRequest nanEnableRequest = {};
|
NanEnableRequest nanEnableRequest = {};
|
||||||
NanConfigRequestSupplemental nanConfigRequestSupp = {};
|
NanConfigRequestSupplemental nanConfigRequestSupp = {};
|
||||||
ASSERT_EQ(WifiStatusCode::SUCCESS,
|
ASSERT_EQ(WifiStatusCode::SUCCESS,
|
||||||
@@ -509,6 +510,7 @@ TEST_F(WifiNanIfaceHidlTest, enableRequest_1_2ShimInvalidArgs) {
|
|||||||
*/
|
*/
|
||||||
TEST_F(WifiNanIfaceHidlTest, configRequest_1_2InvalidArgs) {
|
TEST_F(WifiNanIfaceHidlTest, configRequest_1_2InvalidArgs) {
|
||||||
uint16_t inputCmdId = 10;
|
uint16_t inputCmdId = 10;
|
||||||
|
callbackType = INVALID;
|
||||||
NanConfigRequest nanConfigRequest = {};
|
NanConfigRequest nanConfigRequest = {};
|
||||||
NanConfigRequestSupplemental nanConfigRequestSupp = {};
|
NanConfigRequestSupplemental nanConfigRequestSupp = {};
|
||||||
ASSERT_EQ(WifiStatusCode::SUCCESS,
|
ASSERT_EQ(WifiStatusCode::SUCCESS,
|
||||||
|
|||||||
Reference in New Issue
Block a user