diff --git a/README.md b/README.md
index effaf10bfd154ec1d1f3ec1fe77346c919850561..0b7b70654a928e7436e92b1748e7c50f1b2905c7 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,8 @@
# communication\_wifi
+
+
+
- [Introduction](#section11660541593)
- [Architecture](#section342962219551)
- [Directory Structure](#section161941989596)
diff --git a/wifi/test/fuzztest/wifi_sta/wifihotspotimpl_fuzzer/BUILD.gn b/wifi/test/fuzztest/wifi_sta/wifihotspotimpl_fuzzer/BUILD.gn
index 4abeaf3582c19b2a838f2820d117d0bac1138c70..4f15c1f0b2359cad75de583e8518f3c1f5ffb3aa 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 3b26f0e31eeb12bdb13d2a0f3d41da9c0999cc04..656f7e11de6a44908dc45180619c3c5453e5b40d 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 fbadee05c8f0e9357e9fb9b588173f842cdcab6c..07e09c44c1662d29fbe50893c5a46a76fd472e5e 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);
diff --git a/wifi/test/wifi_standard/precompiled_macro/BUILD.gn b/wifi/test/wifi_standard/precompiled_macro/BUILD.gn
index 71a20587d1399983cbbc86c708be5d84bc796871..176443ea6966696176e53a8e049f09a269d8b5d1 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",]
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 8fd25d008ee43be73237a83e0ff4a905e7fdbfc2..5b3d8d0af2a3816b0e585f993b4c3570d49bdb5f 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/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 76cad91085514eb5f39b2c7856cfa3fce8ebce30..e33ceea19fd7f5c660c6869835dbcd9ed507027a 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/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 0000000000000000000000000000000000000000..82d6d9afa8e3e1f9f6a4b94c2a3bfcff5f8219c2
--- /dev/null
+++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.cpp
@@ -0,0 +1,71 @@
+/*
+ * 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
+ *
+ * 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 0000000000000000000000000000000000000000..cc12d2a86dcbd3a67a4236e8a6268bb6492eb679
--- /dev/null
+++ b/wifi/test/wifi_standard/wifi_framework/wifi_manage/unittest/wifi_power_state_listener_test.h
@@ -0,0 +1,31 @@
+/*
+ * 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
+ *
+ * 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
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 81ad1c3112645abaffb3856d62dcbdee62b93583..0d365cd73094b73adc2ccff4c2f955c912794dfe 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_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 fdd2e419f9de461c1a34cca708538ab1bb0d7b33..2e931a1bf2c040262d77365604e10fd8a20b6c02 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 cf9d20739e320a3a30f4347ac4c4c20c0991d466..4b74caf03112085a6ceae92c5689498d68ab5953 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)
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 1da04ea738244b652afd8ec25667179fcf8c4f82..d5345cef3587120a6d021136b188ef8a9560086d 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_manage/wifi_sta/BUILD.gn b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/BUILD.gn
index 74f6ca78d97f2eb6609435e7ea296ad16a847788..59a3dce8863be2ae572c21e592920a512a9d5647 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
@@ -97,6 +97,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 +163,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 +185,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/Mock/mock_sta_interface.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/Mock/mock_sta_interface.cpp
index e180d7e1ad9db4cfd00dad03f6831a6f176d5ac8..ccae311eb43cc7c37d5b226887c44fd4a10c9102 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_manage/wifi_sta/multi_gateway_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/multi_gateway_test.cpp
index cfbdb683421915a18817e94abc7c55f36229d939..912843576556faf562cf3a2142ef8c6f2be7a306 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());
}
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 7060a23a7af8d71a1ac7db7e0869852dd426c887..c9a67ee5b0eca1fda884cd98e08b5bb13bab8ac0 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 b16c5dce962f28afb97f148865400e8e9ee6254f..108e7d14d98d9c7de388f0a62892af076d87d9c5 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_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 772ca8d4cb2d2a4cd983f47caa0877e4a4ecf85c..9baa2ce1fca59980da078b67ff13e2e0e6839be7 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_service_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_manage/wifi_sta/sta_service_test.cpp
index 11dc34e7117fb8205163e261d6a0df2afb8b8173..459f057b5ce708f99ced9c8af8c63a1ffe80e8a9 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)));
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 9514afb632248d4178893caa7ab88d47b40a0545..1b769a5b6545bb294f6fedfad2ede74ffa41bf5f 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();
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 8cc40c1fa4421458a7a2b5bc5b03a0b207760145..e14ccefc2c7984defe9b0a601cda7d83460f9604 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 ddf7c220693cebe9df9272de474d009e683df396..d1bd60c6e2bd96cca315b16d2e20cb8d14bfcf84 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 29882b99f0eb8eccb3073a204cb6c6ae3377741f..e9c527c60da04fa8055b173f3a1d1223ce401607 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"]
}
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 e55dce910a72b77e486c0ee6918918c25d2c1617..5f500392f17f339f4fd2a8e7d85a80d9be1b47ae 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
@@ -350,4 +350,4 @@ private:
};
} // namespace OHOS
} // namespace Wifi
-#endif
\ No newline at end of file
+#endif
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 bd1c75b44336156933e159a3d4c6f7e1cd551fcd..622cbfb5a0b151b095ee1abbba94f71387dfac99 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) 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/wifi_settings_test.cpp b/wifi/test/wifi_standard/wifi_framework/wifi_toolkit/unittest/wifi_settings_test.cpp
index 941b5609d33f628fb44d44374619eca822a75bb5..4a6e44295b47fea05021d3bddb5f00132e3e9a10 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 a417a43102140500706aca2b42dbc387b17238b3..33e06877b7acc328b9d48ad606ad8dc99347b61f 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,并解压其中的五个文件夹。解压成如下如所示即可。

-
- 7. 如果更新的sdk版本大于12,将build-profile.json5中的"compileSdkVersion" 更新为新的版本号,例如:"compileSdkVersion": 14, 。
-
- 
-
-
+
+7. 如果更新的sdk版本大于12,将build-profile.json5中的"compileSdkVersion" 更新为新的版本号,例如:"compileSdkVersion": 14, 。
+
+ 
#### 如何导入程序
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 9b8d5200da7ba189a359ff23f447366dba597de8..2e310ee81b498dc74ba6e7cdafd4f18f3b6a345b 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)
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 4663a91354eb39c3832f99cbd8592f66376d1115..092c24c1a2729a85fe8f66b4555f4bf023ae918b 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----------"