提交 dc6e7919 编写于 作者: Z zhangpa2021

检视问题整改

Signed-off-by: Nzhangpa2021 <zhangpan70@huawei.com>
上级 2f881fc7
/*
* Copyright (c) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
......
/*
* Copyright (c) 2022 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.
*/
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2022 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
......@@ -13,8 +13,6 @@
* limitations under the License.
*/
import app from '@system.app'
import {Core} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
......
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Copyright (c) 2022 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
......
......@@ -135,7 +135,7 @@ static void CommTcpClientTask(void)
"client:!!@@##$$%%^^&&**(()),FD:[%d]", "client:(((112233445566778899))),FD:[%d]", "bye"};
for (int i = 0; i < count; i++) {
sleep(ONE_SECOND);
memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
(viod) memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
rst = sprintf_s(dataBuf, sizeof(dataBuf), sendMsgList[i], clnFd);
if (rst < 0) {
printf("[comm client]sprintf_s error!\n");
......@@ -146,7 +146,7 @@ static void CommTcpClientTask(void)
if (rst <= 0) {
printf("[comm client][%d]send fail\n", clnFd);
}
memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
(viod) memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
rst = recv(clnFd, dataBuf, sizeof(dataBuf), 0);
if (rst > 0) {
printf("[comm client][%d]recv msg[%s]\n", clnFd, dataBuf);
......@@ -185,14 +185,14 @@ static void SampleTcpServerTask(void)
TEST_ASSERT_NOT_EQUAL(LWIP_TEST_FAIL, clientFd);
int srvMsgLen = strlen(SRV_MSG);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, SRV_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
ret = send(clientFd, buf, srvMsgLen, 0);
printf("[tcp server]send, ret=%d\n", ret);
TEST_ASSERT_EQUAL_INT(srvMsgLen, ret);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = recv(clientFd, buf, sizeof(buf), 0);
printf("[tcp server]recv, ret=%d\n", ret);
TEST_ASSERT_EQUAL_INT(strlen(CLI_MSG), ret);
......@@ -202,7 +202,7 @@ static void SampleTcpServerTask(void)
clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(PEER_IP);
clnAddr.sin_port = htons(PEER_PORT);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, SRV_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
msg.msg_name = &clnAddr;
......@@ -218,7 +218,7 @@ static void SampleTcpServerTask(void)
TEST_ASSERT_EQUAL_INT(len * srvMsgLen, ret);
WaitServer();
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
int recvSum = 0;
int recvTimes = 50;
while (recvTimes > 0) {
......@@ -282,14 +282,14 @@ static void SampleTcpClientTask(void)
TEST_ASSERT_EQUAL_INT(inet_addr(STACK_IP), ((struct sockaddr_in*)&addr)->sin_addr.s_addr);
int cliMsgLen = strlen(CLI_MSG);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, CLI_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
ret = send(clientFd, buf, cliMsgLen, 0);
printf("[tcp client]send, ret=%d\n", ret);
TEST_ASSERT_EQUAL_INT(cliMsgLen, ret);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = recv(clientFd, buf, sizeof(buf), 0);
printf("[tcp client]recv,ret=%d\n", ret);
TEST_ASSERT_EQUAL_INT(strlen(SRV_MSG), ret);
......@@ -299,7 +299,7 @@ static void SampleTcpClientTask(void)
clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(PEER_IP);
clnAddr.sin_port = htons(PEER_PORT);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, CLI_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
msg.msg_name = &clnAddr;
......@@ -315,7 +315,7 @@ static void SampleTcpClientTask(void)
TEST_ASSERT_EQUAL_INT(len * cliMsgLen, ret);
WaitClient();
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
int recvSum = 0;
int recvTimes = 50;
while (recvTimes > 0) {
......@@ -405,7 +405,7 @@ static void SelectServerTask(void)
continue;
}
if (FD_ISSET(fds[i], &readSet)) {
memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
(viod) memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
int len = recv(fds[i], dataBuf, sizeof(dataBuf), 0);
if (len > 0) {
printf("[select process][%d]recv msg[%s]\n", fds[i], dataBuf);
......@@ -588,20 +588,20 @@ LITE_TEST_CASE(LwipFuncTestSuite, testUdp, Function | MediumTest | Level2)
clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(PEER_IP);
clnAddr.sin_port = htons(PEER_PORT);
memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(g_buf, BUF_SIZE, UDP_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
ret = sendto(fd, g_buf, strlen(UDP_MSG), 0, (struct sockaddr*)&clnAddr, (socklen_t)sizeof(clnAddr));
TEST_ASSERT_NOT_EQUAL(LWIP_TEST_FAIL, ret);
memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE);
ret = recvfrom(fd, g_buf, sizeof(g_buf), 0, (struct sockaddr*)&clnAddr, &clnAddrLen);
TEST_ASSERT_EQUAL_INT(strlen(UDP_MSG), ret);
clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(PEER_IP);
clnAddr.sin_port = htons(PEER_PORT);
memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(g_buf, BUF_SIZE, UDP_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
msg.msg_name = &clnAddr;
......@@ -720,7 +720,7 @@ LITE_TEST_CASE(LwipFuncTestSuite, testSocketOpt, Function | MediumTest | Level2)
ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, len);
TEST_ASSERT_EQUAL_INT(0, ret);
memset_s(&timeout, len, 0, len);
(viod) memset_s(&timeout, len, 0, len);
ret = getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, &len);
TEST_ASSERT_EQUAL_INT(0, ret);
TEST_ASSERT_EQUAL_INT(1000, timeout.tv_sec);
......
......@@ -120,7 +120,7 @@ static void* CommTcpClientTask(void* param)
"client:!!@@##$$%%^^&&**(()),FD:[%d]", "client:(((112233445566778899))),FD:[%d]", "bye"};
for (int i = 0; i < count; i++) {
sleep(sleepSecond);
memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
(viod) memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
rst = sprintf_s(dataBuf, sizeof(dataBuf), sendMsgList[i], clnFd);
if (rst < 0) {
printf("[comm client]sprintf_s error!\n");
......@@ -131,7 +131,7 @@ static void* CommTcpClientTask(void* param)
*ret = -1;
printf("[comm client][%d]send fail\n", clnFd);
}
memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
(viod) memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
rst = recv(clnFd, dataBuf, sizeof(dataBuf), 0);
if (rst > 0) {
printf("[comm client][%d]recv msg[%s]\n", clnFd, dataBuf);
......@@ -182,14 +182,14 @@ static void* SampleTcpServerTask(void* p)
static char buf[BUF_SIZE + 1] = {0};
unsigned int srvMsgLen = strlen(g_srvMsg);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, g_srvMsg);
EXPECT_EQ(0, ret);
ret = send(clnFd, buf, srvMsgLen, 0);
printf("[tcp server]send, ret=%d\n", ret);
EXPECT_EQ(srvMsgLen, (unsigned int)ret);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = recv(clnFd, buf, sizeof(buf), 0);
printf("[tcp server]recv, ret=%d, msg[%s]\n", ret, buf);
EXPECT_EQ(strlen(g_cliMsg), (unsigned int)ret);
......@@ -201,7 +201,7 @@ static void* SampleTcpServerTask(void* p)
clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(g_localHost);
clnAddr.sin_port = htons(PEER_PORT);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, g_srvMsg);
EXPECT_EQ(0, ret);
msg.msg_name = &clnAddr;
......@@ -217,8 +217,8 @@ static void* SampleTcpServerTask(void* p)
EXPECT_EQ(len * srvMsgLen, (unsigned int)ret);
WAIT();
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
memset_s(&msg, sizeof(msg), 0, sizeof(msg));
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(&msg, sizeof(msg), 0, sizeof(msg));
msg.msg_name = &clnAddr;
msg.msg_namelen = sizeof(clnAddr);
msg.msg_iov = iov;
......@@ -270,14 +270,14 @@ static void* SampleTcpClientTask(void* p)
static char buf[BUF_SIZE + 1] = {0};
unsigned int cliMsgLen = strlen(g_cliMsg);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, g_cliMsg);
EXPECT_EQ(0, ret);
ret = send(clnFd, buf, cliMsgLen, 0);
printf("[tcp client]send, ret=%d\n", ret);
EXPECT_EQ(cliMsgLen, (unsigned int)ret);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = recv(clnFd, buf, sizeof(buf), 0);
printf("[tcp client]recv, ret=%d, msg[%s]\n", ret, buf);
EXPECT_EQ(strlen(g_srvMsg), (unsigned int)ret);
......@@ -290,7 +290,7 @@ static void* SampleTcpClientTask(void* p)
clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(g_localHost);
clnAddr.sin_port = htons(PEER_PORT);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, g_cliMsg);
EXPECT_EQ(0, ret);
msg.msg_name = &clnAddr;
......@@ -306,8 +306,8 @@ static void* SampleTcpClientTask(void* p)
EXPECT_EQ(len * cliMsgLen, (unsigned int)ret);
WAIT();
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
memset_s(&msg, sizeof(msg), 0, sizeof(msg));
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(&msg, sizeof(msg), 0, sizeof(msg));
msg.msg_name = &clnAddr;
msg.msg_namelen = sizeof(clnAddr);
msg.msg_iov = iov;
......@@ -344,7 +344,7 @@ static int TcpServerForFork()
goto FINALLY;
}
while (timeout > 0) {
memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
(viod) memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
ret = recv(cliFd, dataBuf, sizeof(dataBuf), 0);
if (ret > 0) {
printf("[server process]recv msg[%s]\n", dataBuf);
......@@ -355,7 +355,7 @@ static int TcpServerForFork()
} else {
printf("[server process]recv no data\n");
}
memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
(viod) memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
sprintf_s(dataBuf, sizeof(dataBuf), "server timeout:%d", timeout);
ret = send(cliFd, dataBuf, strlen(dataBuf), 0);
if (ret > 0) {
......@@ -466,7 +466,7 @@ static int SelectServerForFork(unsigned int timeoutSec)
continue;
}
if (FD_ISSET(fds[i], &readSet)) {
memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
(viod) memset_s(dataBuf, sizeof(dataBuf), 0, sizeof(dataBuf));
int len = recv(fds[i], dataBuf, sizeof(dataBuf), 0);
if (len > 0) {
printf("[select process][%d]recv msg[%s]\n", fds[i], dataBuf);
......@@ -550,20 +550,20 @@ HWTEST_F(ActsLwipTest, testUdpSample, Function | MediumTest | Level2)
clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(g_localHost);
clnAddr.sin_port = htons(PEER_PORT);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, g_udpMsg);
EXPECT_EQ(0, ret);
ret = sendto(sfd, buf, strlen(g_udpMsg), 0, (struct sockaddr*)&clnAddr, (socklen_t)sizeof(clnAddr));
EXPECT_NE(-1, ret);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = recvfrom(sfd, buf, sizeof(buf), 0, (struct sockaddr*)&clnAddr, &clnAddrLen);
EXPECT_EQ(strlen(g_udpMsg), (unsigned int)ret);
clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(g_localHost);
clnAddr.sin_port = htons(PEER_PORT);
memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
(viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
ret = strcpy_s(buf, BUF_SIZE, g_udpMsg);
EXPECT_EQ(0, ret);
msg.msg_name = &clnAddr;
......@@ -761,7 +761,7 @@ HWTEST_F(ActsLwipTest, testSocketOpt, Function | MediumTest | Level2)
ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, len);
EXPECT_EQ(0, ret);
memset_s(&timeout, len, 0, len);
(viod) memset_s(&timeout, len, 0, len);
ret = getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, &len);
EXPECT_EQ(0, ret);
EXPECT_EQ(1000, timeout.tv_sec);
......
......@@ -595,10 +595,10 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanType, Function | MediumT
int freq = 2460;
WifiScanParams scanParams = {0};
char bssid[WIFI_MAC_LEN] = {0xac, 0x75, 0x1d, 0xd8, 0x55, 0xc1};
strcpy_s(scanParams.ssid, sizeof(scanParams.ssid), "wifi_service_xts");
(viod) strcpy_s(scanParams.ssid, sizeof(scanParams.ssid), "wifi_service_xts");
scanParams.ssidLen = strlen(scanParams.ssid);
scanParams.freqs = freq;
memcpy_s(scanParams.bssid, sizeof(scanParams.bssid), bssid, sizeof(bssid));
(viod) memcpy_s(scanParams.bssid, sizeof(scanParams.bssid), bssid, sizeof(bssid));
scanParams.scanType = WIFI_SSID_SCAN;
g_staScanSuccess = 0;
......@@ -676,7 +676,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam02, Function
WifiScanParams* scanParams = malloc(sizeof(WifiScanParams));
TEST_ASSERT_NOT_NULL(scanParams);
memset_s(scanParams, sizeof(WifiScanParams), 0, sizeof(WifiScanParams));
(viod) memset_s(scanParams, sizeof(WifiScanParams), 0, sizeof(WifiScanParams));
error = AdvanceScan(scanParams);
TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error);
......@@ -689,8 +689,8 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam02, Function
error = AdvanceScan(scanParams);
TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error);
memset_s(scanParams, sizeof(WifiScanParams), 0, sizeof(WifiScanParams));
strcpy_s(scanParams->ssid, sizeof(scanParams->ssid), "wifi_service_xts");
(viod) memset_s(scanParams, sizeof(WifiScanParams), 0, sizeof(WifiScanParams));
(viod) strcpy_s(scanParams->ssid, sizeof(scanParams->ssid), "wifi_service_xts");
scanParams->scanType = WIFI_SSID_SCAN;
error = AdvanceScan(scanParams);
TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error);
......@@ -721,7 +721,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam03, Function
WifiScanParams* scanParams = malloc(sizeof(WifiScanParams));
TEST_ASSERT_NOT_NULL(scanParams);
memset_s(scanParams, sizeof(WifiScanParams), 0, sizeof(WifiScanParams));
(viod) memset_s(scanParams, sizeof(WifiScanParams), 0, sizeof(WifiScanParams));
scanParams->scanType = WIFI_BAND_SCAN;
g_staScanSuccess = 0;
......@@ -739,7 +739,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam03, Function
TEST_ASSERT_EQUAL_INT(1, g_staScanSuccess);
char bssid[WIFI_MAC_LEN] = {0xac, 0x75, 0x1d, 0xd8, 0x55, 0xc1};
memcpy_s(scanParams->bssid, sizeof(scanParams->bssid), bssid, sizeof(bssid));
(viod) memcpy_s(scanParams->bssid, sizeof(scanParams->bssid), bssid, sizeof(bssid));
scanParams->scanType = WIFI_BSSID_SCAN;
g_staScanSuccess = 0;
error = AdvanceScan(scanParams);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册