mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-23 06:20:07 +00:00
增加时延
Signed-off-by: 师皓杰 <shihaojie10@huawei.com>
This commit is contained in:
parent
bdc50b7b94
commit
4c785895e8
@ -28,6 +28,7 @@ namespace DistributedSchedule {
|
|||||||
namespace {
|
namespace {
|
||||||
const std::string NETWORKID_01 = "networkId01";
|
const std::string NETWORKID_01 = "networkId01";
|
||||||
constexpr int32_t RETRY_SENT_EVENT_MAX_TIME = 3;
|
constexpr int32_t RETRY_SENT_EVENT_MAX_TIME = 3;
|
||||||
|
const int32_t WAITTIME = 2000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoftbusAdapterTest::SetUpTestCase()
|
void SoftbusAdapterTest::SetUpTestCase()
|
||||||
@ -64,8 +65,8 @@ HWTEST_F(SoftbusAdapterTest, SendSoftbusEvent_001, TestSize.Level3)
|
|||||||
int32_t result = SoftbusAdapter::GetInstance().SendSoftbusEvent(buffer);
|
int32_t result = SoftbusAdapter::GetInstance().SendSoftbusEvent(buffer);
|
||||||
EXPECT_EQ(result, SOFTBUS_OK);
|
EXPECT_EQ(result, SOFTBUS_OK);
|
||||||
|
|
||||||
SoftbusMock sortbusMock;
|
|
||||||
SoftbusAdapter::GetInstance().Init();
|
SoftbusAdapter::GetInstance().Init();
|
||||||
|
usleep(WAITTIME);
|
||||||
result = SoftbusAdapter::GetInstance().SendSoftbusEvent(buffer);
|
result = SoftbusAdapter::GetInstance().SendSoftbusEvent(buffer);
|
||||||
EXPECT_EQ(result, SOFTBUS_OK);
|
EXPECT_EQ(result, SOFTBUS_OK);
|
||||||
SoftbusAdapter::GetInstance().UnInit();
|
SoftbusAdapter::GetInstance().UnInit();
|
||||||
@ -88,6 +89,7 @@ HWTEST_F(SoftbusAdapterTest, DealSendSoftbusEvent_001, TestSize.Level3)
|
|||||||
EXPECT_EQ(result, INVALID_PARAMETERS_ERR);
|
EXPECT_EQ(result, INVALID_PARAMETERS_ERR);
|
||||||
|
|
||||||
SoftbusAdapter::GetInstance().Init();
|
SoftbusAdapter::GetInstance().Init();
|
||||||
|
usleep(WAITTIME);
|
||||||
result = SoftbusAdapter::GetInstance().DealSendSoftbusEvent(nullptr, retry);
|
result = SoftbusAdapter::GetInstance().DealSendSoftbusEvent(nullptr, retry);
|
||||||
EXPECT_EQ(result, INVALID_PARAMETERS_ERR);
|
EXPECT_EQ(result, INVALID_PARAMETERS_ERR);
|
||||||
|
|
||||||
@ -124,6 +126,7 @@ HWTEST_F(SoftbusAdapterTest, RetrySendSoftbusEvent_001, TestSize.Level3)
|
|||||||
EXPECT_EQ(result, INVALID_PARAMETERS_ERR);
|
EXPECT_EQ(result, INVALID_PARAMETERS_ERR);
|
||||||
|
|
||||||
SoftbusAdapter::GetInstance().Init();
|
SoftbusAdapter::GetInstance().Init();
|
||||||
|
usleep(WAITTIME);
|
||||||
result = SoftbusAdapter::GetInstance().RetrySendSoftbusEvent(buffer, retry);
|
result = SoftbusAdapter::GetInstance().RetrySendSoftbusEvent(buffer, retry);
|
||||||
EXPECT_EQ(result, ERR_OK);
|
EXPECT_EQ(result, ERR_OK);
|
||||||
SoftbusAdapter::GetInstance().UnInit();
|
SoftbusAdapter::GetInstance().UnInit();
|
||||||
|
Loading…
Reference in New Issue
Block a user