From 4c785895e8b58548c8e2de1dd4a3b13ef05d46be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=88=E7=9A=93=E6=9D=B0?= Date: Fri, 15 Nov 2024 13:53:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E5=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 师皓杰 --- .../test/unittest/softbus_adapter/softbus_adapter_test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/dtbschedmgr/test/unittest/softbus_adapter/softbus_adapter_test.cpp b/services/dtbschedmgr/test/unittest/softbus_adapter/softbus_adapter_test.cpp index 28346e1a..930a4691 100644 --- a/services/dtbschedmgr/test/unittest/softbus_adapter/softbus_adapter_test.cpp +++ b/services/dtbschedmgr/test/unittest/softbus_adapter/softbus_adapter_test.cpp @@ -28,6 +28,7 @@ namespace DistributedSchedule { namespace { const std::string NETWORKID_01 = "networkId01"; constexpr int32_t RETRY_SENT_EVENT_MAX_TIME = 3; +const int32_t WAITTIME = 2000; } void SoftbusAdapterTest::SetUpTestCase() @@ -64,8 +65,8 @@ HWTEST_F(SoftbusAdapterTest, SendSoftbusEvent_001, TestSize.Level3) int32_t result = SoftbusAdapter::GetInstance().SendSoftbusEvent(buffer); EXPECT_EQ(result, SOFTBUS_OK); - SoftbusMock sortbusMock; SoftbusAdapter::GetInstance().Init(); + usleep(WAITTIME); result = SoftbusAdapter::GetInstance().SendSoftbusEvent(buffer); EXPECT_EQ(result, SOFTBUS_OK); SoftbusAdapter::GetInstance().UnInit(); @@ -88,6 +89,7 @@ HWTEST_F(SoftbusAdapterTest, DealSendSoftbusEvent_001, TestSize.Level3) EXPECT_EQ(result, INVALID_PARAMETERS_ERR); SoftbusAdapter::GetInstance().Init(); + usleep(WAITTIME); result = SoftbusAdapter::GetInstance().DealSendSoftbusEvent(nullptr, retry); EXPECT_EQ(result, INVALID_PARAMETERS_ERR); @@ -124,6 +126,7 @@ HWTEST_F(SoftbusAdapterTest, RetrySendSoftbusEvent_001, TestSize.Level3) EXPECT_EQ(result, INVALID_PARAMETERS_ERR); SoftbusAdapter::GetInstance().Init(); + usleep(WAITTIME); result = SoftbusAdapter::GetInstance().RetrySendSoftbusEvent(buffer, retry); EXPECT_EQ(result, ERR_OK); SoftbusAdapter::GetInstance().UnInit();