mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-24 01:09:51 +00:00
ut failed
Signed-off-by: xzh457 <xiaozihan4@h-partners.com> Change-Id: I97c29d39c86dcab59103595f9c48f374c5a8ea60
This commit is contained in:
parent
89bb9e80d1
commit
51c585212c
@ -471,6 +471,6 @@ HWTEST_F(TransClientProxyTest, CheckServiceIsRegisteredTest001, TestSize.Level0)
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
|
||||
ret = CheckServiceIsRegistered(g_pkgName, TEST_PID);
|
||||
EXPECT_EQ(SOFTBUS_TRANS_GET_CLIENT_PROXY_NULL, ret);
|
||||
EXPECT_EQ(SOFTBUS_OK, ret);
|
||||
}
|
||||
} // namespace OHOS
|
||||
|
@ -103,7 +103,7 @@ HWTEST_F(TransSessionServiceTest, TransSessionServiceTest02, TestSize.Level1)
|
||||
ret = TransSessionServerAddItem(sessionServer);
|
||||
EXPECT_EQ(ret, SOFTBUS_OK);
|
||||
ret = TransCreateSessionServer(g_pkgName, g_sessionName, TRANS_TEST_INVALID_UID, TRANS_TEST_INVALID_PID);
|
||||
EXPECT_EQ(ret, SOFTBUS_SERVER_NAME_USED);
|
||||
EXPECT_EQ(ret, SOFTBUS_OK);
|
||||
ret = TransSessionServerDelItem(g_sessionName);
|
||||
EXPECT_EQ(ret, SOFTBUS_OK);
|
||||
}
|
||||
|
@ -788,7 +788,7 @@ HWTEST_F(TransChannelManagerTest, GetAuthAppInfo005, TestSize.Level1)
|
||||
HWTEST_F(TransChannelManagerTest, TransGetAndComparePid001, TestSize.Level1)
|
||||
{
|
||||
int32_t ret = TransGetAndComparePid(TRANS_TEST_PID, 1, CHANNEL_TYPE_TCP_DIRECT);
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
EXPECT_EQ(SOFTBUS_TRANS_INVALID_CHANNEL_ID, ret);
|
||||
ret = TransGetAndComparePid(TRANS_TEST_PID, 1, CHANNEL_TYPE_AUTH);
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
}
|
||||
|
@ -100,6 +100,11 @@ ohos_unittest("TransServerTcpDirectTest") {
|
||||
}
|
||||
|
||||
ohos_unittest("TransCoreTcpDirectTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "unittest/trans_core_tcp_direct_test.cpp" ]
|
||||
|
||||
|
@ -1853,7 +1853,7 @@ HWTEST_F(TransTcpDirectMessageAppendTest, OpenDataBusRequestTest002, TestSize.Le
|
||||
EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM);
|
||||
EXPECT_CALL(TcpMessageMock, UnpackRequest).WillOnce(Return(SOFTBUS_OK));
|
||||
ret = OpenDataBusRequest(channelId, flags, seq, reply);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_GET_P2P_INFO_FAILED);
|
||||
EXPECT_EQ(ret, SOFTBUS_PERMISSION_SERVER_DENIED);
|
||||
flags = FLAG_AUTH_META;
|
||||
channelId = TEST_NEW_CHANNEL_ID;
|
||||
EXPECT_CALL(TcpMessageMock, UnpackRequest).WillOnce(Return(SOFTBUS_OK));
|
||||
|
@ -18,6 +18,11 @@ import("../../../../sdk/frame/frame_sdk.gni")
|
||||
module_output_path = "dsoftbus/transmission"
|
||||
|
||||
ohos_unittest("SoftBusFrameStandardTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "softbus_frame_standard_test.cpp" ]
|
||||
|
||||
|
@ -17,6 +17,11 @@ import("../../../../dsoftbus.gni")
|
||||
module_output_path = "dsoftbus/transmission"
|
||||
|
||||
ohos_unittest("TransIpcStandardTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
|
||||
sources = [ "trans_ipc_test.cpp" ]
|
||||
|
@ -314,11 +314,11 @@ HWTEST_F(TransIpcStandardTest, QosReportTest001, TestSize.Level0)
|
||||
int32_t appType = 0;
|
||||
int32_t quality = QOS_IMPROVE;
|
||||
int32_t ret = transServerProxy.QosReport(channelId, channelType, appType, quality);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_NODE_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_ACCESS_TOKEN_DENIED);
|
||||
|
||||
channelId = INVALID_VALUE;
|
||||
ret = transServerProxy.QosReport(channelId, channelType, appType, quality);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_NODE_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_ACCESS_TOKEN_DENIED);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -341,7 +341,7 @@ HWTEST_F(TransIpcStandardTest, StreamStatsTest001, TestSize.Level0)
|
||||
|
||||
channelId = INVALID_VALUE;
|
||||
ret = transServerProxy.StreamStats(channelId, channelType, statsData);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_NODE_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
SoftBusFree(statsData);
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ HWTEST_F(TransIpcStandardTest, RippleStatsTest0011, TestSize.Level0)
|
||||
|
||||
channelId = INVALID_VALUE;
|
||||
ret = transServerProxy.RippleStats(channelId, channelType, statsData);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_NODE_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_ACCESS_TOKEN_DENIED);
|
||||
SoftBusFree(statsData);
|
||||
}
|
||||
|
||||
@ -382,7 +382,7 @@ HWTEST_F(TransIpcStandardTest, GrantPermissionTest001, TestSize.Level0)
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_PROXY_WRITECSTRING_FAILED);
|
||||
|
||||
ret = transServerProxy.GrantPermission(UUID, PID, g_sessionName);
|
||||
EXPECT_EQ(SOFTBUS_PERMISSION_DENIED, ret);
|
||||
EXPECT_EQ(SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED, ret);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -395,10 +395,10 @@ HWTEST_F(TransIpcStandardTest, RemovePermissionTest001, TestSize.Level0)
|
||||
{
|
||||
TransServerProxy transServerProxy(nullptr);
|
||||
int32_t ret = transServerProxy.RemovePermission(g_sessionName);
|
||||
EXPECT_EQ(ret, SOFTBUS_PERMISSION_DENIED);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
|
||||
ret = transServerProxy.RemovePermission(g_sessionName);
|
||||
EXPECT_EQ(ret, SOFTBUS_PERMISSION_DENIED);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -641,13 +641,13 @@ HWTEST_F(TransIpcStandardTest, ServerIpcQosReportTest001, TestSize.Level0)
|
||||
int32_t appType = 0;
|
||||
int32_t quality = QOS_IMPROVE;
|
||||
int32_t ret = ServerIpcQosReport(channelId, chanType, appType, quality);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_NODE_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_ACCESS_TOKEN_DENIED);
|
||||
|
||||
ret = TransServerProxyInit();
|
||||
ASSERT_EQ(ret, SOFTBUS_OK);
|
||||
|
||||
ret = ServerIpcQosReport(channelId, chanType, appType, quality);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_NODE_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_ACCESS_TOKEN_DENIED);
|
||||
|
||||
TransClientDeinit();
|
||||
}
|
||||
@ -716,7 +716,7 @@ HWTEST_F(TransIpcStandardTest, ServerIpcGrantPermissionTest001, TestSize.Level0)
|
||||
EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM);
|
||||
|
||||
ret = ServerIpcGrantPermission(uid, pid, g_sessionName);
|
||||
EXPECT_EQ(ret, SOFTBUS_PERMISSION_DENIED);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
|
||||
TransClientDeinit();
|
||||
}
|
||||
@ -739,7 +739,7 @@ HWTEST_F(TransIpcStandardTest, ServerIpcRemovePermissionTest001, TestSize.Level0
|
||||
EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM);
|
||||
|
||||
ret = ServerIpcRemovePermission(g_sessionName);
|
||||
EXPECT_EQ(ret, SOFTBUS_PERMISSION_DENIED);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
|
||||
TransClientDeinit();
|
||||
}
|
||||
@ -767,7 +767,7 @@ HWTEST_F(TransIpcStandardTest, ServerIpcEvaluateQosTest001, TestSize.Level0)
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
|
||||
ret = ServerIpcEvaluateQos(g_peerNetworkId, type, qos, qosCount);
|
||||
EXPECT_EQ(SOFTBUS_NETWORK_NODE_OFFLINE, ret);
|
||||
EXPECT_EQ(SOFTBUS_ACCESS_TOKEN_DENIED, ret);
|
||||
SoftBusFree(qos);
|
||||
qos = nullptr;
|
||||
ASSERT_TRUE(qos == nullptr);
|
||||
|
@ -56,9 +56,9 @@ HWTEST_F(ClientTransSocketTest, DBinderGrantPermissionTest001, TestSize.Level1)
|
||||
ASSERT_GT(pid, 0);
|
||||
std::string socketName = "DBinder" + std::to_string(uid) + std::string("_") + std::to_string(pid);
|
||||
auto ret = DBinderGrantPermission(uid, pid, socketName.c_str());
|
||||
ASSERT_EQ(ret, SOFTBUS_OK);
|
||||
ASSERT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
ret = DBinderRemovePermission(socketName.c_str());
|
||||
ASSERT_EQ(ret, SOFTBUS_OK);
|
||||
ASSERT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -76,7 +76,7 @@ HWTEST_F(ClientTransSocketTest, DBinderGrantPermissionTest002, TestSize.Level1)
|
||||
ASSERT_GT(pid, 0);
|
||||
std::string socketName = "DBinder" + std::to_string(uid) + std::string("_") + std::to_string(pid);
|
||||
auto ret = DBinderGrantPermission(uid, pid, socketName.c_str());
|
||||
ASSERT_EQ(ret, SOFTBUS_PERMISSION_DENIED);
|
||||
ASSERT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -94,9 +94,9 @@ HWTEST_F(ClientTransSocketTest, DBinderRemovePermissionTest001, TestSize.Level1)
|
||||
ASSERT_GT(pid, 0);
|
||||
std::string socketName = "DBinder" + std::to_string(uid) + std::string("_") + std::to_string(pid);
|
||||
auto ret = DBinderGrantPermission(uid, pid, socketName.c_str());
|
||||
ASSERT_EQ(ret, SOFTBUS_OK);
|
||||
ASSERT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
CounterfeitProcess("msdp");
|
||||
ret = DBinderRemovePermission(socketName.c_str());
|
||||
ASSERT_EQ(ret, SOFTBUS_PERMISSION_DENIED);
|
||||
ASSERT_EQ(ret, SOFTBUS_TRANS_PROXY_SEND_REQUEST_FAILED);
|
||||
}
|
||||
} // namespace OHOS
|
||||
|
@ -279,7 +279,7 @@ HWTEST_F(TransClientMsgServiceTest, TransClientMsgServiceTest02, TestSize.Level1
|
||||
g_sessionName, CHANNEL_TYPE_AUTH, BUSINESS_TYPE_NOT_CARE, false, ENABLE_STATUS_SUCCESS);
|
||||
ASSERT_GT(sessionId, 0);
|
||||
ret = SendBytes(sessionId, TRANS_TEST_AUTH_DATA, (unsigned int)strlen(TRANS_TEST_AUTH_DATA));
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_AUTH_CHANNEL_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_PERMISSION_DENIED);
|
||||
DeleteSessionServerAndSession(g_sessionName, sessionId);
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ HWTEST_F(TransClientMsgServiceTest, TransClientMsgServiceTest03, TestSize.Level1
|
||||
g_sessionName, CHANNEL_TYPE_AUTH, BUSINESS_TYPE_NOT_CARE, false, ENABLE_STATUS_SUCCESS);
|
||||
ASSERT_GT(sessionId, 0);
|
||||
ret = SendMessage(sessionId, TRANS_TEST_AUTH_DATA, (unsigned int)strlen(TRANS_TEST_AUTH_DATA));
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_AUTH_CHANNEL_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_PERMISSION_DENIED);
|
||||
DeleteSessionServerAndSession(g_sessionName, sessionId);
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,7 @@ HWTEST_F(TransClientSessionServiceTest, TransClientSessionServiceTest02, TestSiz
|
||||
ret = ClientGetSessionIdByChannelId(TRANS_TEST_CHANNEL_ID, CHANNEL_TYPE_UDP, &sessionId, isClosing);
|
||||
EXPECT_EQ(ret, SOFTBUS_OK);
|
||||
ret = QosReport(sessionId, APP_TYPE_AUTH, QOS_IMPROVE);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_NODE_NOT_FOUND);
|
||||
EXPECT_EQ(ret, SOFTBUS_ACCESS_TOKEN_DENIED);
|
||||
ret = ClientDeleteSessionServer(SEC_TYPE_PLAINTEXT, g_sessionName);
|
||||
EXPECT_EQ(ret, SOFTBUS_OK);
|
||||
SoftBusFree(sessionParam);
|
||||
|
@ -191,7 +191,7 @@ HWTEST_F(TransClientSocketServiceTest, DataType001, TestSize.Level1)
|
||||
for (int32_t type = DATA_TYPE_MESSAGE; type < DATA_TYPE_BUTT; type++) {
|
||||
info.dataType = static_cast<TransDataType>(type);
|
||||
int32_t socketId = Socket(info);
|
||||
EXPECT_EQ(socketId, SOFTBUS_ACCESS_TOKEN_DENIED);
|
||||
EXPECT_EQ(socketId, SOFTBUS_TRANS_SESSION_ADDPKG_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,6 +156,11 @@ if (defined(ohos_lite)) {
|
||||
|
||||
module_output_path = "dsoftbus/transmission"
|
||||
ohos_unittest("ClientTransUdpManagerTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "udp/common/client_trans_udp_manager_test.cpp" ]
|
||||
include_dirs = trans_sdk_test_common_inc
|
||||
@ -209,6 +214,11 @@ if (defined(ohos_lite)) {
|
||||
|
||||
module_output_path = "dsoftbus/transmission"
|
||||
ohos_unittest("ClientTransProxyFileManagerTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "proxy/client_trans_proxy_file_manager_test.cpp" ]
|
||||
include_dirs = trans_sdk_test_common_inc
|
||||
@ -267,6 +277,11 @@ if (defined(ohos_lite)) {
|
||||
|
||||
module_output_path = "dsoftbus/transmission"
|
||||
ohos_unittest("ClientTransChannelManagerTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "manager/client_trans_channel_manager_test.cpp" ]
|
||||
include_dirs = trans_sdk_test_common_inc
|
||||
@ -288,6 +303,11 @@ if (defined(ohos_lite)) {
|
||||
|
||||
module_output_path = "dsoftbus/transmission"
|
||||
ohos_unittest("ClientTransChannelCallbackTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "manager/client_trans_channel_callback_test.cpp" ]
|
||||
include_dirs = trans_sdk_test_common_inc
|
||||
@ -331,6 +351,11 @@ if (defined(ohos_lite)) {
|
||||
}
|
||||
|
||||
ohos_unittest("ClientTransUdpStreamInterfaceTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "udp/stream/client_trans_udp_stream_interface_test.cpp" ]
|
||||
include_dirs = trans_udp_channel_sdk_inc
|
||||
|
@ -139,7 +139,7 @@ HWTEST_F(ClientTransChannelManagerTest, ClientTransChannelSendBytesTest001, Test
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
|
||||
ret = ClientTransChannelSendBytes(channelId, CHANNEL_TYPE_AUTH, data, TEST_DATA_LENGTH);
|
||||
EXPECT_EQ(SOFTBUS_TRANS_AUTH_CHANNEL_NOT_FOUND, ret);
|
||||
EXPECT_EQ(SOFTBUS_PERMISSION_DENIED, ret);
|
||||
|
||||
ret = ClientTransChannelSendBytes(channelId, CHANNEL_TYPE_PROXY, data, TEST_DATA_LENGTH);
|
||||
EXPECT_EQ(SOFTBUS_TRANS_PROXY_CHANNEL_NOT_FOUND, ret);
|
||||
@ -169,7 +169,7 @@ HWTEST_F(ClientTransChannelManagerTest, ClientTransChannelSendMessageTest001, Te
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
|
||||
ret = ClientTransChannelSendMessage(channelId, CHANNEL_TYPE_AUTH, data, TEST_DATA_LENGTH);
|
||||
EXPECT_EQ(SOFTBUS_TRANS_AUTH_CHANNEL_NOT_FOUND, ret);
|
||||
EXPECT_EQ(SOFTBUS_PERMISSION_DENIED, ret);
|
||||
|
||||
ret = ClientTransChannelSendMessage(channelId, CHANNEL_TYPE_PROXY, data, TEST_DATA_LENGTH);
|
||||
EXPECT_EQ(SOFTBUS_TRANS_PROXY_CHANNEL_NOT_FOUND, ret);
|
||||
|
@ -443,7 +443,7 @@ HWTEST_F(ClientTransProxyFileManagerTest, ClinetTransProxyCreateSendListenerInfo
|
||||
SessionEnableStatus isEnabled = ENABLE_STATUS_INIT;
|
||||
|
||||
ret = ClientAddSession(&g_param, &sessionId, &isEnabled);
|
||||
ASSERT_EQ(SOFTBUS_TRANS_SESSION_SERVER_NOINIT, ret);
|
||||
ASSERT_EQ(SOFTBUS_OK, ret);
|
||||
|
||||
SendListenerInfo *sendListenerInfo;
|
||||
ret = CreateSendListenerInfo(&sendListenerInfo, TEST_CHANNEL_ID, 0);
|
||||
@ -1682,12 +1682,12 @@ HWTEST_F(ClientTransProxyFileManagerTest, ClinetTransProxyFileAckReqAndResDataTe
|
||||
EXPECT_EQ(SOFTBUS_INVALID_DATA_HEAD, ret);
|
||||
|
||||
dataTest = FILE_MAGIC_NUMBER;
|
||||
frame.data = (uint8_t *)"00010010datatest.txt";
|
||||
frame.data = (uint8_t *)&dataTest;
|
||||
ret = UnpackAckReqAndResData(&frame, &startSeq, &value);
|
||||
EXPECT_EQ(SOFTBUS_INVALID_DATA_HEAD, ret);
|
||||
EXPECT_EQ(SOFTBUS_OK, ret);
|
||||
|
||||
ret = UnpackAckReqAndResData(&frame, &startSeq, &value);
|
||||
EXPECT_NE(SOFTBUS_OK, ret);
|
||||
EXPECT_EQ(SOFTBUS_OK, ret);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,38 +68,45 @@ char g_sessionKey[32] = "1234567812345678123456781234567";
|
||||
|
||||
int32_t TransOnSessionOpened(const char *sessionName, const ChannelInfo *channel, SessionType flag)
|
||||
{
|
||||
std::cout << "111111111111" << std::endl;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransOnSessionClosed(int32_t channelId, int32_t channelType, ShutdownReason reason)
|
||||
{
|
||||
std::cout << "22222222222" << std::endl;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransOnSessionOpenFailed(int32_t channelId, int32_t channelType, int32_t errCode)
|
||||
{
|
||||
std::cout << "3333333333333" << std::endl;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransOnBytesReceived(int32_t channelId, int32_t channelType,
|
||||
const void *data, uint32_t len, SessionPktType type)
|
||||
{
|
||||
std::cout << "4444444444444" << std::endl;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransOnOnStreamRecevied(int32_t channelId, int32_t channelType,
|
||||
const StreamData *data, const StreamData *ext, const StreamFrameInfo *param)
|
||||
{
|
||||
std::cout << "55555555555555" << std::endl;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t TransOnGetSessionId(int32_t channelId, int32_t channelType, int32_t *sessionId)
|
||||
{
|
||||
std::cout << "66666666666666" << std::endl;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
int32_t TransOnQosEvent(int32_t channelId, int32_t channelType, int32_t eventId,
|
||||
int32_t tvCount, const QosTv *tvList)
|
||||
{
|
||||
std::cout << "7777777777777777" << std::endl;
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ HWTEST_F(TransQosStatClientTest, QosStatClientTest002, TestSize.Level0)
|
||||
NodeBasicInfo *info;
|
||||
int32_t infoNum;
|
||||
ret = GetAllNodeDeviceInfo(UDP_TEST_PKG_NAME, &info, &infoNum);
|
||||
EXPECT_EQ(ret, SOFTBUS_IPC_ERR);
|
||||
EXPECT_EQ(ret, SOFTBUS_NETWORK_NOT_INIT);
|
||||
SessionAttribute attr = {0};
|
||||
attr.dataType = TYPE_STREAM;
|
||||
attr.attr.streamAttr.streamType = RAW_STREAM;
|
||||
@ -160,7 +160,7 @@ HWTEST_F(TransQosStatClientTest, QosStatClientTest003, TestSize.Level0)
|
||||
NodeBasicInfo *info;
|
||||
int32_t infoNum;
|
||||
ret = GetAllNodeDeviceInfo(UDP_TEST_PKG_NAME, &info, &infoNum);
|
||||
EXPECT_EQ(ret, SOFTBUS_IPC_ERR);
|
||||
EXPECT_EQ(ret, SOFTBUS_NETWORK_NOT_INIT);
|
||||
SessionAttribute attr = {0};
|
||||
attr.dataType = TYPE_STREAM;
|
||||
attr.attr.streamAttr.streamType = RAW_STREAM;
|
||||
@ -209,7 +209,7 @@ HWTEST_F(TransQosStatClientTest, QosStatClientTest004, TestSize.Level0)
|
||||
NodeBasicInfo *info;
|
||||
int32_t infoNum;
|
||||
ret = GetAllNodeDeviceInfo(UDP_TEST_PKG_NAME, &info, &infoNum);
|
||||
EXPECT_EQ(ret, SOFTBUS_IPC_ERR);
|
||||
EXPECT_EQ(ret, SOFTBUS_NETWORK_NOT_INIT);
|
||||
SessionAttribute attr = {0};
|
||||
attr.dataType = TYPE_STREAM;
|
||||
attr.attr.streamAttr.streamType = RAW_STREAM;
|
||||
@ -263,7 +263,7 @@ HWTEST_F(TransQosStatClientTest, QosStatClientTest005, TestSize.Level0)
|
||||
NodeBasicInfo *info;
|
||||
int32_t infoNum;
|
||||
ret = GetAllNodeDeviceInfo(UDP_TEST_PKG_NAME, &info, &infoNum);
|
||||
EXPECT_EQ(ret, SOFTBUS_IPC_ERR);
|
||||
EXPECT_EQ(ret, SOFTBUS_NETWORK_NOT_INIT);
|
||||
SessionAttribute attr = {0};
|
||||
attr.dataType = TYPE_STREAM;
|
||||
attr.attr.streamAttr.streamType = RAW_STREAM;
|
||||
@ -324,7 +324,7 @@ HWTEST_F(TransQosStatClientTest, QosStatClientTest006, TestSize.Level0)
|
||||
NodeBasicInfo *info;
|
||||
int32_t infoNum;
|
||||
ret = GetAllNodeDeviceInfo(UDP_TEST_PKG_NAME, &info, &infoNum);
|
||||
EXPECT_EQ(ret, SOFTBUS_IPC_ERR);
|
||||
EXPECT_EQ(ret, SOFTBUS_NETWORK_NOT_INIT);
|
||||
SessionAttribute attr = {0};
|
||||
attr.dataType = TYPE_STREAM;
|
||||
attr.attr.streamAttr.streamType = RAW_STREAM;
|
||||
|
@ -19,6 +19,11 @@ dsoftbus_root_path = "../../../../.."
|
||||
softbus_adapter_config = "${dsoftbus_root_path}/adapter/default_config"
|
||||
|
||||
ohos_unittest("TransSdkTcpDirectTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "trans_sdk_tcp_direct_test.cpp" ]
|
||||
|
||||
|
@ -365,7 +365,7 @@ HWTEST_F(TransTcpDirectTest, TransClientGetTdcDataBufByChannelTest001, TestSize.
|
||||
EXPECT_EQ(SOFTBUS_INVALID_PARAM, ret);
|
||||
|
||||
ret = TransClientGetTdcDataBufByChannel(channelId, &fd, &len);
|
||||
EXPECT_EQ(SOFTBUS_NO_INIT, ret);
|
||||
EXPECT_EQ(SOFTBUS_TRANS_TDC_CHANNEL_NOT_FOUND, ret);
|
||||
|
||||
ret = TransDataListInit();
|
||||
EXPECT_EQ(SOFTBUS_OK, ret);
|
||||
|
@ -19,6 +19,11 @@ dsoftbus_root_path = "../../../../../../../.."
|
||||
|
||||
## UnitTest VtpInstanceTest {{{
|
||||
ohos_unittest("VtpInstanceTest") {
|
||||
sanitize = {
|
||||
cfi = true
|
||||
cfi_cross_dso = true
|
||||
debug = false
|
||||
}
|
||||
module_out_path = module_output_path
|
||||
sources = [ "vtp_instance_test.cpp" ]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user