mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2025-02-26 06:18:10 +00:00
update tests/core/transmission/trans_channel/udp_negotiation/trans_udp_nego_test.cpp.
Signed-off-by: 张再尧 <zhangzaiyao@huawei.com>
This commit is contained in:
parent
394ed37b58
commit
dc28e22c6e
@ -84,10 +84,9 @@ char* TestGetMsgInfo(void)
|
||||
*/
|
||||
HWTEST_F(TransUdpNegoTest, TransUdpNegoTest001, TestSize.Level1)
|
||||
{
|
||||
int32_t ret;
|
||||
int32_t errCode = 0;
|
||||
string msgStr = "ProcessMessage";
|
||||
ret = TransUnpackReplyErrInfo(NULL, NULL);
|
||||
int32_t ret = TransUnpackReplyErrInfo(NULL, NULL);
|
||||
EXPECT_TRUE(ret != SOFTBUS_OK);
|
||||
cJSON *msg = cJSON_Parse((char *)msgStr.c_str());
|
||||
ret = TransUnpackReplyErrInfo(msg, &errCode);
|
||||
@ -103,13 +102,12 @@ HWTEST_F(TransUdpNegoTest, TransUdpNegoTest001, TestSize.Level1)
|
||||
*/
|
||||
HWTEST_F(TransUdpNegoTest, TransUdpNegoTest002, TestSize.Level1)
|
||||
{
|
||||
int32_t ret;
|
||||
int32_t errCode = 0;
|
||||
string msgStr = "ProcessMessage";
|
||||
cJSON *msg = cJSON_Parse((char *)msgStr.c_str());
|
||||
const char* errDesc = "errDesc";
|
||||
|
||||
ret = TransPackReplyErrInfo(NULL, errCode, NULL);
|
||||
int32_t ret = TransPackReplyErrInfo(NULL, errCode, NULL);
|
||||
EXPECT_TRUE(ret != SOFTBUS_OK);
|
||||
|
||||
ret = TransPackReplyErrInfo(msg, errCode, errDesc);
|
||||
@ -125,13 +123,12 @@ HWTEST_F(TransUdpNegoTest, TransUdpNegoTest002, TestSize.Level1)
|
||||
*/
|
||||
HWTEST_F(TransUdpNegoTest, TransUdpNegoTest003, TestSize.Level1)
|
||||
{
|
||||
int32_t ret;
|
||||
int64_t authId = AUTH_INVALID_ID;
|
||||
int64_t seq = 0;
|
||||
string msg = "ProcessMessage";
|
||||
cJSON *replyMsg = cJSON_Parse((char *)msg.c_str());
|
||||
|
||||
ret = sendUdpInfo(NULL, authId, seq);
|
||||
int32_t ret = sendUdpInfo(NULL, authId, seq);
|
||||
EXPECT_TRUE(ret != SOFTBUS_OK);
|
||||
|
||||
ret = sendUdpInfo(replyMsg, NULL, NULL);
|
||||
@ -147,10 +144,9 @@ HWTEST_F(TransUdpNegoTest, TransUdpNegoTest003, TestSize.Level1)
|
||||
*/
|
||||
HWTEST_F(TransUdpNegoTest, TransUdpNegoTest004, TestSize.Level1)
|
||||
{
|
||||
int32_t ret;
|
||||
int32_t errCode = 0;
|
||||
string errDesc = "ProcessMessage";
|
||||
ret = SendReplyErrInfo(errCode, NULL, NULL, NULL);
|
||||
int32_t ret = SendReplyErrInfo(errCode, NULL, NULL, NULL);
|
||||
EXPECT_TRUE(ret != SOFTBUS_OK);
|
||||
|
||||
ret = SendReplyErrInfo(errCode, (char *)errDesc.c_str(), NULL, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user