From ab06426e824b159c383596fb47dba5bf8936e257 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Fri, 22 Dec 2023 15:10:40 +0800 Subject: [PATCH] add Signed-off-by: hwzhangchuang --- common/test/mock/session_mock.cpp | 2 +- common/test/mock/socket_mock.cpp | 2 +- common/test/mock/softbus_bus_center_mock.cpp | 2 +- .../transportbase/src/distributed_input_transport_base.cpp | 6 +++--- .../transbaseunittest/distributed_input_transbase_test.cpp | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/common/test/mock/session_mock.cpp b/common/test/mock/session_mock.cpp index 566edce..24199c4 100644 --- a/common/test/mock/session_mock.cpp +++ b/common/test/mock/session_mock.cpp @@ -18,7 +18,7 @@ #include #include "securec.h" -#include "session_mock.h" +#include "session.h" constexpr int32_t DH_SUCCESS = 0; const uint32_t AUTH_SESSION_SIDE_CLIENT = 1; diff --git a/common/test/mock/socket_mock.cpp b/common/test/mock/socket_mock.cpp index 742c8c7..b743e28 100644 --- a/common/test/mock/socket_mock.cpp +++ b/common/test/mock/socket_mock.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "socket_mock.h" +#include "socket.h" int32_t Socket(SocketInfo info) { diff --git a/common/test/mock/softbus_bus_center_mock.cpp b/common/test/mock/softbus_bus_center_mock.cpp index 57b9439..c65b40f 100644 --- a/common/test/mock/softbus_bus_center_mock.cpp +++ b/common/test/mock/softbus_bus_center_mock.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "softbus_bus_center_mock.h" +#include "softbus_bus_center.h" constexpr int32_t DH_SUCCESS = 0; int32_t GetLocalNodeDeviceInfo(const char *pkgName, NodeBasicInfo *info) diff --git a/services/transportbase/src/distributed_input_transport_base.cpp b/services/transportbase/src/distributed_input_transport_base.cpp index 29480d5..f1839cc 100644 --- a/services/transportbase/src/distributed_input_transport_base.cpp +++ b/services/transportbase/src/distributed_input_transport_base.cpp @@ -257,7 +257,7 @@ int32_t DistributedInputTransportBase::StartSession(const std::string &remoteDev PeerSocketInfo peerSocketInfo = { .name = const_cast(peerSessionName.c_str()), - .deviceId = const_cast(remoteDevId.c_str()), + .networkId = const_cast(remoteDevId.c_str()), .pkgName = const_cast(DINPUT_PKG_NAME.c_str()), .dataType = DATA_TYPE_BYTES }; @@ -376,11 +376,11 @@ void DistributedInputTransportBase::EraseSessionId(const std::string &remoteDevI int32_t DistributedInputTransportBase::OnSessionOpened(int32_t sessionId, PeerSocketInfo info) { DHLOGI("OnSessionOpened, socket: %d, peerSocketName: %s, peerNetworkId: %s, peerPkgName: %s", - sessionId, info.name, info.deviceId, info.pkgName); + sessionId, info.name, info.networkId, info.pkgName); FinishAsyncTrace(DINPUT_HITRACE_LABEL, DINPUT_OPEN_SESSION_START, DINPUT_OPEN_SESSION_TASK); std::string peerDevId; - peerDevId.assign(info.deviceId); + peerDevId.assign(info.networkId); { std::unique_lock sessionLock(operationMutex_); remoteDevSessionMap_[peerDevId] = sessionId; diff --git a/services/transportbase/test/transbaseunittest/distributed_input_transbase_test.cpp b/services/transportbase/test/transbaseunittest/distributed_input_transbase_test.cpp index a931765..6096dd3 100644 --- a/services/transportbase/test/transbaseunittest/distributed_input_transbase_test.cpp +++ b/services/transportbase/test/transbaseunittest/distributed_input_transbase_test.cpp @@ -91,11 +91,10 @@ HWTEST_F(DistributedInputTransbaseTest, GetDevIdBySessionId01, testing::ext::Tes HWTEST_F(DistributedInputTransbaseTest, OnSessionOpened01, testing::ext::TestSize.Level0) { - int32_t sessionId = 0; PeerSocketInfo peerSocketInfo = { .name = const_cast(PEER_SESSION_NAME.c_str()), - .deviceId = const_cast(REMOTE_DEV_ID.c_str()), + .networkId = const_cast(REMOTE_DEV_ID.c_str()), .pkgName = const_cast(DINPUT_PKG_NAME_TEST.c_str()), .dataType = DATA_TYPE_BYTES };