mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2025-02-17 09:37:45 +00:00
!7959 fix:transmission ut crash
Merge pull request !7959 from xzh/2410081
This commit is contained in:
commit
5380b88bd5
@ -106,10 +106,9 @@ HWTEST_F(TransLinkListenerTest, OnWifiDirectDeviceOffLine002, TestSize.Level1)
|
||||
*/
|
||||
HWTEST_F(TransLinkListenerTest, OnWifiDirectRoleChange001, TestSize.Level1)
|
||||
{
|
||||
int32_t ret = TransChannelInit();
|
||||
int32_t ret = P2pDirectChannelInit();
|
||||
OnWifiDirectRoleChange(WIFI_DIRECT_ROLE_NONE, WIFI_DIRECT_ROLE_NONE);
|
||||
EXPECT_NE(SOFTBUS_OK, ret);
|
||||
TransChannelDeinit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -106,6 +106,19 @@ AppInfo *TestSetAppInfo()
|
||||
appInfo->crc = APP_INFO_FILE_FEATURES_SUPPORT;
|
||||
return appInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: P2pDirectChannelInitTest001
|
||||
* @tc.desc: P2pDirectChannelInit, use the wrong parameter.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require:
|
||||
*/
|
||||
HWTEST_F(TransTcpDirectMessageTest, P2pDirectChannelInitTest001, TestSize.Level1)
|
||||
{
|
||||
int32_t ret = P2pDirectChannelInit();
|
||||
EXPECT_EQ(ret, SOFTBUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: OpenP2pDirectChannelTest001
|
||||
* @tc.desc: OpenP2pDirectChannel, use the wrong parameter.
|
||||
@ -155,18 +168,6 @@ HWTEST_F(TransTcpDirectMessageTest, OpenP2pDirectChannelTest001, TestSize.Level1
|
||||
SoftBusFree(connInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: P2pDirectChannelInitTest002
|
||||
* @tc.desc: P2pDirectChannelInit, use the wrong parameter.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require:
|
||||
*/
|
||||
HWTEST_F(TransTcpDirectMessageTest, P2pDirectChannelInitTest002, TestSize.Level1)
|
||||
{
|
||||
int32_t ret = P2pDirectChannelInit();
|
||||
EXPECT_EQ(ret, SOFTBUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: GenerateTdcChannelIdTest003
|
||||
* @tc.desc: GenerateTdcChannelId, use the wrong parameter.
|
||||
|
@ -237,6 +237,18 @@ HWTEST_F(TransTcpDirectP2pTest, NotifyP2pSessionConnClearTest001, TestSize.Level
|
||||
SoftBusFree(testsessionConnList);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: P2pDirectChannelInitTest001
|
||||
* @tc.desc: P2pDirectChannelInit, use the wrong parameter.
|
||||
* @tc.type: FUNC
|
||||
* @tc.require:
|
||||
*/
|
||||
HWTEST_F(TransTcpDirectP2pTest, P2pDirectChannelInitTest001, TestSize.Level1)
|
||||
{
|
||||
int32_t ret = CreateP2pListenerList();
|
||||
EXPECT_EQ(ret, SOFTBUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: StartP2pListenerTest001
|
||||
* @tc.desc: StartP2pListener, use the wrong parameter.
|
||||
@ -250,10 +262,10 @@ HWTEST_F(TransTcpDirectP2pTest, StartP2pListenerTest001, TestSize.Level1)
|
||||
EXPECT_EQ(ret, SOFTBUS_INVALID_PARAM);
|
||||
|
||||
ret = StartP2pListener(g_ip, &g_port, g_uuid);
|
||||
EXPECT_EQ(ret, SOFTBUS_LOCK_ERR);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_TDC_START_SESSION_LISTENER_FAILED);
|
||||
|
||||
ret = StartP2pListener(g_ip, &g_port, g_uuid);
|
||||
EXPECT_EQ(ret, SOFTBUS_LOCK_ERR);
|
||||
EXPECT_EQ(ret, SOFTBUS_TRANS_TDC_START_SESSION_LISTENER_FAILED);
|
||||
|
||||
int32_t channelId = 1;
|
||||
int32_t errCode = SOFTBUS_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user