From effc2123cfccb5a9069df460d4d794b0a7e0a4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=91=9E=E5=B3=B0?= Date: Fri, 30 Aug 2024 01:39:28 +0000 Subject: [PATCH] update tests/adapter/unittest/softbus_wifi_api_test.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王瑞峰 --- .../unittest/softbus_wifi_api_test.cpp | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/adapter/unittest/softbus_wifi_api_test.cpp b/tests/adapter/unittest/softbus_wifi_api_test.cpp index 912a6e478..1feab901e 100644 --- a/tests/adapter/unittest/softbus_wifi_api_test.cpp +++ b/tests/adapter/unittest/softbus_wifi_api_test.cpp @@ -18,6 +18,7 @@ #include "softbus_def.h" #include "softbus_errcode.h" #include "softbus_wifi_api_adapter.h" +#include "softbus_adapter_errcode.h" #include "wifi_mock.h" namespace OHOS { @@ -64,13 +65,13 @@ HWTEST_F(AdapterDsoftbusWifiTest, SoftBusGetWifiDeviceConfigTest001, TestSize.Le EXPECT_CALL(wifiMock, GetDeviceConfigs) .WillOnce(DoAll(SetArgPointee<1>(WIFI_MAX_CONFIG_SIZE + 1), Return(WIFI_SUCCESS))); ret = SoftBusGetWifiDeviceConfig(&configList, &num); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_MEM_ERR); EXPECT_CALL(wifiMock, GetDeviceConfigs) .WillOnce(DoAll(SetArgPointee<1>(TEST_CONFIG_SIZE), Return(ERROR_WIFI_INVALID_ARGS))); ret = SoftBusGetWifiDeviceConfig(&configList, &num); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_MEM_ERR); ret = SoftBusGetWifiDeviceConfig(nullptr, &num); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_INVALID_PARAM); } /* @@ -97,7 +98,7 @@ HWTEST_F(AdapterDsoftbusWifiTest, SoftBusConnectToDeviceTest001, TestSize.Level1 ret = SoftBusConnectToDevice(&configList); EXPECT_TRUE(ret == SOFTBUS_OK); ret = SoftBusConnectToDevice(nullptr); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_INVALID_PARAM); } /* @@ -113,7 +114,7 @@ HWTEST_F(AdapterDsoftbusWifiTest, SoftBusStartWifiScanTest001, TestSize.Level1) int32_t ret = SoftBusStartWifiScan(); EXPECT_TRUE(ret == SOFTBUS_OK); ret = SoftBusStartWifiScan(); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_ADAPTER_ERR); } /* @@ -150,14 +151,14 @@ HWTEST_F(AdapterDsoftbusWifiTest, SoftBusGetWifiScanListTest001, TestSize.Level1 SoftBusWifiScanInfo *result = nullptr; uint32_t size; int32_t ret = SoftBusGetWifiScanList(nullptr, nullptr); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_INVALID_PARAM); ret = SoftBusGetWifiScanList(&result, nullptr); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_INVALID_PARAM); ret = SoftBusGetWifiScanList(&result, &size); EXPECT_TRUE(ret == SOFTBUS_OK); EXPECT_CALL(wifiMock, GetScanInfoList).WillRepeatedly(Return(ERROR_WIFI_INVALID_ARGS)); ret = SoftBusGetWifiScanList(&result, &size); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_MEM_ERR); } /* @@ -199,9 +200,9 @@ HWTEST_F(AdapterDsoftbusWifiTest, SoftBusGetChannelListFor5GTest001, TestSize.Le int32_t ret = SoftBusGetChannelListFor5G(&channelList, num); EXPECT_TRUE(ret == SOFTBUS_OK); ret = SoftBusGetChannelListFor5G(&channelList, num); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_ADAPTER_ERR); ret = SoftBusGetChannelListFor5G(nullptr, num); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_INVALID_PARAM); } /* @@ -251,7 +252,7 @@ HWTEST_F(AdapterDsoftbusWifiTest, SoftBusGetLinkedInfoTest001, TestSize.Level1) int32_t ret = SoftBusGetLinkedInfo(&info); EXPECT_TRUE(ret == SOFTBUS_OK); ret = SoftBusGetLinkedInfo(&info); - EXPECT_TRUE(ret == SOFTBUS_ERR); + EXPECT_TRUE(ret == SOFTBUS_ADAPTER_ERR); } /*