Description:amend ut

Match-id-96eab370a549feabe5fc9eb647f33c690be05b75
This commit is contained in:
xxxx
2022-11-29 15:41:53 +08:00
parent b4f7e7690e
commit 4875b744ab
10 changed files with 13 additions and 50 deletions
@@ -81,7 +81,7 @@ HWTEST_F(DistributedInputCollectorTest, IsAllDevicesStoped02, testing::ext::Test
EXPECT_EQ(false, isStop);
}
HWTEST_F(DistributedInputCollectorTest, GetDeviceInfoByType, testing::ext::TestSize.Level1)
HWTEST_F(DistributedInputCollectorTest, GetDeviceInfoByType01, testing::ext::TestSize.Level1)
{
DistributedInputCollector::GetInstance().inputHub_ = nullptr;
uint32_t inputTypes = 1;
@@ -89,18 +89,6 @@ HWTEST_F(DistributedInputCollectorTest, GetDeviceInfoByType, testing::ext::TestS
DistributedInputCollector::GetInstance().GetDeviceInfoByType(inputTypes, deviceInfo);
EXPECT_EQ(0, deviceInfo.size());
}
HWTEST_F(DistributedInputCollectorTest, DistributedInputCollectorTest_001, testing::ext::TestSize.Level1)
{
DistributedInputCollector::GetInstance().StartCollectEventsThread();
std::vector<std::string> sharingDhIds = {"1ds56v18e1v21v8v1erv15r1v8r1j1ty8"};
std::vector<std::string> noSharingDhIds = {"1ds56v18e1v21v8v1erv15r1v8r1j1ty8"};
AffectDhIds dhIds {sharingDhIds, noSharingDhIds};
std::string mouseNodePath = "mouseNodePath_test";
std::string dhid = "dhid_test";
DistributedInputCollector::GetInstance().ReportDhIdSharingState(dhIds);
DistributedInputCollector::GetInstance().GetMouseNodePath(sharingDhIds, mouseNodePath, dhid);
}
} // namespace DistributedInput
} // namespace DistributedHardware
} // namespace OHOS
@@ -57,7 +57,7 @@ ohos_unittest("distributed_input_sinkmanager_test") {
"//drivers/peripheral/display/interfaces/include",
"//drivers/peripheral/base",
"//foundation/graphic/graphic_2d/utils/buffer_handle/export",
"${common_path}/mock",
"${common_path}/test/mock",
]
sources = [
@@ -70,8 +70,8 @@ ohos_unittest("distributed_input_sinkmanager_test") {
"//foundation/distributedhardware/distributed_input/services/sink/transport/src/distributed_input_sink_switch.cpp",
"//foundation/distributedhardware/distributed_input/services/sink/transport/src/distributed_input_sink_transport.cpp",
"distributed_input_sinkmanager_test.cpp",
"${common_path}/mock/session_mock.cpp",
"${common_path}/mock/softbus_bus_center_mock.cpp",
"${common_path}/test/mock/session_mock.cpp",
"${common_path}/test/mock/softbus_bus_center_mock.cpp",
]
cflags = [
@@ -42,15 +42,15 @@ ohos_unittest("distributed_input_sinktrans_test") {
"${dfx_utils_path}/include",
"${utils_path}/include",
"//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
"${common_path}/mock",
"${common_path}/test/mock",
]
sources = [
"//foundation/distributedhardware/distributed_input/services/sink/transport/src/distributed_input_sink_switch.cpp",
"//foundation/distributedhardware/distributed_input/services/sink/transport/src/distributed_input_sink_transport.cpp",
"distributed_input_sinktrans_test.cpp",
"${common_path}/mock/session_mock.cpp",
"${common_path}/mock/softbus_bus_center_mock.cpp",
"${common_path}/test/mock/session_mock.cpp",
"${common_path}/test/mock/softbus_bus_center_mock.cpp",
]
cflags = [
@@ -280,31 +280,6 @@ HWTEST_F(DistributedInputSourceInjectTest, GetDhIdsByInputType_001, testing::ext
EXPECT_EQ(DH_SUCCESS, ret);
}
HWTEST_F(DistributedInputSourceInjectTest, InputDeviceEventInject_001, testing::ext::TestSize.Level1)
{
std::shared_ptr<RawEvent> rawEvent = std::make_shared<RawEvent>();
DistributedInputInject::GetInstance().InputDeviceEventInject(rawEvent);
}
HWTEST_F(DistributedInputSourceInjectTest, SyncNodeOnlineInfo_001, testing::ext::TestSize.Level1)
{
std::string srcDevId = "networkidc08647073e02e7a78f09473aa122ff57fc81c00";
std::string sinkDevId = "umkyu1b165e1be98151891erbe8r91ev";
std::string sinkNodeId = "usb-hiusb-ehci-2.1/input1";
std::string sinkNodeDesc = "1ds56v18e1v21v8v1erv15r1v8r1j1ty8";
DistributedInputInject::GetInstance().SyncNodeOnlineInfo(srcDevId, sinkDevId, sinkNodeId, sinkNodeDesc);
}
HWTEST_F(DistributedInputSourceInjectTest, StartInjectThread_001, testing::ext::TestSize.Level1)
{
DistributedInputInject::GetInstance().StartInjectThread();
}
HWTEST_F(DistributedInputSourceInjectTest, StopInjectThread_001, testing::ext::TestSize.Level1)
{
DistributedInputInject::GetInstance().StopInjectThread();
}
HWTEST_F(DistributedInputSourceInjectTest, GenerateVirtualTouchScreenDHId_001, testing::ext::TestSize.Level1)
{
std::string ret = DistributedInputInject::GetInstance().GenerateVirtualTouchScreenDHId(1, 1860, 980);
@@ -54,7 +54,7 @@ ohos_unittest("distributed_input_sourcemanager_test") {
"${fwk_interfaces_path}/include",
"${fwk_interfaces_path}/include/ipc",
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"${common_path}/mock",
"${common_path}/test/mock",
]
sources = [
@@ -93,8 +93,8 @@ ohos_unittest("distributed_input_sourcemanager_test") {
"//foundation/distributedhardware/distributed_input/services/source/sourcemanager/src/distributed_input_source_sa_cli_mgr.cpp",
"//foundation/distributedhardware/distributed_input/services/source/transport/src/distributed_input_source_transport.cpp",
"distributed_input_sourcemanager_test.cpp",
"${common_path}/mock/session_mock.cpp",
"${common_path}/mock/softbus_bus_center_mock.cpp",
"${common_path}/test/mock/session_mock.cpp",
"${common_path}/test/mock/softbus_bus_center_mock.cpp",
]
cflags = [
@@ -48,14 +48,14 @@ ohos_unittest("distributed_input_sourcetrans_test") {
"${distributedinput_path}/inputdevicehandler/include",
"//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
"//base/notification/eventhandler/interfaces/inner_api",
"${common_path}/mock",
"${common_path}/test/mock",
]
sources = [
"//foundation/distributedhardware/distributed_input/services/source/transport/src/distributed_input_source_transport.cpp",
"distributed_input_sourcetrans_test.cpp",
"${common_path}/mock/session_mock.cpp",
"${common_path}/mock/softbus_bus_center_mock.cpp",
"${common_path}/test/mock/session_mock.cpp",
"${common_path}/test/mock/softbus_bus_center_mock.cpp",
]
cflags = [