mirror of
https://gitee.com/openharmony/communication_wifi.git
synced 2024-12-18 20:40:11 +00:00
增加UT test
Signed-off-by: yanghui <yanghui152@huawei.com>
This commit is contained in:
parent
a47aef7732
commit
f32dc74b0e
@ -50,8 +50,7 @@ constexpr auto IP_STATIC = "STATIC";
|
||||
constexpr auto PROXY_STATIC = "STATIC";
|
||||
constexpr auto PROXY_PAC = "PAC";
|
||||
static const std::string DEFAULT_BSSID = "00:00:00:00:00:00";
|
||||
static const std::string MULTICAST_MAC = "01:00:00:00:00:00";
|
||||
static const std::string LOCALLY_ASSIGNED_MAC = "02:00:00:00:00:00";
|
||||
static const std::string DEFAULT_MAC_ADDRESS = "02:00:00:00:00:00";
|
||||
|
||||
const std::unordered_map<std::string, WifiConfigType> g_wifiConfigMap = {
|
||||
{XML_TAG_SSID, WifiConfigType::SSID},
|
||||
@ -467,8 +466,7 @@ bool NetworkXmlParser::IsWifiConfigValid(WifiDeviceConfig wifiConfig)
|
||||
|
||||
bool NetworkXmlParser::IsRandomMacValid(WifiDeviceConfig wifiConfig)
|
||||
{
|
||||
if (wifiConfig.macAddress.empty() || wifiConfig.macAddress == MULTICAST_MAC ||
|
||||
wifiConfig.macAddress == LOCALLY_ASSIGNED_MAC) {
|
||||
if (wifiConfig.macAddress.empty() || wifiConfig.macAddress == DEFAULT_MAC_ADDRESS) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -184,6 +184,14 @@ HWTEST_F(NetworkParserTest, IsWifiConfigValidFalseTest, TestSize.Level1)
|
||||
EXPECT_FALSE(m_networkXmlParser->IsWifiConfigValid(wifiConfig));
|
||||
}
|
||||
|
||||
HWTEST_F(NetworkParserTest, IsRandomMacValidFalseTest, TestSize.Level1)
|
||||
{
|
||||
WIFI_LOGI("IsRandomMacValidFalseTest enter");
|
||||
WifiDeviceConfig wifiConfig;
|
||||
wifiConfig.macAddress = "02:00:00:00:00:00";
|
||||
EXPECT_FALSE(m_networkXmlParser->IsRandomMacValid(wifiConfig));
|
||||
}
|
||||
|
||||
HWTEST_F(NetworkParserTest, GetNetworksTest, TestSize.Level1)
|
||||
{
|
||||
WIFI_LOGI("GetNetworksTest enter");
|
||||
|
Loading…
Reference in New Issue
Block a user