mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-19 17:43:35 -04:00
Description:fix reviewBot
Match-id-a4b335a9097c3be750f174234819597a7d5b4b1d
This commit is contained in:
@@ -178,7 +178,7 @@ int32_t WhiteListUtil::GetWhiteList(const std::string &deviceId, TYPE_WHITE_LIST
|
||||
DHLOGI("start, deviceId=%s", GetAnonyString(deviceId).c_str());
|
||||
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
TYPE_DEVICE_WHITE_LIST_MAP::iterator iter = mapDeviceWhiteList_.find(deviceId);
|
||||
TYPE_DEVICE_WHITE_LIST_MAP::const_iterator iter = mapDeviceWhiteList_.find(deviceId);
|
||||
if (iter != mapDeviceWhiteList_.end()) {
|
||||
vecWhiteList = iter->second;
|
||||
DHLOGI("GetWhiteList success, deviceId=%s", GetAnonyString(deviceId).c_str());
|
||||
|
||||
@@ -44,6 +44,8 @@ void DistributedInputInnerTest::TestPrepareDInputCallback::OnResult(
|
||||
const std::string& deviceId, const int32_t& status)
|
||||
|
||||
{
|
||||
(void)deviceId;
|
||||
(void)status;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,6 +53,8 @@ void DistributedInputInnerTest::TestUnprepareDInputCallback::OnResult(
|
||||
const std::string& deviceId, const int32_t& status)
|
||||
|
||||
{
|
||||
(void)deviceId;
|
||||
(void)status;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -301,4 +305,4 @@ HWTEST_F(DistributedInputInnerTest, IsStartDistributedInput2, testing::ext::Test
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-6
@@ -47,12 +47,6 @@ HWTEST_F(DistributedInputSinkManagerTest, Init01, testing::ext::TestSize.Level0)
|
||||
int32_t ret = sinkManager_->Init();
|
||||
EXPECT_EQ(SUCCESS, ret);
|
||||
}
|
||||
|
||||
HWTEST_F(DistributedInputSinkManagerTest, Release01, testing::ext::TestSize.Level0)
|
||||
{
|
||||
int32_t ret = sinkManager_->Release();
|
||||
EXPECT_EQ(SUCCESS, ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ void DistributedInputSourceTransport::OnBytesReceived(int32_t sessionId, const v
|
||||
return;
|
||||
}
|
||||
|
||||
std::string message = (char *)buf;
|
||||
std::string message(buf, buf + dataLen);
|
||||
DHLOGI("OnBytesReceived message:%s.", message.c_str());
|
||||
HandleSessionData(sessionId, message);
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ ohos_unittest("distributed_input_sourcetrans_test") {
|
||||
"${service_common}/include",
|
||||
"//third_party/json/include",
|
||||
"${services_source_path}/inputinject/include",
|
||||
"//foundation/distributedhardware/distributed_input/services/source/transport/test/sourcetransunittest/mock",
|
||||
"//foundation/communication/dsoftbus/interfaces/kits/transport",
|
||||
]
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ class TestRegisterInputCallback : public OHOS::DistributedHardware::RegisterCall
|
||||
TestRegisterInputCallback() = default;
|
||||
virtual ~TestRegisterInputCallback() = default;
|
||||
virtual int32_t OnRegisterResult(const std::string &devId, const std::string &dhId, int32_t status,
|
||||
const std::string &data) override {
|
||||
const std::string &data) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
@@ -48,7 +49,8 @@ public:
|
||||
TestUnregisterInputCallback() = default;
|
||||
virtual ~TestUnregisterInputCallback() = default;
|
||||
virtual int32_t OnUnregisterResult(const std::string &devId, const std::string &dhId, int32_t status,
|
||||
const std::string &data) override {
|
||||
const std::string &data) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -42,7 +42,11 @@ public OHOS::DistributedHardware::DistributedInput::PrepareDInputCallbackStub {
|
||||
public:
|
||||
TestPrepareDInputCallback() = default;
|
||||
virtual ~TestPrepareDInputCallback() = default;
|
||||
void OnResult(const std::string& deviceId, const int32_t& status) {};
|
||||
void OnResult(const std::string& deviceId, const int32_t& status) const
|
||||
{
|
||||
(void)deviceId;
|
||||
(void)status;
|
||||
};
|
||||
};
|
||||
|
||||
class TestUnprepareDInputCallback :
|
||||
@@ -50,13 +54,22 @@ public OHOS::DistributedHardware::DistributedInput::UnprepareDInputCallbackStub
|
||||
public:
|
||||
TestUnprepareDInputCallback() = default;
|
||||
virtual ~TestUnprepareDInputCallback() = default;
|
||||
void OnResult(const std::string& deviceId, const int32_t& status) {};
|
||||
void OnResult(const std::string& deviceId, const int32_t& status) const
|
||||
{
|
||||
(void)deviceId;
|
||||
(void)status;
|
||||
};
|
||||
};
|
||||
|
||||
class TestStartDInputCallback :
|
||||
public OHOS::DistributedHardware::DistributedInput::StartDInputCallbackStub {
|
||||
public:
|
||||
void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) {};
|
||||
void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) const
|
||||
{
|
||||
(void)devId;
|
||||
(void)inputTypes;
|
||||
(void)status;
|
||||
};
|
||||
};
|
||||
|
||||
class TestStopDInputCallback :
|
||||
@@ -64,7 +77,12 @@ public OHOS::DistributedHardware::DistributedInput::StopDInputCallbackStub {
|
||||
public:
|
||||
TestStopDInputCallback() = default;
|
||||
virtual ~TestStopDInputCallback() = default;
|
||||
void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) {};
|
||||
void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) const
|
||||
{
|
||||
(void)devId;
|
||||
(void)inputTypes;
|
||||
(void)status;
|
||||
};
|
||||
};
|
||||
|
||||
void PrepareInputFuzzTest(const uint8_t* data, size_t size)
|
||||
|
||||
Reference in New Issue
Block a user