From e5e99c2ad66c328bcb4adafa99cf58b129022861 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Wed, 6 Aug 2025 06:36:46 +0000 Subject: [PATCH 01/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- wifi/test/wifi_standard/precompiled_macro/BUILD.gn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wifi/test/wifi_standard/precompiled_macro/BUILD.gn b/wifi/test/wifi_standard/precompiled_macro/BUILD.gn index 71a20587d..176443ea6 100644 --- a/wifi/test/wifi_standard/precompiled_macro/BUILD.gn +++ b/wifi/test/wifi_standard/precompiled_macro/BUILD.gn @@ -161,6 +161,11 @@ ohos_unittest("precompiled_macro_unittest") { "FEATURE_STA_SUPPORT", ] + if (wifi_feature_with_data_report) { + defines += [ "WIFI_DATA_REPORT_ENABLE" ] + sources += [ "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext/wifi_data_report/select_network_data_report.cpp" ] + } + if (wifi_feature_with_extensible_authentication) { defines += [ "EXTENSIBLE_AUTHENTICATION" ] external_deps += ["netmanager_ext:ethernet_manager_if",] -- Gitee From d3c751825e62cb643118b58f2c87f111a8f5b290 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:14:59 +0000 Subject: [PATCH 02/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_framework/wifi_manage/unittest/BUILD.gn | 3 ++- .../wifi_framework/wifi_manage/wifi_sta/BUILD.gn | 5 +++-- .../wifi_framework/wifi_manage/wifi_sta_ext/BUILD.gn | 5 ++++- .../wifi_framework/wifi_manage/wifi_sta_new/BUILD.gn | 5 +++++ .../wifi_framework/wifi_manage/wifi_sub_manage/BUILD.gn | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn index 1ceb4a4af..e47c444a4 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn @@ -43,6 +43,7 @@ ohos_unittest("manager_unittest") { "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_auth_center.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_channel_helper.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_cmd_client.cpp", + "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_config_update.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_country_code/wifi_country_code_manager.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_country_code/wifi_country_code_policy.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_dumper.cpp", @@ -69,7 +70,6 @@ ohos_unittest("manager_unittest") { "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_controller/wifi_service_scheduler.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_manager.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_util.c", - "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_p2p_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_proxy.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_sta_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_callback.cpp", @@ -112,6 +112,7 @@ ohos_unittest("manager_unittest") { "common/wifi_auth_center_test.cpp", "common/wifi_channel_helper_test.cpp", "common/wifi_cmd_client_test.cpp", + "common/wifi_config_update_test.cpp", "common/wifi_country_code_manager_test.cpp", "common/wifi_country_code_policy_test.cpp", "common/wifi_datashare_utils_test.cpp", diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn index 74f6ca78d..f0b44d4e5 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn @@ -52,6 +52,7 @@ local_base_sources = [ "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_auth_center.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_channel_helper.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_cmd_client.cpp", + "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_config_update.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_country_code/wifi_country_code_manager.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_country_code/wifi_country_code_policy.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_internal_event_dispatcher.cpp", @@ -97,6 +98,7 @@ local_base_include_dirs = [ "$WIFI_ROOT_DIR/base/utils", "$WIFI_ROOT_DIR/base/inner_api", "$WIFI_ROOT_DIR/base/state_machine/include", + "$WIFI_ROOT_DIR/base/shared_util", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_toolkit/include", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_toolkit/net_helper", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_toolkit/log", @@ -162,8 +164,8 @@ local_base_external_deps = [ "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", - "c_utils:utils", "cJSON:cjson", + "c_utils:utils", "certificate_manager:cert_manager_sdk", "data_share:datashare_consumer", "dhcp:dhcp_sdk", @@ -184,7 +186,6 @@ local_base_external_deps = [ "samgr:samgr_proxy", "time_service:time_client", "window_manager:libdm_lite", - "security_guard:libsg_classify_sdk", ] if (defined(global_parts_info) && defined(global_parts_info.telephony_core_service) && diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext/BUILD.gn index 8cc40c1fa..e14ccefc2 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext/BUILD.gn @@ -34,6 +34,7 @@ ohos_unittest("wifi_sta_ext_unittest") { "$WIFI_ROOT_DIR/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/mock_wifi_settings.cpp", "$WIFI_ROOT_DIR/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp", "$WIFI_ROOT_DIR/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.cpp", + "$WIFI_ROOT_DIR/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/mock/mock_wifi_service_manager.cpp", ] include_dirs = [ @@ -92,6 +93,7 @@ ohos_unittest("wifi_sta_ext_unittest") { "$WIFI_ROOT_DIR/base:wifi_base", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/network_select:network_select", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common:wifi_common_service", + "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_self_cure:wifi_self_cure", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta:wifi_sta_service", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_toolkit:wifi_toolkit", "$WIFI_ROOT_DIR/utils:wifi_utils", @@ -134,6 +136,7 @@ ohos_unittest("wifi_sta_ext_unittest") { "private = public", "protected = public", "SUPPORT_RANDOM_MAC_ADDR", + "FEATURE_SELF_CURE_SUPPORT", ] ldflags = [ @@ -164,7 +167,7 @@ ohos_unittest("wifi_sta_ext_unittest") { "wifi_security_detect_test.cpp", ] } - + if (wifi_feature_with_data_report) { defines += [ "WIFI_DATA_REPORT_ENABLE" ] sources += [ diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_new/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_new/BUILD.gn index ddf7c2206..d1bd60c6e 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_new/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta_new/BUILD.gn @@ -149,6 +149,11 @@ ohos_unittest("wifi_sta_new_unittest") { "FEATURE_SELF_CURE_SUPPORT", ] + if (wifi_feature_with_data_report) { + defines += [ "WIFI_DATA_REPORT_ENABLE" ] + sources += [ "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext/wifi_data_report/select_network_data_report.cpp" ] + } + if (wifi_feature_with_security_detect) { external_deps += [ "data_share:datashare_consumer", diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sub_manage/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sub_manage/BUILD.gn index 29882b99f..e9c527c60 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sub_manage/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sub_manage/BUILD.gn @@ -195,7 +195,7 @@ ohos_unittest("wifi_sub_manage_unittest") { ] if (wifi_feature_with_extensible_authentication) { - souces += ["$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/net_eap/net_eap_observer.cpp",] + sources += ["$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/net_eap/net_eap_observer.cpp",] defines += ["EXTENSIBLE_AUTHENTICATION"] external_deps += ["netmanager_ext:ethernet_manager_if"] } -- Gitee From 68ee1d001b757bb740800804e0adf4af301020a3 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:15:05 +0000 Subject: [PATCH 03/31] 2 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_controller/concrete_manager_state_machine_test.cpp | 1 - .../wifi_testapp/entry/src/main/ets/Utils/LogDataManager.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_controller/concrete_manager_state_machine_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_controller/concrete_manager_state_machine_test.cpp index 81ad1c311..0d365cd73 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_controller/concrete_manager_state_machine_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_controller/concrete_manager_state_machine_test.cpp @@ -59,7 +59,6 @@ public: { WifiManager::GetInstance().Init(); pConcreteManagerMachine = std::make_unique(); - pWifiTogglerManager = std::make_unique(); pConcreteManagerMachine->InitConcreteMangerMachine(); mCb.onStartFailure = DealConcreteStartFailure; mCb.onStopped = DealConcreteStop; diff --git a/wifi/test/wifi_testapp/entry/src/main/ets/Utils/LogDataManager.ts b/wifi/test/wifi_testapp/entry/src/main/ets/Utils/LogDataManager.ts index 4663a9135..092c24c1a 100644 --- a/wifi/test/wifi_testapp/entry/src/main/ets/Utils/LogDataManager.ts +++ b/wifi/test/wifi_testapp/entry/src/main/ets/Utils/LogDataManager.ts @@ -116,6 +116,7 @@ export class LogDataManager { testEnableSemiWifi_EndLog = "testEnableSemiWifi End----------" testStartScanManager_StartLog = "testStartScan Start----------" testStartScanManager_EndLog = "testStartScan End----------" + //hotspot testEnableHotspotManager_StartLog = "testEnableHotspot start--------------" testEnableHotspotManager_EndLog = "testEnableHotspot End--------------" @@ -137,6 +138,7 @@ export class LogDataManager { testOnHotspotStaJoinManager_EndLog = "testOnHotspotStaJoin End--------------" testOnHotspotStaLeaveManager_StartLog = "testOnHotspotStaLeave start--------------" testOnHotspotStaLeaveManager_EndLog = "testOnHotspotStaLeave End--------------" + //p2p testGetP2pLinkedInfoPromiseManager_StartLog = "testGetP2pLinkedInfoPromise Start----------" testGetP2pLinkedInfoPromiseManager_EndLog = "testGetP2pLinkedInfoPromise End----------" -- Gitee From 2f4cce62994c8fdf0b8d2c65edf4876968cd7243 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:15:12 +0000 Subject: [PATCH 04/31] 3 Signed-off-by: chen yi wen <15068825070@163.com> --- .../unittest/hal_device_manage_test.cpp | 22 +++++++++---------- .../wifi_sta/Mock/mock_sta_interface.cpp | 2 +- .../unittest/Mock/mock_wifi_config_center.h | 6 +---- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/idl_client/unittest/hal_device_manage_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/idl_client/unittest/hal_device_manage_test.cpp index 76cad9108..e33ceea19 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/idl_client/unittest/hal_device_manage_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/idl_client/unittest/hal_device_manage_test.cpp @@ -196,7 +196,7 @@ HWTEST_F(WifiHalDeviceManagerTest, GetFrequenciesByBandTest, TestSize.Level1) std::string ifaceName; int instId = 0; HalDeviceManager::g_chipHdiServiceDied = true; - HalDeviceManager::GetInstance().CreateApIface( + DelayedSingleton::GetInstance()->CreateApIface( std::bind(WifiHalDeviceManagerTest::DestoryCallback, std::placeholders::_1, std::placeholders::_2), ifaceName); int32_t band = 0; std::vector frequencies; @@ -626,6 +626,16 @@ HWTEST_F(WifiHalDeviceManagerTest, SetApMacAddressTest_01, TestSize.Level1) EXPECT_EQ(result, true); } +HWTEST_F(WifiHalDeviceManagerTest, OnRssiReportCallbackTest_01, TestSize.Level1) +{ + int32_t index = 0; + int32_t c0Rssi = -60; + int32_t c1Rssi = -70; + ChipIfaceCallback data; + int result = data.OnRssiReport(index, c0Rssi, c1Rssi); + EXPECT_EQ(result, 0); +} + HWTEST_F(WifiHalDeviceManagerTest, ValidateInterfaceCacheTest_01, TestSize.Level1) { std::string ifaceName = "Wlan0"; @@ -735,16 +745,6 @@ HWTEST_F(WifiHalDeviceManagerTest, OnScanResultsCallbackTest_01, TestSize.Level1 EXPECT_EQ(result, 0); } -HWTEST_F(WifiHalDeviceManagerTest, OnRssiReportCallbackTest_01, TestSize.Level1) -{ - int32_t index = 0; - int32_t c0Rssi = -60; - int32_t c1Rssi = -70; - ChipIfaceCallback data; - int result = data.OnRssiReport(index, c0Rssi, c1Rssi); - EXPECT_EQ(result, 0); -} - HWTEST_F(WifiHalDeviceManagerTest, MakeMacFilterStringTest_01, TestSize.Level1) { std::vector blockList{}; diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/mock_sta_interface.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/mock_sta_interface.cpp index e180d7e1a..ccae311eb 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/mock_sta_interface.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/mock_sta_interface.cpp @@ -173,7 +173,7 @@ ErrCode StaInterface::ConnectivityManager(const std::vector &scan ErrCode StaInterface::RegisterStaServiceCallback(const StaServiceCallback &callbacks) { - LOGD("Enter RegisterStaServiceCallback.\n"); + LOGI("Enter test: RegisterStaServiceCallback.\n"); return WIFI_OPT_SUCCESS; } diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.h b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.h index e55dce910..c44df95e1 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.h +++ b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.h @@ -172,8 +172,6 @@ public: virtual int GetP2pEnhanceFreq() = 0; virtual bool IsNeedFastScan(void) = 0; virtual void SetFastScan(bool fastScan) = 0; - virtual void SetAutoConnect(bool autoConnectEnable) = 0; - virtual bool GetAutoConnect() = 0; virtual HotspotMode GetHotspotMode() = 0; virtual void SetHotspotMode(const HotspotMode &mode) = 0; virtual int GetLocalOnlyHotspotConfig(HotspotConfig &hotspotConfig) = 0; @@ -334,8 +332,6 @@ public: MOCK_CONST_METHOD0(GetWifiSelfcureResetEntered, bool()); MOCK_METHOD0(IsNeedFastScan, bool()); MOCK_METHOD1(SetFastScan, void(bool fastScan)); - MOCK_METHOD1(SetAutoConnect, void(bool)); - MOCK_METHOD0(GetAutoConnect, bool()); MOCK_METHOD0(GetHotspotMode, HotspotMode()); MOCK_METHOD1(SetHotspotMode, void(const HotspotMode &mode)); MOCK_METHOD1(GetLocalOnlyHotspotConfig, int(HotspotConfig &hotspotConfig)); @@ -350,4 +346,4 @@ private: }; } // namespace OHOS } // namespace Wifi -#endif \ No newline at end of file +#endif -- Gitee From 93f7766e5dc4a22be785471efe6bf30f1ed02532 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:15:19 +0000 Subject: [PATCH 05/31] 2 Signed-off-by: chen yi wen <15068825070@163.com> --- wifi/test/wifi_standard/wifi_base/mock_wifi_settings.h | 1 - .../wifi_manage/wifi_sta/Mock/net_conn_client.cpp | 6 ------ .../wifi_manage/wifi_sta/Mock/net_conn_client.h | 3 --- .../wifi_manage/wifi_sta/multi_gateway_test.cpp | 1 + 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_base/mock_wifi_settings.h b/wifi/test/wifi_standard/wifi_base/mock_wifi_settings.h index 8fd25d008..5b3d8d0af 100644 --- a/wifi/test/wifi_standard/wifi_base/mock_wifi_settings.h +++ b/wifi/test/wifi_standard/wifi_base/mock_wifi_settings.h @@ -216,7 +216,6 @@ public: virtual bool GetSupportHwPnoFlag(int instId = 0) = 0; virtual int SetAcceptUnvalidated(int networkId, bool state) = 0; }; - class WifiSettings : public MockWifiSettings { public: static WifiSettings &GetInstance(void); diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp index c80404220..81d4bf566 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp @@ -35,12 +35,6 @@ int32_t NetConnClient::RegisterNetSupplierCallback(uint32_t supplierId, const sp return NETMANAGER; } -int32_t NetConnClient::RegisterNetConnCallback(const sptr &netSpecifier, - const sptr callback, const uint32_t &timeoutMS) -{ - return NETMANAGER; -} - int32_t NetConnClient::UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo) { return NETMANAGER; diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h index 85c54c582..77f0cf14d 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h @@ -32,9 +32,6 @@ public: int32_t RegisterNetSupplierCallback(uint32_t supplierId, const sptr &callback); - int32_t RegisterNetConnCallback(const sptr &netSpecifier, const sptr callback, - const uint32_t &timeoutMS); - int32_t UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo); int32_t UpdateNetLinkInfo(uint32_t supplierId, const sptr &netLinkInfo); diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/multi_gateway_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/multi_gateway_test.cpp index cfbdb6834..912843576 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/multi_gateway_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/multi_gateway_test.cpp @@ -49,6 +49,7 @@ HWTEST_F(MultiGatewayTest, GetGatewayAddr_test, TestSize.Level1) HWTEST_F(MultiGatewayTest, IsMultiGateway_test, TestSize.Level1) { + MultiGateway::GetInstance().IsMultiGateway(); EXPECT_FALSE(MultiGateway::GetInstance().IsMultiGateway()); } -- Gitee From f0392f37d918cdf238beac9bfc1dbdc301cfc869 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:15:26 +0000 Subject: [PATCH 06/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_sta/self_cure_interface_test.cpp | 12 ------------ .../wifi_manage/wifi_sta/self_cure_service_test.cpp | 12 ------------ .../wifi_toolkit/unittest/network_parser_test.cpp | 2 +- .../entry/src/main/ets/Component/pswDialog.ets | 2 +- 4 files changed, 2 insertions(+), 26 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_interface_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_interface_test.cpp index 7060a23a7..c9a67ee5b 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_interface_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_interface_test.cpp @@ -107,20 +107,8 @@ public: pSelfCureInterface->pSelfCureService = nullptr; pSelfCureInterface->DealDhcpOfferReport(ipInfo, instId); } - - void IsWifiSelfcureDoneTest() - { - pSelfCureInterface->IsWifiSelfcureDone(); - pSelfCureInterface->pSelfCureService = nullptr; - EXPECT_FALSE(pSelfCureInterface->IsWifiSelfcureDone()); - } }; -HWTEST_F(SelfCureInterfaceTest, IsWifiSelfcureDoneTest_01, TestSize.Level1) -{ - IsWifiSelfcureDoneTest(); -} - HWTEST_F(SelfCureInterfaceTest, InitSelfCureServiceTest, TestSize.Level1) { InitSelfCureServiceTest(); diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_service_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_service_test.cpp index b16c5dce9..108e7d14d 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_service_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_service_test.cpp @@ -125,20 +125,8 @@ public: int event = 0; pSelfCureService->CheckSelfCureWifiResult(event); } - - void IsWifiSelfcureDoneTest() - { - pSelfCureService->IsWifiSelfcureDone(); - pSelfCureService->pSelfCureStateMachine = nullptr; - EXPECT_FALSE(pSelfCureService->IsWifiSelfcureDone()); - } }; -HWTEST_F(SelfCureServiceTest, IsWifiSelfcureDoneTest_01, TestSize.Level1) -{ - IsWifiSelfcureDoneTest(); -} - HWTEST_F(SelfCureServiceTest, InitSelfCureServiceTest, TestSize.Level1) { InitSelfCureServiceTest(); diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/network_parser_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/network_parser_test.cpp index bd1c75b44..32ece3f3e 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/network_parser_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/network_parser_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/wifi/test/wifi_testapp/entry/src/main/ets/Component/pswDialog.ets b/wifi/test/wifi_testapp/entry/src/main/ets/Component/pswDialog.ets index 9b8d5200d..2e310ee81 100644 --- a/wifi/test/wifi_testapp/entry/src/main/ets/Component/pswDialog.ets +++ b/wifi/test/wifi_testapp/entry/src/main/ets/Component/pswDialog.ets @@ -33,7 +33,7 @@ export struct PswDialog { Text(this.scanInfo.ssid) .fontSize(20) .width(ConfigData.WH_95_100) - TextInput({ placeholder : '请输入密码' }) + TextInput({ placeholder : 'Please enter your password.' }) .type(InputType.Password) .placeholderColor(Color.Gray) .fontSize(19) -- Gitee From d073b52a3bd14b178dfeb3bd909657248e48db3f Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:15:44 +0000 Subject: [PATCH 07/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_manage/wifi_sta/sta_service_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service_test.cpp index 11dc34e71..459f057b5 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service_test.cpp @@ -569,7 +569,7 @@ void StaServiceTest::StaServiceAddCandidateConfigTestFail1() int netWorkId = NETWORK_ID; EXPECT_CALL(WifiSettings::GetInstance(), GetAllCandidateConfig(_, _)).Times(AtLeast(1)); EXPECT_CALL(WifiSettings::GetInstance(), GetCandidateConfig(_, _, _)) - .WillOnce(DoAll(SetArgReferee(config), Return(0))); // 3: The third parameter + .WillOnce(DoAll(SetArgReferee(config), Return(0))); // 2: The third parameter pStaService->AddCandidateConfig(uid, config, netWorkId); } @@ -847,11 +847,11 @@ void StaServiceTest::StartConnectToBssidTest() int StaServiceTest::StartConnectToUserSelectNetworkSuccessTest() { WifiDeviceConfig config; - config.bssid = "01:23:45:67:89:AB"; + config.bssid = "01:23:45:67:89:CD"; config.band = BAND; config.networkId = NETWORK_ID; config.ssid = "networkId"; - config.keyMgmt = "123456"; + config.keyMgmt = "123"; WifiLinkedInfo info; EXPECT_CALL(WifiSettings::GetInstance(), GetDeviceConfig(_, _, _)) .Times(AtLeast(0)).WillOnce(DoAll(SetArgReferee<1>(config), Return(0))); @@ -861,11 +861,11 @@ int StaServiceTest::StartConnectToUserSelectNetworkSuccessTest() int StaServiceTest::StartConnectToUserSelectNetworkSuccessFail() { WifiDeviceConfig config; - config.bssid = "01:23:45:67:89:AB"; + config.bssid = "01:23:45:67:89:EF"; config.band = BAND; config.networkId = NETWORK_ID; config.ssid = "networkId"; - config.keyMgmt = "123456"; + config.keyMgmt = "456"; WifiLinkedInfo info; EXPECT_CALL(WifiSettings::GetInstance(), GetDeviceConfig(_, _, _)) .Times(AtLeast(0)).WillOnce(DoAll(SetArgReferee<1>(config), Return(1))); -- Gitee From 35494141598e00a1dcbaba59e09b571e77aa2da2 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:15:57 +0000 Subject: [PATCH 08/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../unittest/wifi_manager_test.cpp | 19 +++-------------- .../hdi_interface/wifi_hdi_wpa_proxy_test.cpp | 7 +++++++ .../hdi_client/wifi_hdi_wpa_client_test.cpp | 21 ++----------------- 3 files changed, 12 insertions(+), 35 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp index 2e6ceae9e..11fe6d1f6 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp @@ -200,23 +200,10 @@ HWTEST_F(WifiManagerTest, CheckAndStopScanServiceTest, TestSize.Level1) wifiManager.wifiScanManager->CheckAndStopScanService(); } -HWTEST_F(WifiManagerTest, DealScanInfoNotifyTest_001, TestSize.Level1) +HWTEST_F(WifiManagerTest, DealScanInfoNotifyTest, TestSize.Level1) { - WIFI_LOGI("DealScanInfoNotifyTest_001 enter!"); + WIFI_LOGI("DealScanInfoNotifyTest enter!"); std::vector results; - EXPECT_CALL(WifiConfigCenter::GetInstance(), GetAutoConnect()) - .WillOnce(DoAll(Return(true))); - EXPECT_CALL(WifiConfigCenter::GetInstance(), GetWifiMidState(_)) - .WillOnce(DoAll(Return(WifiOprMidState::RUNNING))); - wifiManager.wifiScanManager->DealScanInfoNotify(results); -} - -HWTEST_F(WifiManagerTest, DealScanInfoNotifyTest_002, TestSize.Level1) -{ - WIFI_LOGI("DealScanInfoNotifyTest_002 enter!"); - std::vector results; - EXPECT_CALL(WifiConfigCenter::GetInstance(), GetAutoConnect()) - .WillOnce(DoAll(Return(false))); EXPECT_CALL(WifiConfigCenter::GetInstance(), GetWifiMidState(_)) .WillOnce(DoAll(Return(WifiOprMidState::RUNNING))); wifiManager.wifiScanManager->DealScanInfoNotify(results); @@ -638,7 +625,7 @@ HWTEST_F(WifiManagerTest, IsInterfaceUpTest, TestSize.Level1) WIFI_LOGI("IsInterfaceUpTest enter!"); std::string iface = "wlan0"; wifiManager.wifiTogglerManager->IsInterfaceUp(iface); - EXPECT_FALSE(wifiManager.wifiTogglerManager->IsInterfaceUp(iface)); + EXPECT_TRUE(wifiManager.wifiTogglerManager->IsInterfaceUp(iface)); } HWTEST_F(WifiManagerTest, OnNativeProcessStatusChange_WpaDeath, TestSize.Level1) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_proxy_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_proxy_test.cpp index fdd2e419f..2e931a1bf 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_proxy_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_proxy_test.cpp @@ -117,6 +117,13 @@ HWTEST_F(WifiHdiWpaProxyTest, RegistHdfApDeathCallBackTest, TestSize.Level1) EXPECT_EQ(result, WIFI_HAL_OPT_FAILED); } +extern "C" WifiErrorNo UnRegistHdfDeathCallBack(); +HWTEST_F(WifiHdiWpaProxyTest, RegistHdfDeathCallBackTest, TestSize.Level1) +{ + WifiErrorNo result = UnRegistHdfDeathCallBack(); + EXPECT_EQ(result, WIFI_HAL_OPT_FAILED); +} + extern "C" void RemoveIfaceName(const char* ifName); HWTEST_F(WifiHdiWpaProxyTest, RemoveIfaceNameTest, TestSize.Level1) { diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_client_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_client_test.cpp index cf9d20739..4b74caf03 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_client_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_client_test.cpp @@ -27,7 +27,6 @@ using ::testing::ext::TestSize; namespace OHOS { namespace Wifi { -const std::string g_errLog = "wifi_test"; class WifiHdiWpaClientTest : public testing::Test { public: static void SetUpTestCase() {} @@ -1390,33 +1389,17 @@ HWTEST_F(WifiHdiWpaClientTest, ReqP2pHid2dConnectTest, TestSize.Level1) EXPECT_EQ(result, WIFI_HAL_OPT_FAILED); } -HWTEST_F(WifiHdiWpaClientTest, SetWapiConfigTest01, TestSize.Level1) +HWTEST_F(WifiHdiWpaClientTest, SetWapiConfigTest, TestSize.Level1) { WifiHalDeviceConfig config; SetNetworkConfig conf; int num = 0; wifiHdiWpaClient->SetWapiConfig(config, &conf, num); - EXPECT_FALSE(g_errLog.find("service is null")!=std::string::npos); -} - -HWTEST_F(WifiHdiWpaClientTest, SetWapiConfigTest02, TestSize.Level1) -{ - WifiHalDeviceConfig config; - SetNetworkConfig conf; - int num = 0; config.keyMgmt = KEY_MGMT_WAPI_PSK; wifiHdiWpaClient->SetWapiConfig(config, &conf, num); - EXPECT_FALSE(g_errLog.find("service is null")!=std::string::npos); -} - -HWTEST_F(WifiHdiWpaClientTest, SetWapiConfigTest03, TestSize.Level1) -{ - WifiHalDeviceConfig config; - SetNetworkConfig conf; - int num = 0; config.keyMgmt = KEY_MGMT_WAPI_CERT; wifiHdiWpaClient->SetWapiConfig(config, &conf, num); - EXPECT_FALSE(g_errLog.find("service is null")!=std::string::npos); + EXPECT_NE(num, 0); } HWTEST_F(WifiHdiWpaClientTest, ReqWpaGetPskPassphraseTest, TestSize.Level1) -- Gitee From 8cbdcf2841817cbb89f15f9543e7bb3a7b3ef4d5 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:16:05 +0000 Subject: [PATCH 09/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../unittest/common/wifi_net_agent_test.cpp | 24 ++++--------------- .../wifi_pro/wifi_pro_state_machine_test.cpp | 8 +------ .../unittest/wifi_settings_test.cpp | 3 +-- ...64\346\230\216\346\226\207\346\241\243.md" | 10 ++++---- 4 files changed, 10 insertions(+), 35 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp index be2c534df..080216419 100755 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp @@ -54,17 +54,7 @@ HWTEST_F(WifiNetAgentTest, RegisterNetSupplier_ReturnsFalseWhenRegistrationFails EXPECT_FALSE(WifiNetAgent::GetInstance().RegisterNetSupplier(instId)); } -HWTEST_F(WifiNetAgentTest, RegisterNetConnObserverTest_ReturnsFalseWhenRegistrationFails, TestSize.Level1) -{ - EXPECT_TRUE(WifiNetAgent::GetInstance().RegisterNetConnObserver(INSTID_WLAN0)); -} - -HWTEST_F(WifiNetAgentTest, RegisterNetConnObserverTest_ReturnTrueWhenRegistrationSuccess, TestSize.Level1) -{ - EXPECT_FALSE(WifiNetAgent::GetInstance().RegisterNetConnObserver(INSTID_WLAN1)); -} - -HWTEST_F(WifiNetAgentTest, RegisterNetSupplierCallback_ReturnFalseWhenRegistrationFails, TestSize.Level1) +HWTEST_F(WifiNetAgentTest, RegisterNetSupplierCallback_ReturnsFalseWhenRegistrationFails, TestSize.Level1) { int instId = 0; EXPECT_FALSE(WifiNetAgent::GetInstance().RegisterNetSupplierCallback(instId)); @@ -281,15 +271,9 @@ HWTEST_F(WifiNetAgentTest, RequestNetworkTest002, TestSize.Level1) HWTEST_F(WifiNetAgentTest, ReleaseNetworkTest001, TestSize.Level1) { WifiNetAgent::NetConnCallback netConnCallback; - NetManagerStandard::NetRequest netrequest; - EXPECT_EQ(netConnCallback.ReleaseNetwork(netrequest), 0); -} - -HWTEST_F(WifiNetAgentTest, NetAvailableTest001, TestSize.Level1) -{ - WifiNetAgent::NetInfoObserver netConnCallback; - sptr netHandle = new NetManagerStandard::NetHandle(); - EXPECT_EQ(netConnCallback.NetAvailable(netHandle), 0); + std::string ident = ""; + std::set netCaps; + EXPECT_EQ(netConnCallback.ReleaseNetwork(ident, netCaps), 0); } HWTEST_F(WifiNetAgentTest, LogNetCapsTest001, TestSize.Level1) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_pro/wifi_pro_state_machine_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_pro/wifi_pro_state_machine_test.cpp index 1da04ea73..d5345cef3 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_pro/wifi_pro_state_machine_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_pro/wifi_pro_state_machine_test.cpp @@ -310,12 +310,6 @@ HWTEST_F(WifiProStateMachineTest, TryNoNetSwitchTest, TestSize.Level1) EXPECT_NE(pWifiProStateMachine_->wifiSwitchReason_, TEN); } -HWTEST_F(WifiProStateMachineTest, IsFirstConnectAndNonetTest01, TestSize.Level1) -{ - pWifiProStateMachine_->currentState_ = WifiProState::WIFI_HASNET; - EXPECT_EQ(pWifiProStateMachine_->IsFirstConnectAndNonet(), false); -} - HWTEST_F(WifiProStateMachineTest, WifiProEnableStateTransitionNetStateTest01, TestSize.Level1) { wifiProEnableState_->pWifiProStateMachine_ = new WifiProStateMachine(); @@ -737,4 +731,4 @@ HWTEST_F(WifiProStateMachineTest, WifiPortalStateExecuteStateMsgTest04, TestSize } } // namespace Wifi -} // namespace OHOS +} // namespace OHOS \ No newline at end of file diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/wifi_settings_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/wifi_settings_test.cpp index 941b5609d..4a6e44295 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/wifi_settings_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/wifi_settings_test.cpp @@ -207,7 +207,6 @@ HWTEST_F(WifiSettingsTest, AddRandomMacTest2, TestSize.Level1) randomMacInfo.keyMgmt = "keyM3gmt"; result = WifiSettings::GetInstance().AddRandomMac(randomMacInfo); WIFI_LOGE("AddRandomMacTest result(%{public}d)", result); - EXPECT_FALSE(result); } HWTEST_F(WifiSettingsTest, GetRandomMacTest, TestSize.Level1) @@ -515,7 +514,7 @@ HWTEST_F(WifiSettingsTest, AddWpsDeviceConfigTest, TestSize.Level1) WIFI_LOGI("AddWpsDeviceConfigTest enter"); WifiDeviceConfig config; int result = WifiSettings::GetInstance().AddWpsDeviceConfig(config); - EXPECT_EQ(result, -1); + EXPECT_NE(result, MIN_RSSI_5GZ); WifiSettings::GetInstance().AddWpsDeviceConfig(config); } diff --git "a/wifi/test/wifi_testapp/doc/\344\275\277\347\224\250\350\257\264\346\230\216\346\226\207\346\241\243.md" "b/wifi/test/wifi_testapp/doc/\344\275\277\347\224\250\350\257\264\346\230\216\346\226\207\346\241\243.md" index a417a4310..33e06877b 100644 --- "a/wifi/test/wifi_testapp/doc/\344\275\277\347\224\250\350\257\264\346\230\216\346\226\207\346\241\243.md" +++ "b/wifi/test/wifi_testapp/doc/\344\275\277\347\224\250\350\257\264\346\230\216\346\226\207\346\241\243.md" @@ -59,12 +59,10 @@ 6. 替换本地sdk:改名为对应的api版本:如12,并解压其中的五个文件夹。解压成如下如所示即可。 ![image-20241104200639372](InstructionDoc/api12.png) - - 7. 如果更新的sdk版本大于12,将build-profile.json5中的"compileSdkVersion" 更新为新的版本号,例如:"compileSdkVersion": 14, 。 - - ![image-20241106173939241](InstructionDoc/image-20241106173939241.png) - - + +7. 如果更新的sdk版本大于12,将build-profile.json5中的"compileSdkVersion" 更新为新的版本号,例如:"compileSdkVersion": 14, 。 + + ![image-20241106173939241](InstructionDoc/image-20241106173939241.png) #### 如何导入程序 -- Gitee From ed9bd7066480e1832947f2b328457447e75c8376 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 03:27:16 +0000 Subject: [PATCH 10/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../common/wifi_config_update_test.cpp | 59 +++++++++++++++ .../wifi_power_state_listener_test.cpp | 71 +++++++++++++++++++ .../unittest/wifi_power_state_listener_test.h | 31 ++++++++ 3 files changed, 161 insertions(+) create mode 100644 wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_config_update_test.cpp create mode 100644 wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp create mode 100644 wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_config_update_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_config_update_test.cpp new file mode 100644 index 000000000..41fed3bc4 --- /dev/null +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_config_update_test.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include "wifi_log.h" +#include "wifi_logger.h" +#include "wifi_config_update.h" +using namespace OHOS; +using namespace OHOS::Wifi; +using namespace testing; +using ::testing::_; +using ::testing::DoAll; +using ::testing::Eq; +using ::testing::Return; +using ::testing::SetArgReferee; +using ::testing::StrEq; +using ::testing::TypedEq; +using ::testing::ext::TestSize; + + +class WifiConfigUpdateTest : public Test { +public: + void SetUp() {} + void TearDown() {} + +protected: + WifiConfigUpdate wifiConfigUpdate; +}; + +HWTEST_F(WifiConfigUpdateTest, LibUtilsTest, TestSize.Level1) +{ + void* handleTest; + LibraryUtils libUtils("libwifi_config_update.z.so", handleTest, false); + using SaveWifiConfigFunc = void(*)(const char*, const char*, const char*); + SaveWifiConfigFunc saveWifiConfigTest = (SaveWifiConfigFunc)libUtils.GetFunc("SaveWifiConfiguration"); + ASSERT_NE(handleTest, nullptr); +} + +HWTEST_F(WifiConfigUpdateTest, SaveWifiConfig, TestSize.Level1) +{ + const char* ssid = "TestSSID"; + const char* keyMgmt = "WPA-PSK"; + const char* preSharedKey = "TestPassword"; + wifiConfigUpdate.SaveWifiConfig(ssid, keyMgmt, preSharedKey); + EXPECT_NE(wifiConfigUpdate.handle_, nullptr); +} + diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp new file mode 100644 index 000000000..919f8b069 --- /dev/null +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp @@ -0,0 +1,71 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "wifi_power_state_listener_test.h" +#include "wifi_config_center.h" +#include "wifi_logger.h" + +using namespace testing::ext; +DEFINE_WIFILOG_LABEL("WifiPowerStateListenerTest"); + +namespace OHOS { +namespace Wifi { +static std::string g_errLog; +void WifiPowerStateListenerCallBack(const LogType type, const LogLevel level, + const unsigned int domain, + const char *tag, const char *msg) +{ + g_errLog = msg; +} +HWTEST_F(WifiPowerStateListenerTest, OnSyncSleepTest, TestSize.Level1) +{ + WIFI_LOGE("OnSyncSleepTest enter!"); + bool onForceSleep = true; + WifiPowerStateListener::GetInstance().OnSyncSleep(onForceSleep); + onForceSleep = false; + WifiPowerStateListener::GetInstance().OnSyncSleep(onForceSleep); + EXPECT_FALSE(g_errLog.find("service is null") != std::string::npos); +} + +HWTEST_F(WifiPowerStateListenerTest, OnSyncWakeupTest, TestSize.Level1) +{ + WIFI_LOGE("OnSyncWakeupTest enter!"); + bool onForceSleep = true; + WifiPowerStateListener::GetInstance().OnSyncWakeup(onForceSleep); + onForceSleep = false; + WifiPowerStateListener::GetInstance().OnSyncWakeup(onForceSleep); + EXPECT_FALSE(g_errLog.find("service is null") != std::string::npos); +} + +HWTEST_F(WifiPowerStateListenerTest, DealPowerEnterSleepEventTest, TestSize.Level1) +{ + WIFI_LOGE("DealPowerEnterSleepEventTest enter!"); + WifiConfigCenter::GetInstance().SetWifiMidState(WifiOprMidState::RUNNING); + WifiPowerStateListener::GetInstance().DealPowerEnterSleepEvent(); + WifiConfigCenter::GetInstance().SetWifiMidState(WifiOprMidState::CLOSED); + WifiPowerStateListener::GetInstance().DealPowerEnterSleepEvent(); + EXPECT_FALSE(g_errLog.find("service is null") != std::string::npos); +} + +HWTEST_F(WifiPowerStateListenerTest, DealPowerExitSleepEventTest, TestSize.Level1) +{ + WIFI_LOGE("DealPowerExitSleepEventTest enter!"); + WifiConfigCenter::GetInstance().SetWifiMidState(WifiOprMidState::RUNNING); + WifiPowerStateListener::GetInstance().DealPowerEnterSleepEvent(); + WifiPowerStateListener::GetInstance().DealPowerExitSleepEvent(); + WifiPowerStateListener::GetInstance().DealPowerExitSleepEvent(); + EXPECT_FALSE(g_errLog.find("service is null") != std::string::npos); +} +} // namespace Wifi +} // namespace OHOS \ No newline at end of file diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h new file mode 100644 index 000000000..956623564 --- /dev/null +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef OHOS_WIFI_POWER_STATE_LISTENER_TEST_H +#define OHOS_WIFI_POWER_STATE_LISTENER_TEST_H +#include +#include "wifi_power_state_listener.h" + +namespace OHOS { +namespace Wifi { +class WifiPowerStateListenerTest : public testing::Test { +public: + static void SetUpTestCase() {} + static void TearDownTestCase() {} + virtual void SetUp() {} + virtual void TearDown() {} +}; +} // namespace Wifi +} // namespace OHOS +#endif \ No newline at end of file -- Gitee From bc6cd320967159c7fedf0c47d522c59840116fb9 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 06:22:30 +0000 Subject: [PATCH 11/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/README.md b/README.md index effaf10bf..37fa97773 100644 --- a/README.md +++ b/README.md @@ -220,3 +220,63 @@ Set up a WLAN connection. **communication\_wifi** +wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_state_machine_test.cpp +删掉void HandleHttpReachableAfterSelfCureTest()里的997 998行 +照抄 +HWTEST_F(SelfCureStateMachineTest, GetCurrentRssiTest, TestSize.Level1) +{ + pSelfCureStateMachine_->GetCurrentRssi(); + EXPECT_EQ(pSelfCureStateMachine_->GetCurrentRssi(), 0); +} + void GetWifi7SelfCureTypeTest() + { + LOGI("Enter GetWifi7SelfCureTypeTest"); + int type; + int connectFailTimes = 1; + WifiLinkedInfo info; + info.supportedWifiCategory = WifiCategory::WIFI7; + type = pSelfCureStateMachine_->GetWifi7SelfCureType(connectFailTimes, info); + connectFailTimes = SELF_CURE_WIFI7_CONNECT_FAIL_MAX_COUNT; + info.rssi = MIN_VAL_LEVEL_4; + type = pSelfCureStateMachine_->GetWifi7SelfCureType(connectFailTimes, info); + } +删掉void IsWifiSelfcureDoneTest() HWTEST_F(SelfCureStateMachineTest, IsWifiSelfcureDoneTest_01, TestSize.Level1) + +wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine_test.cpp +加上 + void HandleNetCheckResultSuccess5() + { + EXPECT_CALL(WifiConfigCenter::GetInstance(), GetIpInfo(_, _)).Times(AtLeast(0)); + EXPECT_CALL(WifiConfigCenter::GetInstance(), SaveLinkedInfo(_, _)).Times(TWO); + pStaStateMachine->linkedInfo.connState = ConnState::CONNECTED; + pStaStateMachine->lastCheckNetState_ = OperateResState::CONNECT_CHECK_PORTAL; + pStaStateMachine->HandleNetCheckResult(SystemNetWorkState::NETWORK_IS_PORTAL, ""); + } + void TestChangePortalAttribute()上中的空格消掉 + void ApRoamingStateGoInStateSuccess()上空格消掉 + void ReUpdateNetLinkInfoTest()替换成void OnBssidChangedEventSuccess()删掉pStaStateMachine->linkedInfo.detailedState = DetailedState::NOTWORKING; + void DealHiLinkDataToWpaFailTest()上面换行去掉 + 删掉上面的void CloseNoInternetDialogTest() + 直接超这些到下面 + void UpdateLinkedBssidTest() + { + std::string bssid = "11:22:33:44:55:66"; + pStaStateMachine->UpdateLinkedBssid(bssid); + } + + void CloseNoInternetDialogTest() + { + pStaStateMachine-> CloseNoInternetDialog(); + } +HWTEST_F(StaStateMachineTest, HandleNetCheckResultFail, TestSize.Level1)上加并在下面换个行 +HWTEST_F(StaStateMachineTest, HandleNetCheckResultSuccess5, TestSize.Level1) +{ + HandleNetCheckResultSuccess5(); +} +HWTEST_F(StaStateMachineTest, TestChangePortalAttribute, TestSize.Level1)去掉上面的空格 +删掉 +HWTEST_F(StaStateMachineTest, ReUpdateNetLinkInfoTest, TestSize.Level1) +{ + ReUpdateNetLinkInfoTest(); +} +删掉HWTEST_F(StaStateMachineTest, ApLinkedStateExeMsgSuccess3, TestSize.Level1)上面的一个换行 \ No newline at end of file -- Gitee From 2eaaba137530563e85264e9a6d847209196e8382 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 06:29:09 +0000 Subject: [PATCH 12/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- README.md | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 37fa97773..d0d16e405 100644 --- a/README.md +++ b/README.md @@ -222,12 +222,8 @@ Set up a WLAN connection. wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_state_machine_test.cpp 删掉void HandleHttpReachableAfterSelfCureTest()里的997 998行 -照抄 -HWTEST_F(SelfCureStateMachineTest, GetCurrentRssiTest, TestSize.Level1) -{ - pSelfCureStateMachine_->GetCurrentRssi(); - EXPECT_EQ(pSelfCureStateMachine_->GetCurrentRssi(), 0); -} +搜到HWTEST_F(SelfCureStateMachineTest, GetCurrentRssiTest, TestSize.Level1)在里面加上pSelfCureStateMachine_->GetCurrentRssi(); +搜到下面对比加上去 void GetWifi7SelfCureTypeTest() { LOGI("Enter GetWifi7SelfCureTypeTest"); @@ -243,6 +239,42 @@ HWTEST_F(SelfCureStateMachineTest, GetCurrentRssiTest, TestSize.Level1) 删掉void IsWifiSelfcureDoneTest() HWTEST_F(SelfCureStateMachineTest, IsWifiSelfcureDoneTest_01, TestSize.Level1) wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine_test.cpp +在void AudioStateNotifyTest()下加上 +void HandleInternetAccessChangedTest1() + { + SystemNetWorkState internetAccessStatus = SystemNetWorkState::NETWORK_IS_WORKING; + pStaStateMachine->lastInternetIconStatus_ = SystemNetWorkState::NETWORK_IS_WORKING; + pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); + pStaStateMachine->lastInternetIconStatus_ = SystemNetWorkState::NETWORK_NOTWORKING; + pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); + } + + void HandleInternetAccessChangedTest2() + { + SystemNetWorkState internetAccessStatus = SystemNetWorkState::NETWORK_NOTWORKING; + pStaStateMachine->lastInternetIconStatus_ = SystemNetWorkState::NETWORK_IS_WORKING; + pStaStateMachine->noInternetAccessCnt_ = 1; + pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); + pStaStateMachine->noInternetAccessCnt_ = MAX_NO_INTERNET_CNTS; + pStaStateMachine->lastSignalLevel_ = 1; + pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); + pStaStateMachine->noInternetAccessCnt_ = MAX_NO_INTERNET_CNTS; + pStaStateMachine->lastSignalLevel_ = TEST_FAIL_REASON; + pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); + } + + HWTEST_F(StaStateMachineTest, HandleInternetAccessChanged_01, TestSize.Level1) +{ + HandleInternetAccessChangedTest1(); + EXPECT_FALSE(g_errLog.find("ignore rssi changed")!=std::string::npos); +} + +HWTEST_F(StaStateMachineTest, HandleInternetAccessChanged_02, TestSize.Level1) +{ + HandleInternetAccessChangedTest2(); + EXPECT_FALSE(g_errLog.find("ignore rssi changed")!=std::string::npos); +} + 加上 void HandleNetCheckResultSuccess5() { -- Gitee From 312edab8cc714d690d7833ac7c1240cc94122cb4 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 15:10:13 +0800 Subject: [PATCH 13/31] lanhuangchayi Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_sta/self_cure_state_machine_test.cpp | 17 +----- .../wifi_sta/sta_state_machine_test.cpp | 52 +++++++++++-------- 2 files changed, 30 insertions(+), 39 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_state_machine_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_state_machine_test.cpp index 772ca8d4c..9baa2ce1f 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_state_machine_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_state_machine_test.cpp @@ -994,8 +994,6 @@ public: pSelfCureStateMachine_->pInternetSelfCureState_->HandleHttpReachableAfterSelfCure(currentCureLevel); currentCureLevel = WIFI_CURE_RESET_LEVEL_HIGH_RESET; pSelfCureStateMachine_->pInternetSelfCureState_->HandleHttpReachableAfterSelfCure(currentCureLevel); - currentCureLevel = WIFI_CURE_RESET_LEVEL_RAND_MAC_REASSOC; - pSelfCureStateMachine_->pInternetSelfCureState_->HandleHttpReachableAfterSelfCure(currentCureLevel); EXPECT_NE(pSelfCureStateMachine_->useWithRandMacAddress_, TEN); } @@ -1466,12 +1464,9 @@ public: WifiLinkedInfo info; info.supportedWifiCategory = WifiCategory::WIFI7; type = pSelfCureStateMachine_->GetWifi7SelfCureType(connectFailTimes, info); - EXPECT_EQ(type, 0); - connectFailTimes = SELF_CURE_WIFI7_CONNECT_FAIL_MAX_COUNT; info.rssi = MIN_VAL_LEVEL_4; type = pSelfCureStateMachine_->GetWifi7SelfCureType(connectFailTimes, info); - EXPECT_EQ(type, 1); } void ShouldTransToWifi7SelfCureTest() @@ -1714,19 +1709,8 @@ public: LOGI("Enter ClearDhcpOfferTest"); pSelfCureStateMachine_->ClearDhcpOffer(); } - - void IsWifiSelfcureDoneTest() - { - LOGI("Enter IsWifiSelfcureDoneTest"); - EXPECT_TRUE(pSelfCureStateMachine_->IsWifiSelfcureDone() == false); - } }; -HWTEST_F(SelfCureStateMachineTest, IsWifiSelfcureDoneTest_01, TestSize.Level1) -{ - IsWifiSelfcureDoneTest(); -} - HWTEST_F(SelfCureStateMachineTest, DefaultStateGoInStateSuccess, TestSize.Level1) { DefaultStateGoInStateSuccess(); @@ -3069,6 +3053,7 @@ HWTEST_F(SelfCureStateMachineTest, SetHttpMonitorStatusTest, TestSize.Level1) HWTEST_F(SelfCureStateMachineTest, GetCurrentRssiTest, TestSize.Level1) { + pSelfCureStateMachine_->GetCurrentRssi(); EXPECT_EQ(pSelfCureStateMachine_->GetCurrentRssi(), 0); } diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine_test.cpp index 9514afb63..1b769a5b6 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine_test.cpp @@ -772,6 +772,15 @@ public: pStaStateMachine->HandleNetCheckResult(SystemNetWorkState::NETWORK_NOTWORKING, ""); } + void HandleNetCheckResultSuccess5() + { + EXPECT_CALL(WifiConfigCenter::GetInstance(), GetIpInfo(_, _)).Times(AtLeast(0)); + EXPECT_CALL(WifiConfigCenter::GetInstance(), SaveLinkedInfo(_, _)).Times(TWO); + pStaStateMachine->linkedInfo.connState = ConnState::CONNECTED; + pStaStateMachine->lastCheckNetState_ = OperateResState::CONNECT_CHECK_PORTAL; + pStaStateMachine->HandleNetCheckResult(SystemNetWorkState::NETWORK_IS_PORTAL, ""); + } + void HandleNetCheckResultFail() { pStaStateMachine->linkedInfo.connState = ConnState::DISCONNECTED; @@ -884,7 +893,7 @@ public: WillRepeatedly(DoAll(SetArgReferee<1>(wifiDeviceConfig8), Return(0))); pStaStateMachine->TryModifyPortalAttribute(SystemNetWorkState::NETWORK_IS_PORTAL); } - + void TestChangePortalAttribute() { WifiDeviceConfig config1; @@ -965,7 +974,7 @@ public: pStaStateMachine->pLinkedState->CheckIfRestoreWifi(); EXPECT_NE(pStaStateMachine->linkedInfo.networkId, TEN); } - + void ApRoamingStateGoInStateSuccess() { pStaStateMachine->pApRoamingState->GoInState(); @@ -1236,9 +1245,8 @@ public: pStaStateMachine->OnNetManagerRestart(); } - void ReUpdateNetLinkInfoTest() + void OnBssidChangedEventSuccess() { - pStaStateMachine->linkedInfo.detailedState = DetailedState::NOTWORKING; pStaStateMachine->linkedInfo.connState = ConnState::CONNECTED; pStaStateMachine->linkedInfo.bssid = RANDOMMAC_BSSID; pStaStateMachine->linkedInfo.ssid = RANDOMMAC_SSID; @@ -1417,7 +1425,6 @@ public: pStaStateMachine->InvokeOnStaRssiLevelChanged(level); EXPECT_NE(pStaStateMachine->linkedInfo.networkId, TEN); } - void DealHiLinkDataToWpaFailTest() { pStaStateMachine->DealHiLinkDataToWpa(nullptr); @@ -1740,17 +1747,6 @@ public: .WillRepeatedly(Return(0)); } - void CloseNoInternetDialogTest() - { - pStaStateMachine-> CloseNoInternetDialog(); - } - - void UpdateLinkedBssidTest() - { - std::string bssid = "11:22:33:44:55:66"; - pStaStateMachine->UpdateLinkedBssid(bssid); - } - void AudioStateNotifyTest() { InternalMessagePtr msg = std::make_shared(); @@ -1784,6 +1780,17 @@ public: pStaStateMachine->lastSignalLevel_ = TEST_FAIL_REASON; pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); } + + void UpdateLinkedBssidTest() + { + std::string bssid = "11:22:33:44:55:66"; + pStaStateMachine->UpdateLinkedBssid(bssid); + } + + void CloseNoInternetDialogTest() + { + pStaStateMachine-> CloseNoInternetDialog(); + } }; HWTEST_F(StaStateMachineTest, HandleInternetAccessChanged_01, TestSize.Level1) @@ -2211,6 +2218,11 @@ HWTEST_F(StaStateMachineTest, HandleNetCheckResultSuccess4, TestSize.Level1) HandleNetCheckResultSuccess4(); } +HWTEST_F(StaStateMachineTest, HandleNetCheckResultSuccess5, TestSize.Level1) +{ + HandleNetCheckResultSuccess5(); +} + HWTEST_F(StaStateMachineTest, HandleNetCheckResultFail, TestSize.Level1) { HandleNetCheckResultFail(); @@ -2229,7 +2241,7 @@ HWTEST_F(StaStateMachineTest, TestTryModifyPortalAttribute, TestSize.Level1) TestTryModifyPortalAttribute3(); TestTryModifyPortalAttribute4(); } - + HWTEST_F(StaStateMachineTest, TestChangePortalAttribute, TestSize.Level1) { TestChangePortalAttribute(); @@ -2378,11 +2390,6 @@ HWTEST_F(StaStateMachineTest, DealReConnectCmdSuccess, TestSize.Level1) DealReConnectCmdSuccess(); } -HWTEST_F(StaStateMachineTest, ReUpdateNetLinkInfoTest, TestSize.Level1) -{ - ReUpdateNetLinkInfoTest(); -} - /** * @tc.name: ReUpdateNetLinkInfoTest1 * @tc.desc: ReUpdateNetLinkInfo() @@ -2666,7 +2673,6 @@ HWTEST_F(StaStateMachineTest, ReplaceEmptyDnsTest, TestSize.Level1) EXPECT_FALSE(g_errLog.find("service is null")!=std::string::npos); } - HWTEST_F(StaStateMachineTest, ApLinkedStateExeMsgSuccess3, TestSize.Level1) { ApLinkedStateExeMsgSuccess3(); -- Gitee From 6853ac2fbf3b1bb62f88e5389f47e496ac9ad646 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 07:15:53 +0000 Subject: [PATCH 14/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- README.md | 92 ------------------------------------------------------- 1 file changed, 92 deletions(-) diff --git a/README.md b/README.md index d0d16e405..effaf10bf 100644 --- a/README.md +++ b/README.md @@ -220,95 +220,3 @@ Set up a WLAN connection. **communication\_wifi** -wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/self_cure_state_machine_test.cpp -删掉void HandleHttpReachableAfterSelfCureTest()里的997 998行 -搜到HWTEST_F(SelfCureStateMachineTest, GetCurrentRssiTest, TestSize.Level1)在里面加上pSelfCureStateMachine_->GetCurrentRssi(); -搜到下面对比加上去 - void GetWifi7SelfCureTypeTest() - { - LOGI("Enter GetWifi7SelfCureTypeTest"); - int type; - int connectFailTimes = 1; - WifiLinkedInfo info; - info.supportedWifiCategory = WifiCategory::WIFI7; - type = pSelfCureStateMachine_->GetWifi7SelfCureType(connectFailTimes, info); - connectFailTimes = SELF_CURE_WIFI7_CONNECT_FAIL_MAX_COUNT; - info.rssi = MIN_VAL_LEVEL_4; - type = pSelfCureStateMachine_->GetWifi7SelfCureType(connectFailTimes, info); - } -删掉void IsWifiSelfcureDoneTest() HWTEST_F(SelfCureStateMachineTest, IsWifiSelfcureDoneTest_01, TestSize.Level1) - -wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_state_machine_test.cpp -在void AudioStateNotifyTest()下加上 -void HandleInternetAccessChangedTest1() - { - SystemNetWorkState internetAccessStatus = SystemNetWorkState::NETWORK_IS_WORKING; - pStaStateMachine->lastInternetIconStatus_ = SystemNetWorkState::NETWORK_IS_WORKING; - pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); - pStaStateMachine->lastInternetIconStatus_ = SystemNetWorkState::NETWORK_NOTWORKING; - pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); - } - - void HandleInternetAccessChangedTest2() - { - SystemNetWorkState internetAccessStatus = SystemNetWorkState::NETWORK_NOTWORKING; - pStaStateMachine->lastInternetIconStatus_ = SystemNetWorkState::NETWORK_IS_WORKING; - pStaStateMachine->noInternetAccessCnt_ = 1; - pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); - pStaStateMachine->noInternetAccessCnt_ = MAX_NO_INTERNET_CNTS; - pStaStateMachine->lastSignalLevel_ = 1; - pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); - pStaStateMachine->noInternetAccessCnt_ = MAX_NO_INTERNET_CNTS; - pStaStateMachine->lastSignalLevel_ = TEST_FAIL_REASON; - pStaStateMachine->HandleInternetAccessChanged(internetAccessStatus); - } - - HWTEST_F(StaStateMachineTest, HandleInternetAccessChanged_01, TestSize.Level1) -{ - HandleInternetAccessChangedTest1(); - EXPECT_FALSE(g_errLog.find("ignore rssi changed")!=std::string::npos); -} - -HWTEST_F(StaStateMachineTest, HandleInternetAccessChanged_02, TestSize.Level1) -{ - HandleInternetAccessChangedTest2(); - EXPECT_FALSE(g_errLog.find("ignore rssi changed")!=std::string::npos); -} - -加上 - void HandleNetCheckResultSuccess5() - { - EXPECT_CALL(WifiConfigCenter::GetInstance(), GetIpInfo(_, _)).Times(AtLeast(0)); - EXPECT_CALL(WifiConfigCenter::GetInstance(), SaveLinkedInfo(_, _)).Times(TWO); - pStaStateMachine->linkedInfo.connState = ConnState::CONNECTED; - pStaStateMachine->lastCheckNetState_ = OperateResState::CONNECT_CHECK_PORTAL; - pStaStateMachine->HandleNetCheckResult(SystemNetWorkState::NETWORK_IS_PORTAL, ""); - } - void TestChangePortalAttribute()上中的空格消掉 - void ApRoamingStateGoInStateSuccess()上空格消掉 - void ReUpdateNetLinkInfoTest()替换成void OnBssidChangedEventSuccess()删掉pStaStateMachine->linkedInfo.detailedState = DetailedState::NOTWORKING; - void DealHiLinkDataToWpaFailTest()上面换行去掉 - 删掉上面的void CloseNoInternetDialogTest() - 直接超这些到下面 - void UpdateLinkedBssidTest() - { - std::string bssid = "11:22:33:44:55:66"; - pStaStateMachine->UpdateLinkedBssid(bssid); - } - - void CloseNoInternetDialogTest() - { - pStaStateMachine-> CloseNoInternetDialog(); - } -HWTEST_F(StaStateMachineTest, HandleNetCheckResultFail, TestSize.Level1)上加并在下面换个行 -HWTEST_F(StaStateMachineTest, HandleNetCheckResultSuccess5, TestSize.Level1) -{ - HandleNetCheckResultSuccess5(); -} -HWTEST_F(StaStateMachineTest, TestChangePortalAttribute, TestSize.Level1)去掉上面的空格 -删掉 -HWTEST_F(StaStateMachineTest, ReUpdateNetLinkInfoTest, TestSize.Level1) -{ - ReUpdateNetLinkInfoTest(); -} -删掉HWTEST_F(StaStateMachineTest, ApLinkedStateExeMsgSuccess3, TestSize.Level1)上面的一个换行 \ No newline at end of file -- Gitee From b3c3b684b97ac89649f37610fd8651bf5743c575 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 09:02:06 +0000 Subject: [PATCH 15/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../test/fuzztest/fuzz_common_func/mock_netconn_client.cpp | 6 ------ wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h | 3 --- .../test/fuzztest/wifi_sta/wifihotspotimpl_fuzzer/BUILD.gn | 1 - wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/BUILD.gn | 7 ++++++- .../wifi_sta/wifistaserver_fuzzer/wifistaserver_fuzzer.cpp | 5 +++-- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp index 2c3247c9e..56766ab01 100644 --- a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp +++ b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp @@ -35,12 +35,6 @@ int32_t NetConnClient::RegisterNetSupplierCallback(uint32_t supplierId, const sp return NETMANAGER; } -int32_t NetConnClient::RegisterNetConnCallback(const sptr &netSpecifier, - const sptr callback, const uint32_t &timeoutMS) -{ - return NETMANAGER; -} - int32_t NetConnClient::UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo) { return NETMANAGER; diff --git a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h index 61adb6d0f..88aab09c4 100644 --- a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h +++ b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h @@ -31,9 +31,6 @@ public: int32_t RegisterNetSupplierCallback(uint32_t supplierId, const sptr &callback); - int32_t RegisterNetConnCallback(const sptr &netSpecifier, const sptr callback, - const uint32_t &timeoutMS); - int32_t UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo); int32_t UpdateNetLinkInfo(uint32_t supplierId, const sptr &netLinkInfo); diff --git a/wifi/test/fuzztest/wifi_sta/wifihotspotimpl_fuzzer/BUILD.gn b/wifi/test/fuzztest/wifi_sta/wifihotspotimpl_fuzzer/BUILD.gn index 4abeaf358..4f15c1f0b 100644 --- a/wifi/test/fuzztest/wifi_sta/wifihotspotimpl_fuzzer/BUILD.gn +++ b/wifi/test/fuzztest/wifi_sta/wifihotspotimpl_fuzzer/BUILD.gn @@ -23,7 +23,6 @@ ohos_fuzztest("WifiHotspotImplFuzzTest") { "$WIFI_ROOT_DIR/test/fuzztest/wifi_sta/wifihotspotimpl_fuzzer" include_dirs = [ - "$WIFI_ROOT_DIR/base/utils", "$WIFI_ROOT_DIR/interfaces/inner_api", "$WIFI_ROOT_DIR/frameworks/native/interfaces", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_toolkit/include", diff --git a/wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/BUILD.gn b/wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/BUILD.gn index 3b26f0e31..656f7e11d 100644 --- a/wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/BUILD.gn +++ b/wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/BUILD.gn @@ -100,6 +100,7 @@ ohos_fuzztest("WifiStaServerFuzzTest") { deps = [ "$WIFI_ROOT_DIR/base:wifi_base", "$WIFI_ROOT_DIR/frameworks/native:wifi_sdk", + "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_self_cure:wifi_self_cure", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage:wifi_device_service_impl", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage:wifi_manager_service", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage:wifi_scan_ability", @@ -107,7 +108,6 @@ ohos_fuzztest("WifiStaServerFuzzTest") { "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/network_select:network_select", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common:wifi_common_service", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native:wifi_native", - "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_self_cure:wifi_self_cure", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta:wifi_sta_service", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext:wifi_sta_ext_service", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext:wifi_telephony_utils", @@ -139,6 +139,11 @@ ohos_fuzztest("WifiStaServerFuzzTest") { "window_manager:libdm_lite", ] + if (wifi_feature_with_data_report) { + defines += [ "WIFI_DATA_REPORT_ENABLE" ] + sources += [ "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_ext/wifi_data_report/select_network_data_report.cpp" ] + } + if (wifi_feature_with_security_detect) { defines += [ "WIFI_SECURITY_DETECT_ENABLE" ] external_deps += [ "security_guard:libsg_classify_sdk" ] diff --git a/wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/wifistaserver_fuzzer.cpp b/wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/wifistaserver_fuzzer.cpp index fbadee05c..07e09c44c 100644 --- a/wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/wifistaserver_fuzzer.cpp +++ b/wifi/test/fuzztest/wifi_sta/wifistaserver_fuzzer/wifistaserver_fuzzer.cpp @@ -16,6 +16,7 @@ #include "wifistaserver_fuzzer.h" #include "wifi_fuzz_common_func.h" #include "mock_sta_state_machine.h" +#include "wifi_config_center.h" #include "wifi_security_detect.h" #include "wifi_security_detect_observer.h" @@ -27,7 +28,7 @@ #include "wifi_log.h" #include "sta_interface.h" #include "sta_auto_connect_service.h" -#include "wifi_config_center.h" +#include "wifi_settings.h" #include "sta_service.h" #include "wifi_internal_msg.h" #include "wifi_telephony_utils.h" @@ -114,11 +115,11 @@ public: void StaServerFuzzTest(const uint8_t* data, size_t size) { - int isRemoveAll = 0; int index = 0; int networkId = static_cast(data[index++]); int uid = static_cast(data[index++]); bool attemptEnable = (static_cast(data[0]) % TWO) ? true : false; + bool isRemoveAll = (static_cast(data[0]) % TWO) ? true : false; bool isAllowed = (static_cast(data[0]) % TWO) ? true : false; std::string cmd = std::string(reinterpret_cast(data), size); std::string conditionName = std::string(reinterpret_cast(data), size); -- Gitee From e7f7a4c60a579d29606c4c63376647c1c3b9da9e Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 7 Aug 2025 11:01:17 +0000 Subject: [PATCH 16/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_manage/unittest/wifi_power_state_listener_test.cpp | 2 +- .../wifi_manage/unittest/wifi_power_state_listener_test.h | 2 +- .../wifi_toolkit/unittest/network_parser_test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp index 919f8b069..82d6d9afa 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h index 956623564..cc12d2a86 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/network_parser_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/network_parser_test.cpp index 32ece3f3e..622cbfb5a 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/network_parser_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/network_parser_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. + * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at -- Gitee From bddde91eb09587b18a968194edb410564c01680f Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Mon, 11 Aug 2025 07:26:08 +0000 Subject: [PATCH 17/31] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20wi?= =?UTF-8?q?fi/test/wifi=5Fstandard/wifi=5Fframework/wifi=5Fmanage/unittest?= =?UTF-8?q?/common/wifi=5Fconfig=5Fupdate=5Ftest.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/wifi_config_update_test.cpp | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_config_update_test.cpp diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_config_update_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_config_update_test.cpp deleted file mode 100644 index 41fed3bc4..000000000 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_config_update_test.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include -#include -#include "wifi_log.h" -#include "wifi_logger.h" -#include "wifi_config_update.h" -using namespace OHOS; -using namespace OHOS::Wifi; -using namespace testing; -using ::testing::_; -using ::testing::DoAll; -using ::testing::Eq; -using ::testing::Return; -using ::testing::SetArgReferee; -using ::testing::StrEq; -using ::testing::TypedEq; -using ::testing::ext::TestSize; - - -class WifiConfigUpdateTest : public Test { -public: - void SetUp() {} - void TearDown() {} - -protected: - WifiConfigUpdate wifiConfigUpdate; -}; - -HWTEST_F(WifiConfigUpdateTest, LibUtilsTest, TestSize.Level1) -{ - void* handleTest; - LibraryUtils libUtils("libwifi_config_update.z.so", handleTest, false); - using SaveWifiConfigFunc = void(*)(const char*, const char*, const char*); - SaveWifiConfigFunc saveWifiConfigTest = (SaveWifiConfigFunc)libUtils.GetFunc("SaveWifiConfiguration"); - ASSERT_NE(handleTest, nullptr); -} - -HWTEST_F(WifiConfigUpdateTest, SaveWifiConfig, TestSize.Level1) -{ - const char* ssid = "TestSSID"; - const char* keyMgmt = "WPA-PSK"; - const char* preSharedKey = "TestPassword"; - wifiConfigUpdate.SaveWifiConfig(ssid, keyMgmt, preSharedKey); - EXPECT_NE(wifiConfigUpdate.handle_, nullptr); -} - -- Gitee From 184f1dc4809f151480721f4e887810daa7b0ea77 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Mon, 11 Aug 2025 09:01:38 +0000 Subject: [PATCH 18/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn | 2 -- 1 file changed, 2 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn index e47c444a4..2f93e6ffa 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn @@ -43,7 +43,6 @@ ohos_unittest("manager_unittest") { "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_auth_center.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_channel_helper.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_cmd_client.cpp", - "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_config_update.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_country_code/wifi_country_code_manager.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_country_code/wifi_country_code_policy.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_dumper.cpp", @@ -112,7 +111,6 @@ ohos_unittest("manager_unittest") { "common/wifi_auth_center_test.cpp", "common/wifi_channel_helper_test.cpp", "common/wifi_cmd_client_test.cpp", - "common/wifi_config_update_test.cpp", "common/wifi_country_code_manager_test.cpp", "common/wifi_country_code_policy_test.cpp", "common/wifi_datashare_utils_test.cpp", -- Gitee From 44ae4432df93f703fa8d956358a0735d5177cd4f Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Mon, 11 Aug 2025 11:40:18 +0000 Subject: [PATCH 19/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn index f0b44d4e5..59a3dce88 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn @@ -52,7 +52,6 @@ local_base_sources = [ "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_auth_center.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_channel_helper.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_cmd_client.cpp", - "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_config_update.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_country_code/wifi_country_code_manager.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_country_code/wifi_country_code_policy.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_common/wifi_internal_event_dispatcher.cpp", -- Gitee From d913a84ec2bc76471407d62aa69841820eacc849 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Mon, 11 Aug 2025 12:43:01 +0000 Subject: [PATCH 20/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> -- Gitee From e087eed064bb02bdc18d2e50ad2c163f15f9951f Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 01:46:56 +0000 Subject: [PATCH 21/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../unittest/common/wifi_net_agent_test.cpp | 21 ++++++++++++++++++- .../wifi_sta/Mock/net_conn_client.cpp | 6 ++++++ .../wifi_sta/Mock/net_conn_client.h | 3 +++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp index 080216419..cb9b56323 100755 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp @@ -54,7 +54,17 @@ HWTEST_F(WifiNetAgentTest, RegisterNetSupplier_ReturnsFalseWhenRegistrationFails EXPECT_FALSE(WifiNetAgent::GetInstance().RegisterNetSupplier(instId)); } -HWTEST_F(WifiNetAgentTest, RegisterNetSupplierCallback_ReturnsFalseWhenRegistrationFails, TestSize.Level1) +HWTEST_F(WifiNetAgentTest, RegisterNetConnObserverTest_ReturnsFalseWhenRegistrationFails, TestSize.Level1) +{ + EXPECT_TRUE(WifiNetAgent::GetInstance().RegisterNetConnObserver(INSTID_WLAN0)); +} + +HWTEST_F(WifiNetAgentTest, RegisterNetConnObserverTest_ReturnTrueWhenRegistrationSuccess, TestSize.Level1) +{ + EXPECT_FALSE(WifiNetAgent::GetInstance().RegisterNetConnObserver(INSTID_WLAN1)); +} + +HWTEST_F(WifiNetAgentTest, RegisterNetSupplierCallback_ReturnFalseWhenRegistrationFails, TestSize.Level1) { int instId = 0; EXPECT_FALSE(WifiNetAgent::GetInstance().RegisterNetSupplierCallback(instId)); @@ -271,6 +281,15 @@ HWTEST_F(WifiNetAgentTest, RequestNetworkTest002, TestSize.Level1) HWTEST_F(WifiNetAgentTest, ReleaseNetworkTest001, TestSize.Level1) { WifiNetAgent::NetConnCallback netConnCallback; + NetManagerStandard::NetRequest netrequest; + EXPECT_EQ(netConnCallback.ReleaseNetwork(netrequest), 0); +} + +HWTEST_F(WifiNetAgentTest, NetAvailableTest001, TestSize.Level1) +{ + WifiNetAgent::NetInfoObserver netConnCallback; + sptr netHandle = new NetManagerStandard::NetHandle(); + EXPECT_EQ(netConnCallback.NetAvailable(netHandle), 0); std::string ident = ""; std::set netCaps; EXPECT_EQ(netConnCallback.ReleaseNetwork(ident, netCaps), 0); diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp index 81d4bf566..c80404220 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.cpp @@ -35,6 +35,12 @@ int32_t NetConnClient::RegisterNetSupplierCallback(uint32_t supplierId, const sp return NETMANAGER; } +int32_t NetConnClient::RegisterNetConnCallback(const sptr &netSpecifier, + const sptr callback, const uint32_t &timeoutMS) +{ + return NETMANAGER; +} + int32_t NetConnClient::UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo) { return NETMANAGER; diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h index 77f0cf14d..8db6ddd28 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h @@ -32,6 +32,9 @@ public: int32_t RegisterNetSupplierCallback(uint32_t supplierId, const sptr &callback); + int32_t RegisterNetConnCallback(const sptr &netSpecifier, const sptr callback, + const uint32_t &timeoutMS); + int32_t UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo); int32_t UpdateNetLinkInfo(uint32_t supplierId, const sptr &netLinkInfo); -- Gitee From 07c3d22a7a48c7510445528cbcb5e04eac8a2434 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 01:57:26 +0000 Subject: [PATCH 22/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp | 6 ++++++ wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp index 56766ab01..2c3247c9e 100644 --- a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp +++ b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.cpp @@ -35,6 +35,12 @@ int32_t NetConnClient::RegisterNetSupplierCallback(uint32_t supplierId, const sp return NETMANAGER; } +int32_t NetConnClient::RegisterNetConnCallback(const sptr &netSpecifier, + const sptr callback, const uint32_t &timeoutMS) +{ + return NETMANAGER; +} + int32_t NetConnClient::UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo) { return NETMANAGER; diff --git a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h index 88aab09c4..d825df94f 100644 --- a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h +++ b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h @@ -31,6 +31,9 @@ public: int32_t RegisterNetSupplierCallback(uint32_t supplierId, const sptr &callback); + int32_t RegisterNetConnCallback(const sptr &netSpecifier, const sptr callback, + const uint32_t &timeoutMS); + int32_t UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo); int32_t UpdateNetLinkInfo(uint32_t supplierId, const sptr &netLinkInfo); -- Gitee From e4a5da2f56921f43f71101a1d4acf101354262e9 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 01:58:40 +0000 Subject: [PATCH 23/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h index d825df94f..61adb6d0f 100644 --- a/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h +++ b/wifi/test/fuzztest/fuzz_common_func/mock_netconn_client.h @@ -32,7 +32,7 @@ public: int32_t RegisterNetSupplierCallback(uint32_t supplierId, const sptr &callback); int32_t RegisterNetConnCallback(const sptr &netSpecifier, const sptr callback, - const uint32_t &timeoutMS); + const uint32_t &timeoutMS); int32_t UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo); -- Gitee From 483404e33f13fe7481b48fc17f8b75a563ae0d21 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 02:24:33 +0000 Subject: [PATCH 24/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_toolkit/unittest/Mock/mock_wifi_config_center.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.h b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.h index c44df95e1..5f500392f 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.h +++ b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/Mock/mock_wifi_config_center.h @@ -172,6 +172,8 @@ public: virtual int GetP2pEnhanceFreq() = 0; virtual bool IsNeedFastScan(void) = 0; virtual void SetFastScan(bool fastScan) = 0; + virtual void SetAutoConnect(bool autoConnectEnable) = 0; + virtual bool GetAutoConnect() = 0; virtual HotspotMode GetHotspotMode() = 0; virtual void SetHotspotMode(const HotspotMode &mode) = 0; virtual int GetLocalOnlyHotspotConfig(HotspotConfig &hotspotConfig) = 0; @@ -332,6 +334,8 @@ public: MOCK_CONST_METHOD0(GetWifiSelfcureResetEntered, bool()); MOCK_METHOD0(IsNeedFastScan, bool()); MOCK_METHOD1(SetFastScan, void(bool fastScan)); + MOCK_METHOD1(SetAutoConnect, void(bool)); + MOCK_METHOD0(GetAutoConnect, bool()); MOCK_METHOD0(GetHotspotMode, HotspotMode()); MOCK_METHOD1(SetHotspotMode, void(const HotspotMode &mode)); MOCK_METHOD1(GetLocalOnlyHotspotConfig, int(HotspotConfig &hotspotConfig)); -- Gitee From 9bf244e8ea4960c7328b954b4f58ffeda56bfd1e Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 02:33:39 +0000 Subject: [PATCH 25/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../unittest/wifi_manager_test.cpp | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp index 11fe6d1f6..c1bb8b66b 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp @@ -35,6 +35,7 @@ using ::testing::Ref; using ::testing::Return; using ::testing::SetArgReferee; using ::testing::StrEq; + using ::testing::TypedEq; using ::testing::ext::TestSize; DEFINE_WIFILOG_LABEL("WifiManagerTest"); @@ -200,10 +201,23 @@ HWTEST_F(WifiManagerTest, CheckAndStopScanServiceTest, TestSize.Level1) wifiManager.wifiScanManager->CheckAndStopScanService(); } -HWTEST_F(WifiManagerTest, DealScanInfoNotifyTest, TestSize.Level1) +HWTEST_F(WifiManagerTest, DealScanInfoNotifyTest_001, TestSize.Level1) +{ + WIFI_LOGI("DealScanInfoNotifyTest_001 enter!"); + std::vector results; + EXPECT_CALL(WifiConfigCenter::GetInstance(), GetAutoConnect()) + .WillOnce(DoAll(Return(true))); + EXPECT_CALL(WifiConfigCenter::GetInstance(), GetWifiMidState(_)) + .WillOnce(DoAll(Return(WifiOprMidState::RUNNING))); + wifiManager.wifiScanManager->DealScanInfoNotify(results); +} + +HWTEST_F(WifiManagerTest, DealScanInfoNotifyTest_002, TestSize.Level1) { - WIFI_LOGI("DealScanInfoNotifyTest enter!"); + WIFI_LOGI("DealScanInfoNotifyTest_002 enter!"); std::vector results; + EXPECT_CALL(WifiConfigCenter::GetInstance(), GetAutoConnect()) + .WillOnce(DoAll(Return(false))); EXPECT_CALL(WifiConfigCenter::GetInstance(), GetWifiMidState(_)) .WillOnce(DoAll(Return(WifiOprMidState::RUNNING))); wifiManager.wifiScanManager->DealScanInfoNotify(results); @@ -625,7 +639,7 @@ HWTEST_F(WifiManagerTest, IsInterfaceUpTest, TestSize.Level1) WIFI_LOGI("IsInterfaceUpTest enter!"); std::string iface = "wlan0"; wifiManager.wifiTogglerManager->IsInterfaceUp(iface); - EXPECT_TRUE(wifiManager.wifiTogglerManager->IsInterfaceUp(iface)); + EXPECT_FALSE(wifiManager.wifiTogglerManager->IsInterfaceUp(iface)); } HWTEST_F(WifiManagerTest, OnNativeProcessStatusChange_WpaDeath, TestSize.Level1) -- Gitee From e6ec50979dc599a9f32aa5ef867d298b58a54ded Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 02:34:45 +0000 Subject: [PATCH 26/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp index c1bb8b66b..2e6ceae9e 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_manager_test.cpp @@ -35,7 +35,6 @@ using ::testing::Ref; using ::testing::Return; using ::testing::SetArgReferee; using ::testing::StrEq; - using ::testing::TypedEq; using ::testing::ext::TestSize; DEFINE_WIFILOG_LABEL("WifiManagerTest"); -- Gitee From 22d7192f203de9a98708a54df7cf9337b18f3c5e Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 03:08:39 +0000 Subject: [PATCH 27/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_manage/unittest/common/wifi_net_agent_test.cpp | 3 --- .../wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp index cb9b56323..be2c534df 100755 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/common/wifi_net_agent_test.cpp @@ -290,9 +290,6 @@ HWTEST_F(WifiNetAgentTest, NetAvailableTest001, TestSize.Level1) WifiNetAgent::NetInfoObserver netConnCallback; sptr netHandle = new NetManagerStandard::NetHandle(); EXPECT_EQ(netConnCallback.NetAvailable(netHandle), 0); - std::string ident = ""; - std::set netCaps; - EXPECT_EQ(netConnCallback.ReleaseNetwork(ident, netCaps), 0); } HWTEST_F(WifiNetAgentTest, LogNetCapsTest001, TestSize.Level1) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h index 8db6ddd28..85c54c582 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/net_conn_client.h @@ -33,7 +33,7 @@ public: int32_t RegisterNetSupplierCallback(uint32_t supplierId, const sptr &callback); int32_t RegisterNetConnCallback(const sptr &netSpecifier, const sptr callback, - const uint32_t &timeoutMS); + const uint32_t &timeoutMS); int32_t UpdateNetSupplierInfo(uint32_t supplierId, const sptr &netSupplierInfo); -- Gitee From 90ac830e3e936252ace52412f198a7834ce42cd9 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 03:45:42 +0000 Subject: [PATCH 28/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn index 2f93e6ffa..38b3e6476 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn @@ -70,6 +70,7 @@ ohos_unittest("manager_unittest") { "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_manager.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_util.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_proxy.c", + "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_p2p_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_sta_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_callback.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_client.cpp", -- Gitee From 82af80dd97ae01d82e312f7f5eae578675b7620e Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 03:47:31 +0000 Subject: [PATCH 29/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn index 38b3e6476..1ceb4a4af 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn @@ -69,8 +69,8 @@ ohos_unittest("manager_unittest") { "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_controller/wifi_service_scheduler.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_manager.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_util.c", + "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_p2p_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_proxy.c", - "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_p2p_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_sta_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_callback.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_client.cpp", -- Gitee From a7bc673b496628594f17ed952a549b8c171a7365 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Tue, 12 Aug 2025 03:47:31 +0000 Subject: [PATCH 30/31] 1 Signed-off-by: chen yi wen <15068825070@163.com> --- .../wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn index 38b3e6476..1ceb4a4af 100644 --- a/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn +++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/BUILD.gn @@ -69,8 +69,8 @@ ohos_unittest("manager_unittest") { "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_controller/wifi_service_scheduler.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_manager.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_util.c", + "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_p2p_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_proxy.c", - "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_p2p_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/hdi_interface/wifi_hdi_wpa_sta_impl.c", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_callback.cpp", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/client/hdi_client/wifi_hdi_wpa_client.cpp", -- Gitee From a2ca7c5b6fe23899463429a8ce5d1972b45b0980 Mon Sep 17 00:00:00 2001 From: chen yi wen <15068825070@163.com> Date: Thu, 14 Aug 2025 15:40:11 +0800 Subject: [PATCH 31/31] 11111 Signed-off-by: chen yi wen <15068825070@163.com> --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index effaf10bf..0b7b70654 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # communication\_wifi + + + - [Introduction](#section11660541593) - [Architecture](#section342962219551) - [Directory Structure](#section161941989596) -- Gitee