mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-24 01:09:51 +00:00
!8125 modify p2p ut failed
Merge pull request !8125 from liwenqiang/master
This commit is contained in:
commit
f0360ca535
@ -53,8 +53,10 @@ public:
|
||||
*/
|
||||
HWTEST_F(P2pAdapterTest, IsWifiEnableTest, TestSize.Level1)
|
||||
{
|
||||
WifiDirectInterfaceMock mock;
|
||||
EXPECT_CALL(mock, IsWifiActive).WillOnce(Return(1));
|
||||
bool flag = P2pAdapter::IsWifiEnable();
|
||||
EXPECT_FALSE(flag);
|
||||
EXPECT_TRUE(flag);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -348,8 +350,6 @@ HWTEST_F(P2pAdapterTest, GetIpAddressTest001, TestSize.Level1)
|
||||
.WillOnce(DoAll(SetArgPointee<0>(info), Return(WIFI_SUCCESS)));
|
||||
int32_t ret = P2pAdapter::GetIpAddress(ipString);
|
||||
EXPECT_EQ(ret, ToSoftBusErrorCode(static_cast<int32_t>(ERROR_WIFI_UNKNOWN)));
|
||||
ret = P2pAdapter::GetIpAddress(ipString);
|
||||
EXPECT_TRUE((ret != SOFTBUS_OK));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -193,6 +193,11 @@ int32_t GetInterfaceIpString(const std::string &interface, std::string &ip)
|
||||
return OHOS::SoftBus::WifiDirectInterfaceMock::GetMock()->GetInterfaceIpString(interface, ip);
|
||||
}
|
||||
|
||||
int IsWifiActive()
|
||||
{
|
||||
return OHOS::SoftBus::WifiDirectInterfaceMock::GetMock()->IsWifiActive();
|
||||
}
|
||||
|
||||
WifiErrorCode GetLinkedInfo(WifiLinkedInfo *info)
|
||||
{
|
||||
return OHOS::SoftBus::WifiDirectInterfaceMock::GetMock()->GetLinkedInfo(info);
|
||||
|
@ -75,6 +75,7 @@ public:
|
||||
virtual int32_t LnnGetRemoteDefaultPtkByUuid(const char *uuid, char *remotePtk, uint32_t len) = 0;
|
||||
|
||||
// Defines dependencies short-reach interface here
|
||||
virtual int IsWifiActive() = 0;
|
||||
virtual WifiErrorCode GetLinkedInfo(WifiLinkedInfo *info) = 0;
|
||||
virtual WifiErrorCode Hid2dGetRecommendChannel(const RecommendChannelRequest *request,
|
||||
RecommendChannelResponse *response) = 0;
|
||||
@ -165,6 +166,7 @@ public:
|
||||
MOCK_METHOD(uint64_t, LnnGetFeatureCapabilty, (), (override));
|
||||
MOCK_METHOD(bool, IsFeatureSupport, (uint64_t, FeatureCapability), (override));
|
||||
|
||||
MOCK_METHOD(int, IsWifiActive, (), (override));
|
||||
MOCK_METHOD(WifiErrorCode, GetLinkedInfo, (WifiLinkedInfo *), (override));
|
||||
MOCK_METHOD(WifiErrorCode, Hid2dGetRecommendChannel,
|
||||
(const RecommendChannelRequest *, RecommendChannelResponse *), (override));
|
||||
|
Loading…
Reference in New Issue
Block a user