Description:reviewbot

Match-id-c5bb6f6e6d3b7d1b477eb9a68e4934ea711ba0c4
This commit is contained in:
xxxx
2022-08-17 15:18:57 +08:00
parent 81e02709db
commit c51fb3b640
2 changed files with 4 additions and 6 deletions
@@ -29,9 +29,6 @@
namespace OHOS {
namespace DistributedHardware {
namespace {
const uint32_t SLEEP_TIME_US = 100 * 1000;
}
void OpenInputSoftbusFuzzTest(const uint8_t* data, size_t size)
{
if ((data == nullptr) || (size <= 0)) {
@@ -40,7 +37,8 @@ void OpenInputSoftbusFuzzTest(const uint8_t* data, size_t size)
std::string remoteDevId(reinterpret_cast<const char*>(data), size);
usleep(SLEEP_TIME_US);
const uint32_t sleepTimeUs = 100 * 1000;
usleep(sleepTimeUs);
DistributedInput::DistributedInputSourceTransport::GetInstance().OpenInputSoftbus(remoteDevId);
DistributedInput::DistributedInputSourceTransport::GetInstance().CloseInputSoftbus(remoteDevId);
}
+2 -2
View File
@@ -33,7 +33,6 @@ namespace OHOS {
namespace DistributedHardware {
namespace DistributedInput {
namespace {
constexpr int32_t US_ONE_SECOND = 1000 * 1000;
const char *const DESCRIPTOR = "descriptor";
}
@@ -64,9 +63,10 @@ std::string GetLocalNetworkId()
uint64_t GetCurrentTime()
{
constexpr int32_t usOneSecond = 1000 * 1000;
struct timeval tv;
gettimeofday(&tv, nullptr);
return tv.tv_sec * US_ONE_SECOND + tv.tv_usec;
return tv.tv_sec * usOneSecond + tv.tv_usec;
}
std::string SetAnonyId(const std::string &message)