From 27ef157699db575cc0368c5abe1b5282bb1f83f4 Mon Sep 17 00:00:00 2001 From: huxianghao Date: Tue, 27 Aug 2024 03:25:57 +0000 Subject: [PATCH] [test]:Add SoftBusBtInit to fill in btGapCallback Signed-off-by: huxianghao --- tests/adapter/bluetooth/softbus_adapter_bt_common_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/adapter/bluetooth/softbus_adapter_bt_common_test.cpp b/tests/adapter/bluetooth/softbus_adapter_bt_common_test.cpp index 06e3520c3..482ef07b8 100644 --- a/tests/adapter/bluetooth/softbus_adapter_bt_common_test.cpp +++ b/tests/adapter/bluetooth/softbus_adapter_bt_common_test.cpp @@ -118,6 +118,10 @@ static testing::AssertionResult PrepareBtStateListener(MockBluetooth &mocker, in if (listenerId < 0) { return testing::AssertionFailure() << "SoftBusAddBtStateListener failed"; } + + int32_t ret = SoftBusBtInit(); + EXPECT_EQ(ret, SOFTBUS_OK); + if (MockBluetooth::btGapCallback == nullptr) { return testing::AssertionFailure() << "GapRegisterCallback is not invoke"; }