提交 323fc950 编写于 作者: W wkejing

【communication_lite】【master】XTS_wifisevice测试用例testHandleDeviceConfig优化

Signed-off-by: Nwkejing <wkejing9687@163.com>
上级 83dc0207
...@@ -390,16 +390,17 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testConnectDisConnect, Function | Mediu ...@@ -390,16 +390,17 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testConnectDisConnect, Function | Mediu
LITE_TEST_CASE(WifiServiceFuncTestSuite, testHandleDeviceConfig, Function | MediumTest | Level2) LITE_TEST_CASE(WifiServiceFuncTestSuite, testHandleDeviceConfig, Function | MediumTest | Level2)
{ {
int netId = 0; int netId = 0;
const char* ssid1 = "XtsTestWifi01"; const char* ssid0 = "TestWifi01";
const char* ssid[TEST_SSID_COUNT] = {"XtsTestWifi02", "XtsTestWifi03", "XtsTestWifi04", "XtsTestWifi05", "XtsTestWifi06", "XtsTestWifi07", "XtsTestWifi08", "XtsTestWifi09", "XtsTestWifi10"}; const char* ssid[TEST_SSID_COUNT] = {"TestWifi02", "TestWifi03", "TestWifi04", "TestWifi05", "TestWifi06",
const char* ssid11 = "XtsTestWifi11"; "TestWifi07", "TestWifi08", "TestWifi09", "TestWifi10"};
const char* ssid10 = "TestWifi11";
const char* info = "12345678"; const char* info = "12345678";
unsigned char bssid[WIFI_MAC_LEN] = {0xac, 0x75, 0x1d, 0xd8, 0x55, 0xc1}; unsigned char bssid[WIFI_MAC_LEN] = {0xac, 0x75, 0x1d, 0xd8, 0x55, 0xc1};
WifiDeviceConfig config = {0}; WifiDeviceConfig config = {0};
config.freq = 20; config.freq = 20;
config.securityType = WIFI_SEC_TYPE_SAE; config.securityType = WIFI_SEC_TYPE_SAE;
config.wapiPskType = WIFI_PSK_TYPE_ASCII; config.wapiPskType = WIFI_PSK_TYPE_ASCII;
int ret = strncpy_s(config.ssid, WIFI_MAX_SSID_LEN, ssid1, strlen(ssid1)); int ret = strncpy_s(config.ssid, WIFI_MAX_SSID_LEN, ssid0, strlen(ssid0));
TEST_ASSERT_EQUAL_INT(WIFI_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(WIFI_SUCCESS, ret);
ret = strncpy_s(config.preSharedKey, WIFI_MAX_KEY_LEN, info, strlen(info)); ret = strncpy_s(config.preSharedKey, WIFI_MAX_KEY_LEN, info, strlen(info));
TEST_ASSERT_EQUAL_INT(WIFI_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(WIFI_SUCCESS, ret);
...@@ -423,7 +424,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testHandleDeviceConfig, Function | Medi ...@@ -423,7 +424,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testHandleDeviceConfig, Function | Medi
} }
} }
ret = strncpy_s(config.ssid, WIFI_MAX_SSID_LEN, ssid11, strlen(ssid11)); ret = strncpy_s(config.ssid, WIFI_MAX_SSID_LEN, ssid10, strlen(ssid10));
TEST_ASSERT_EQUAL_INT(WIFI_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(WIFI_SUCCESS, ret);
ret = strncpy_s(config.preSharedKey, WIFI_MAX_KEY_LEN, info, strlen(info)); ret = strncpy_s(config.preSharedKey, WIFI_MAX_KEY_LEN, info, strlen(info));
TEST_ASSERT_EQUAL_INT(WIFI_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(WIFI_SUCCESS, ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册