未验证 提交 c2f0f13b 编写于 作者: O openharmony_ci 提交者: Gitee

!2727 修改软总线xts test.json

Merge pull request !2727 from zhangpan2021/master
...@@ -10,10 +10,15 @@ ...@@ -10,10 +10,15 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsRpcHapTest.hap" "ActsRpcHapTest.hap",
"./resource/dsoftbus/ipcserver/entry-release-standard-signed.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
} }
] ]
} }
/*
* 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 { .container {
flex-direction: column; flex-direction: column;
justify-content: center; 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"> <div class="container">
<text class="title"> <text class="title">
{{ $t('strings.hello') }} {{ 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
* limitations under the License. * limitations under the License.
*/ */
import app from '@system.app'
import {Core} from 'deccjsunit/index' import {Core} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global const injectRef = Object.getPrototypeOf(global) || global
......
...@@ -51,6 +51,8 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -51,6 +51,8 @@ describe('ActsRpcClientJsTest', function(){
const CODE_TRANSACTION = 27; const CODE_TRANSACTION = 27;
const CODE_IPCSKELETON = 28; const CODE_IPCSKELETON = 28;
const CODE_FILESDIR = 29; const CODE_FILESDIR = 29;
const CODE_WRITE_REMOTEOBJECTARRAY_1 = 30;
const CODE_WRITE_REMOTEOBJECTARRAY_2 = 31;
function connectAbility() { function connectAbility() {
let want = { let want = {
...@@ -125,8 +127,65 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -125,8 +127,65 @@ describe('ActsRpcClientJsTest', function(){
constructor(descriptor) { constructor(descriptor) {
super(descriptor) super(descriptor)
} }
onRemoteRequest(code, data, reply, option) {
console.info("TestAbilityStub: onRemoteRequest called, code: " + code)
let descriptor = data.readInterfaceToken()
if (descriptor !== "TestAbilityStub") {
console.error("received unknown descriptor: " + descriptor)
return false
}
switch (code) {
case 1:
{
let tmp1 = data.readByte()
let tmp2 = data.readByte()
let tmp3 = data.readShort()
let tmp4 = data.readShort()
let tmp5 = data.readInt()
let tmp6 = data.readInt()
let tmp7 = data.readLong()
let tmp8 = data.readLong()
let tmp9 = data.readFloat()
let tmp10 = data.readFloat()
let tmp11 = data.readDouble()
let tmp12 = data.readDouble()
let tmp13 = data.readBoolean()
let tmp14 = data.readBoolean()
let tmp15 = data.readChar()
let tmp16 = data.readString()
let s = new MySequenceable(null, null)
data.readSequenceable(s)
reply.writeNoException()
reply.writeByte(tmp1)
reply.writeByte(tmp2)
reply.writeShort(tmp3)
reply.writeShort(tmp4)
reply.writeInt(tmp5)
reply.writeInt(tmp6)
reply.writeLong(tmp7)
reply.writeLong(tmp8)
reply.writeFloat(tmp9)
reply.writeFloat(tmp10)
reply.writeDouble(tmp11)
reply.writeDouble(tmp12)
reply.writeBoolean(tmp13)
reply.writeBoolean(tmp14)
reply.writeChar(tmp15)
reply.writeString(tmp16)
reply.writeSequenceable(s)
return true
}
default:
{
console.error("default case, code: " + code)
return false
}
}
}
} }
class TestListener extends rpc.RemoteObject { class TestListener extends rpc.RemoteObject {
constructor(descriptor, checkResult) { constructor(descriptor, checkResult) {
super(descriptor); super(descriptor);
...@@ -1234,7 +1293,7 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -1234,7 +1293,7 @@ describe('ActsRpcClientJsTest', function(){
console.log("SUB_Softbus_IPC_MessageParcel_6000:run writeChar success, result is " + result); console.log("SUB_Softbus_IPC_MessageParcel_6000:run writeChar success, result is " + result);
expect(result == true).assertTrue() expect(result == true).assertTrue()
var readresult = data.readChar(); var readresult = data.readChar();
expect(result == 'a').assertTrue() expect(readresult == 'a').assertTrue()
} catch (error) { } catch (error) {
console.log("SUB_Softbus_IPC_MessageParcel_6000:error = " + error); console.log("SUB_Softbus_IPC_MessageParcel_6000:error = " + error);
...@@ -1707,20 +1766,6 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -1707,20 +1766,6 @@ describe('ActsRpcClientJsTest', function(){
var result = data.writeRawData(token, token.length); var result = data.writeRawData(token, token.length);
console.log("SUB_Softbus_IPC_MessageParcel_7300:run writeRawData success, result is " + result); console.log("SUB_Softbus_IPC_MessageParcel_7300:run writeRawData success, result is " + result);
expect(result == false).assertTrue(); expect(result == false).assertTrue();
if (gIRemoteObject == undefined)
{
console.log("SUB_Softbus_IPC_MessageParcel_7300: gIRemoteObject is undefined");
}
await gIRemoteObject.sendRequest(CODE_WRITE_RAWDATA, data, reply, option).then((result) => {
console.log("SUB_Softbus_IPC_MessageParcel_7300: sendRequest success, result is " + result.errCode);
var newReadResult = result.reply.readRawData(token.length);
expect(newReadResult[0] == token[0]).assertTrue();
expect(newReadResult[1] == token[1]).assertTrue();
expect(newReadResult[2] == token[2]).assertTrue();
expect(newReadResult[3] == token[3]).assertTrue();
expect(newReadResult[4] == token[4]).assertTrue();
});
data.reclaim(); data.reclaim();
reply.reclaim(); reply.reclaim();
done(); done();
...@@ -2579,7 +2624,9 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -2579,7 +2624,9 @@ describe('ActsRpcClientJsTest', function(){
reply.reclaim() reply.reclaim()
console.log("test done") console.log("test done")
}) })
}) console.log("---------------------end SUB_Softbus_IPC_MessageParcel_9300---------------------------");
})
/* /*
* @tc.number SUB_Softbus_IPC_MessageParcel_9400 * @tc.number SUB_Softbus_IPC_MessageParcel_9400
...@@ -2589,12 +2636,19 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -2589,12 +2636,19 @@ describe('ActsRpcClientJsTest', function(){
*/ */
it('SUB_Softbus_IPC_MessageParcel_9400', 0, async function(done) { it('SUB_Softbus_IPC_MessageParcel_9400', 0, async function(done) {
console.log("---------------------start SUB_Softbus_IPC_MessageParcel_9400---------------------------"); console.log("---------------------start SUB_Softbus_IPC_MessageParcel_9400---------------------------");
try{
function checkResult(num, str) { let count = 0;
expect(num).assertEqual(123) function checkResult(num, str) {
expect(str).assertEqual("rpcListenerTest") expect(num).assertEqual(123)
expect(str).assertEqual("rpcListenerTest")
count++
console.info("check result done, count: " + count)
if (count == 3) {
done() done()
} }
}
try{
let option = new rpc.MessageOption() let option = new rpc.MessageOption()
let data = rpc.MessageParcel.create() let data = rpc.MessageParcel.create()
let reply = rpc.MessageParcel.create() let reply = rpc.MessageParcel.create()
...@@ -2607,20 +2661,20 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -2607,20 +2661,20 @@ describe('ActsRpcClientJsTest', function(){
console.info("SUB_Softbus_IPC_MessageParcel_9400 result is:" + result) console.info("SUB_Softbus_IPC_MessageParcel_9400 result is:" + result)
expect(data.writeInt(123)).assertTrue() expect(data.writeInt(123)).assertTrue()
expect(data.writeString("rpcListenerTest")).assertTrue() expect(data.writeString("rpcListenerTest")).assertTrue()
await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option) await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY_1, data, reply, option)
.then(function(result) { .then( ( result) => {
console.info("SUB_Softbus_IPC_MessageParcel_9400: sendRequest done, error code: " + result.errCode) console.info("SUB_Softbus_IPC_MessageParcel_9500:sendRequest done, error code: " + result.errCode)
expect(result.errCode).assertEqual(0) expect(result.errCode).assertEqual(0)
}) })
.catch(function(e) { .catch(function(e) {
console.error("SUB_Softbus_IPC_MessageParcel_9400: send request got exception: " + e) console.error("SUB_Softbus_IPC_MessageParcel_9400: send request got exception: " + e)
expect(0).assertEqual(1) expect(0).assertEqual(1)
}) })
.finally(() => { .finally(() => {
data.reclaim() data.reclaim()
reply.reclaim() reply.reclaim()
console.log("test done") console.log("test done")
}) })
done(); done();
data.reclaim(); data.reclaim();
reply.reclaim(); reply.reclaim();
...@@ -2639,12 +2693,18 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -2639,12 +2693,18 @@ describe('ActsRpcClientJsTest', function(){
*/ */
it('SUB_Softbus_IPC_MessageParcel_9500', 0, async function(done) { it('SUB_Softbus_IPC_MessageParcel_9500', 0, async function(done) {
console.log("---------------------start SUB_Softbus_IPC_MessageParcel_9500---------------------------"); console.log("---------------------start SUB_Softbus_IPC_MessageParcel_9500---------------------------");
try{ let count = 0;
function checkResult(num, str) { function checkResult(num, str) {
expect(num).assertEqual(123) expect(num).assertEqual(123)
expect(str).assertEqual("rpcListenerTest") expect(str).assertEqual("rpcListenerTest")
count++
console.info("check result done, count: " + count)
if (count == 3) {
done() done()
} }
}
try{
let option = new rpc.MessageOption() let option = new rpc.MessageOption()
let data = rpc.MessageParcel.create() let data = rpc.MessageParcel.create()
let reply = rpc.MessageParcel.create() let reply = rpc.MessageParcel.create()
...@@ -2659,7 +2719,8 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -2659,7 +2719,8 @@ describe('ActsRpcClientJsTest', function(){
console.info("SUB_Softbus_IPC_MessageParcel_9500 result is:" + result) console.info("SUB_Softbus_IPC_MessageParcel_9500 result is:" + result)
expect(data.writeInt(123)).assertTrue() expect(data.writeInt(123)).assertTrue()
expect(data.writeString("rpcListenerTest")).assertTrue() expect(data.writeString("rpcListenerTest")).assertTrue()
gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option,(err, result) => { await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY_2, data, reply, option)
.then( ( result) => {
console.info("SUB_Softbus_IPC_MessageParcel_9500:sendRequest done, error code: " + result.errCode) console.info("SUB_Softbus_IPC_MessageParcel_9500:sendRequest done, error code: " + result.errCode)
expect(result.errCode).assertEqual(0) expect(result.errCode).assertEqual(0)
}) })
...@@ -2756,7 +2817,7 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -2756,7 +2817,7 @@ describe('ActsRpcClientJsTest', function(){
try{ try{
expect(rpc.MessageOption.TF_SYNC).assertEqual(0); expect(rpc.MessageOption.TF_SYNC).assertEqual(0);
expect(rpc.MessageOption.TF_AYNC).assertEqual(1); expect(rpc.MessageOption.TF_ASYNC).assertEqual(1);
expect(rpc.MessageOption.TF_WAIT_TIME).assertEqual(4); expect(rpc.MessageOption.TF_WAIT_TIME).assertEqual(4);
...@@ -3197,7 +3258,7 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -3197,7 +3258,7 @@ describe('ActsRpcClientJsTest', function(){
let size = bytes.length + 10; let size = bytes.length + 10;
let result = ashmem.writeToAshmem(bytes, 3, 0); let result = ashmem.writeToAshmem(bytes, 3, 0);
console.log("SUB_Softbus_IPC_Ashmem_1600: run writeToAshmem success, result is " + result); console.log("SUB_Softbus_IPC_Ashmem_1600: run writeToAshmem success, result is " + result);
expect(result == true).assertTrue() expect(result == true).assertTrue();
ashmem.closeAshmem() ashmem.closeAshmem()
...@@ -3873,7 +3934,7 @@ describe('ActsRpcClientJsTest', function(){ ...@@ -3873,7 +3934,7 @@ describe('ActsRpcClientJsTest', function(){
* @tc.desc Function test * @tc.desc Function test
* @tc.level 0 * @tc.level 0
*/ */
it("SUB_Softbus_IPC_RemoteProxy_0500", 0, async function(done){ it("SUB_Softbus_IPC_RemoteProxy_0500", 0, async function(){
console.log("SUB_Softbus_IPC_RemoteProxy_0500 is starting-------------") console.log("SUB_Softbus_IPC_RemoteProxy_0500 is starting-------------")
try { try {
......
# 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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
......
...@@ -135,7 +135,7 @@ static void CommTcpClientTask(void) ...@@ -135,7 +135,7 @@ static void CommTcpClientTask(void)
"client:!!@@##$$%%^^&&**(()),FD:[%d]", "client:(((112233445566778899))),FD:[%d]", "bye"}; "client:!!@@##$$%%^^&&**(()),FD:[%d]", "client:(((112233445566778899))),FD:[%d]", "bye"};
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
sleep(ONE_SECOND); 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); rst = sprintf_s(dataBuf, sizeof(dataBuf), sendMsgList[i], clnFd);
if (rst < 0) { if (rst < 0) {
printf("[comm client]sprintf_s error!\n"); printf("[comm client]sprintf_s error!\n");
...@@ -146,7 +146,7 @@ static void CommTcpClientTask(void) ...@@ -146,7 +146,7 @@ static void CommTcpClientTask(void)
if (rst <= 0) { if (rst <= 0) {
printf("[comm client][%d]send fail\n", clnFd); 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); rst = recv(clnFd, dataBuf, sizeof(dataBuf), 0);
if (rst > 0) { if (rst > 0) {
printf("[comm client][%d]recv msg[%s]\n", clnFd, dataBuf); printf("[comm client][%d]recv msg[%s]\n", clnFd, dataBuf);
...@@ -185,14 +185,14 @@ static void SampleTcpServerTask(void) ...@@ -185,14 +185,14 @@ static void SampleTcpServerTask(void)
TEST_ASSERT_NOT_EQUAL(LWIP_TEST_FAIL, clientFd); TEST_ASSERT_NOT_EQUAL(LWIP_TEST_FAIL, clientFd);
int srvMsgLen = strlen(SRV_MSG); 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); ret = strcpy_s(buf, BUF_SIZE, SRV_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
ret = send(clientFd, buf, srvMsgLen, 0); ret = send(clientFd, buf, srvMsgLen, 0);
printf("[tcp server]send, ret=%d\n", ret); printf("[tcp server]send, ret=%d\n", ret);
TEST_ASSERT_EQUAL_INT(srvMsgLen, 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); ret = recv(clientFd, buf, sizeof(buf), 0);
printf("[tcp server]recv, ret=%d\n", ret); printf("[tcp server]recv, ret=%d\n", ret);
TEST_ASSERT_EQUAL_INT(strlen(CLI_MSG), ret); TEST_ASSERT_EQUAL_INT(strlen(CLI_MSG), ret);
...@@ -202,7 +202,7 @@ static void SampleTcpServerTask(void) ...@@ -202,7 +202,7 @@ static void SampleTcpServerTask(void)
clnAddr.sin_family = AF_INET; clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(PEER_IP); clnAddr.sin_addr.s_addr = inet_addr(PEER_IP);
clnAddr.sin_port = htons(PEER_PORT); 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); ret = strcpy_s(buf, BUF_SIZE, SRV_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
msg.msg_name = &clnAddr; msg.msg_name = &clnAddr;
...@@ -218,7 +218,7 @@ static void SampleTcpServerTask(void) ...@@ -218,7 +218,7 @@ static void SampleTcpServerTask(void)
TEST_ASSERT_EQUAL_INT(len * srvMsgLen, ret); TEST_ASSERT_EQUAL_INT(len * srvMsgLen, ret);
WaitServer(); WaitServer();
memset_s(buf, BUF_SIZE, 0, BUF_SIZE); (viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
int recvSum = 0; int recvSum = 0;
int recvTimes = 50; int recvTimes = 50;
while (recvTimes > 0) { while (recvTimes > 0) {
...@@ -282,14 +282,14 @@ static void SampleTcpClientTask(void) ...@@ -282,14 +282,14 @@ static void SampleTcpClientTask(void)
TEST_ASSERT_EQUAL_INT(inet_addr(STACK_IP), ((struct sockaddr_in*)&addr)->sin_addr.s_addr); TEST_ASSERT_EQUAL_INT(inet_addr(STACK_IP), ((struct sockaddr_in*)&addr)->sin_addr.s_addr);
int cliMsgLen = strlen(CLI_MSG); 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); ret = strcpy_s(buf, BUF_SIZE, CLI_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
ret = send(clientFd, buf, cliMsgLen, 0); ret = send(clientFd, buf, cliMsgLen, 0);
printf("[tcp client]send, ret=%d\n", ret); printf("[tcp client]send, ret=%d\n", ret);
TEST_ASSERT_EQUAL_INT(cliMsgLen, 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); ret = recv(clientFd, buf, sizeof(buf), 0);
printf("[tcp client]recv,ret=%d\n", ret); printf("[tcp client]recv,ret=%d\n", ret);
TEST_ASSERT_EQUAL_INT(strlen(SRV_MSG), ret); TEST_ASSERT_EQUAL_INT(strlen(SRV_MSG), ret);
...@@ -299,7 +299,7 @@ static void SampleTcpClientTask(void) ...@@ -299,7 +299,7 @@ static void SampleTcpClientTask(void)
clnAddr.sin_family = AF_INET; clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(PEER_IP); clnAddr.sin_addr.s_addr = inet_addr(PEER_IP);
clnAddr.sin_port = htons(PEER_PORT); 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); ret = strcpy_s(buf, BUF_SIZE, CLI_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
msg.msg_name = &clnAddr; msg.msg_name = &clnAddr;
...@@ -315,7 +315,7 @@ static void SampleTcpClientTask(void) ...@@ -315,7 +315,7 @@ static void SampleTcpClientTask(void)
TEST_ASSERT_EQUAL_INT(len * cliMsgLen, ret); TEST_ASSERT_EQUAL_INT(len * cliMsgLen, ret);
WaitClient(); WaitClient();
memset_s(buf, BUF_SIZE, 0, BUF_SIZE); (viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
int recvSum = 0; int recvSum = 0;
int recvTimes = 50; int recvTimes = 50;
while (recvTimes > 0) { while (recvTimes > 0) {
...@@ -405,7 +405,7 @@ static void SelectServerTask(void) ...@@ -405,7 +405,7 @@ static void SelectServerTask(void)
continue; continue;
} }
if (FD_ISSET(fds[i], &readSet)) { 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); int len = recv(fds[i], dataBuf, sizeof(dataBuf), 0);
if (len > 0) { if (len > 0) {
printf("[select process][%d]recv msg[%s]\n", fds[i], dataBuf); printf("[select process][%d]recv msg[%s]\n", fds[i], dataBuf);
...@@ -588,20 +588,20 @@ LITE_TEST_CASE(LwipFuncTestSuite, testUdp, Function | MediumTest | Level2) ...@@ -588,20 +588,20 @@ LITE_TEST_CASE(LwipFuncTestSuite, testUdp, Function | MediumTest | Level2)
clnAddr.sin_family = AF_INET; clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(PEER_IP); clnAddr.sin_addr.s_addr = inet_addr(PEER_IP);
clnAddr.sin_port = htons(PEER_PORT); 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); ret = strcpy_s(g_buf, BUF_SIZE, UDP_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
ret = sendto(fd, g_buf, strlen(UDP_MSG), 0, (struct sockaddr*)&clnAddr, (socklen_t)sizeof(clnAddr)); ret = sendto(fd, g_buf, strlen(UDP_MSG), 0, (struct sockaddr*)&clnAddr, (socklen_t)sizeof(clnAddr));
TEST_ASSERT_NOT_EQUAL(LWIP_TEST_FAIL, ret); 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); ret = recvfrom(fd, g_buf, sizeof(g_buf), 0, (struct sockaddr*)&clnAddr, &clnAddrLen);
TEST_ASSERT_EQUAL_INT(strlen(UDP_MSG), ret); TEST_ASSERT_EQUAL_INT(strlen(UDP_MSG), ret);
clnAddr.sin_family = AF_INET; clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(PEER_IP); clnAddr.sin_addr.s_addr = inet_addr(PEER_IP);
clnAddr.sin_port = htons(PEER_PORT); 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); ret = strcpy_s(g_buf, BUF_SIZE, UDP_MSG);
TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret); TEST_ASSERT_EQUAL_INT(LWIP_TEST_SUCCESS, ret);
msg.msg_name = &clnAddr; msg.msg_name = &clnAddr;
...@@ -720,7 +720,7 @@ LITE_TEST_CASE(LwipFuncTestSuite, testSocketOpt, Function | MediumTest | Level2) ...@@ -720,7 +720,7 @@ LITE_TEST_CASE(LwipFuncTestSuite, testSocketOpt, Function | MediumTest | Level2)
ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, len); ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, len);
TEST_ASSERT_EQUAL_INT(0, ret); 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); ret = getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, &len);
TEST_ASSERT_EQUAL_INT(0, ret); TEST_ASSERT_EQUAL_INT(0, ret);
TEST_ASSERT_EQUAL_INT(1000, timeout.tv_sec); TEST_ASSERT_EQUAL_INT(1000, timeout.tv_sec);
......
...@@ -120,7 +120,7 @@ static void* CommTcpClientTask(void* param) ...@@ -120,7 +120,7 @@ static void* CommTcpClientTask(void* param)
"client:!!@@##$$%%^^&&**(()),FD:[%d]", "client:(((112233445566778899))),FD:[%d]", "bye"}; "client:!!@@##$$%%^^&&**(()),FD:[%d]", "client:(((112233445566778899))),FD:[%d]", "bye"};
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
sleep(sleepSecond); 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); rst = sprintf_s(dataBuf, sizeof(dataBuf), sendMsgList[i], clnFd);
if (rst < 0) { if (rst < 0) {
printf("[comm client]sprintf_s error!\n"); printf("[comm client]sprintf_s error!\n");
...@@ -131,7 +131,7 @@ static void* CommTcpClientTask(void* param) ...@@ -131,7 +131,7 @@ static void* CommTcpClientTask(void* param)
*ret = -1; *ret = -1;
printf("[comm client][%d]send fail\n", clnFd); 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); rst = recv(clnFd, dataBuf, sizeof(dataBuf), 0);
if (rst > 0) { if (rst > 0) {
printf("[comm client][%d]recv msg[%s]\n", clnFd, dataBuf); printf("[comm client][%d]recv msg[%s]\n", clnFd, dataBuf);
...@@ -182,14 +182,14 @@ static void* SampleTcpServerTask(void* p) ...@@ -182,14 +182,14 @@ static void* SampleTcpServerTask(void* p)
static char buf[BUF_SIZE + 1] = {0}; static char buf[BUF_SIZE + 1] = {0};
unsigned int srvMsgLen = strlen(g_srvMsg); 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); ret = strcpy_s(buf, BUF_SIZE, g_srvMsg);
EXPECT_EQ(0, ret); EXPECT_EQ(0, ret);
ret = send(clnFd, buf, srvMsgLen, 0); ret = send(clnFd, buf, srvMsgLen, 0);
printf("[tcp server]send, ret=%d\n", ret); printf("[tcp server]send, ret=%d\n", ret);
EXPECT_EQ(srvMsgLen, (unsigned int)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); ret = recv(clnFd, buf, sizeof(buf), 0);
printf("[tcp server]recv, ret=%d, msg[%s]\n", ret, buf); printf("[tcp server]recv, ret=%d, msg[%s]\n", ret, buf);
EXPECT_EQ(strlen(g_cliMsg), (unsigned int)ret); EXPECT_EQ(strlen(g_cliMsg), (unsigned int)ret);
...@@ -201,7 +201,7 @@ static void* SampleTcpServerTask(void* p) ...@@ -201,7 +201,7 @@ static void* SampleTcpServerTask(void* p)
clnAddr.sin_family = AF_INET; clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(g_localHost); clnAddr.sin_addr.s_addr = inet_addr(g_localHost);
clnAddr.sin_port = htons(PEER_PORT); 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); ret = strcpy_s(buf, BUF_SIZE, g_srvMsg);
EXPECT_EQ(0, ret); EXPECT_EQ(0, ret);
msg.msg_name = &clnAddr; msg.msg_name = &clnAddr;
...@@ -217,8 +217,8 @@ static void* SampleTcpServerTask(void* p) ...@@ -217,8 +217,8 @@ static void* SampleTcpServerTask(void* p)
EXPECT_EQ(len * srvMsgLen, (unsigned int)ret); EXPECT_EQ(len * srvMsgLen, (unsigned int)ret);
WAIT(); WAIT();
memset_s(buf, BUF_SIZE, 0, BUF_SIZE); (viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
memset_s(&msg, sizeof(msg), 0, sizeof(msg)); (viod) memset_s(&msg, sizeof(msg), 0, sizeof(msg));
msg.msg_name = &clnAddr; msg.msg_name = &clnAddr;
msg.msg_namelen = sizeof(clnAddr); msg.msg_namelen = sizeof(clnAddr);
msg.msg_iov = iov; msg.msg_iov = iov;
...@@ -270,14 +270,14 @@ static void* SampleTcpClientTask(void* p) ...@@ -270,14 +270,14 @@ static void* SampleTcpClientTask(void* p)
static char buf[BUF_SIZE + 1] = {0}; static char buf[BUF_SIZE + 1] = {0};
unsigned int cliMsgLen = strlen(g_cliMsg); 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); ret = strcpy_s(buf, BUF_SIZE, g_cliMsg);
EXPECT_EQ(0, ret); EXPECT_EQ(0, ret);
ret = send(clnFd, buf, cliMsgLen, 0); ret = send(clnFd, buf, cliMsgLen, 0);
printf("[tcp client]send, ret=%d\n", ret); printf("[tcp client]send, ret=%d\n", ret);
EXPECT_EQ(cliMsgLen, (unsigned int)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); ret = recv(clnFd, buf, sizeof(buf), 0);
printf("[tcp client]recv, ret=%d, msg[%s]\n", ret, buf); printf("[tcp client]recv, ret=%d, msg[%s]\n", ret, buf);
EXPECT_EQ(strlen(g_srvMsg), (unsigned int)ret); EXPECT_EQ(strlen(g_srvMsg), (unsigned int)ret);
...@@ -290,7 +290,7 @@ static void* SampleTcpClientTask(void* p) ...@@ -290,7 +290,7 @@ static void* SampleTcpClientTask(void* p)
clnAddr.sin_family = AF_INET; clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(g_localHost); clnAddr.sin_addr.s_addr = inet_addr(g_localHost);
clnAddr.sin_port = htons(PEER_PORT); 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); ret = strcpy_s(buf, BUF_SIZE, g_cliMsg);
EXPECT_EQ(0, ret); EXPECT_EQ(0, ret);
msg.msg_name = &clnAddr; msg.msg_name = &clnAddr;
...@@ -306,8 +306,8 @@ static void* SampleTcpClientTask(void* p) ...@@ -306,8 +306,8 @@ static void* SampleTcpClientTask(void* p)
EXPECT_EQ(len * cliMsgLen, (unsigned int)ret); EXPECT_EQ(len * cliMsgLen, (unsigned int)ret);
WAIT(); WAIT();
memset_s(buf, BUF_SIZE, 0, BUF_SIZE); (viod) memset_s(buf, BUF_SIZE, 0, BUF_SIZE);
memset_s(&msg, sizeof(msg), 0, sizeof(msg)); (viod) memset_s(&msg, sizeof(msg), 0, sizeof(msg));
msg.msg_name = &clnAddr; msg.msg_name = &clnAddr;
msg.msg_namelen = sizeof(clnAddr); msg.msg_namelen = sizeof(clnAddr);
msg.msg_iov = iov; msg.msg_iov = iov;
...@@ -344,7 +344,7 @@ static int TcpServerForFork() ...@@ -344,7 +344,7 @@ static int TcpServerForFork()
goto FINALLY; goto FINALLY;
} }
while (timeout > 0) { 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); ret = recv(cliFd, dataBuf, sizeof(dataBuf), 0);
if (ret > 0) { if (ret > 0) {
printf("[server process]recv msg[%s]\n", dataBuf); printf("[server process]recv msg[%s]\n", dataBuf);
...@@ -355,7 +355,7 @@ static int TcpServerForFork() ...@@ -355,7 +355,7 @@ static int TcpServerForFork()
} else { } else {
printf("[server process]recv no data\n"); 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); sprintf_s(dataBuf, sizeof(dataBuf), "server timeout:%d", timeout);
ret = send(cliFd, dataBuf, strlen(dataBuf), 0); ret = send(cliFd, dataBuf, strlen(dataBuf), 0);
if (ret > 0) { if (ret > 0) {
...@@ -466,7 +466,7 @@ static int SelectServerForFork(unsigned int timeoutSec) ...@@ -466,7 +466,7 @@ static int SelectServerForFork(unsigned int timeoutSec)
continue; continue;
} }
if (FD_ISSET(fds[i], &readSet)) { 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); int len = recv(fds[i], dataBuf, sizeof(dataBuf), 0);
if (len > 0) { if (len > 0) {
printf("[select process][%d]recv msg[%s]\n", fds[i], dataBuf); printf("[select process][%d]recv msg[%s]\n", fds[i], dataBuf);
...@@ -550,20 +550,20 @@ HWTEST_F(ActsLwipTest, testUdpSample, Function | MediumTest | Level2) ...@@ -550,20 +550,20 @@ HWTEST_F(ActsLwipTest, testUdpSample, Function | MediumTest | Level2)
clnAddr.sin_family = AF_INET; clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(g_localHost); clnAddr.sin_addr.s_addr = inet_addr(g_localHost);
clnAddr.sin_port = htons(PEER_PORT); 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); ret = strcpy_s(buf, BUF_SIZE, g_udpMsg);
EXPECT_EQ(0, ret); EXPECT_EQ(0, ret);
ret = sendto(sfd, buf, strlen(g_udpMsg), 0, (struct sockaddr*)&clnAddr, (socklen_t)sizeof(clnAddr)); ret = sendto(sfd, buf, strlen(g_udpMsg), 0, (struct sockaddr*)&clnAddr, (socklen_t)sizeof(clnAddr));
EXPECT_NE(-1, ret); 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); ret = recvfrom(sfd, buf, sizeof(buf), 0, (struct sockaddr*)&clnAddr, &clnAddrLen);
EXPECT_EQ(strlen(g_udpMsg), (unsigned int)ret); EXPECT_EQ(strlen(g_udpMsg), (unsigned int)ret);
clnAddr.sin_family = AF_INET; clnAddr.sin_family = AF_INET;
clnAddr.sin_addr.s_addr = inet_addr(g_localHost); clnAddr.sin_addr.s_addr = inet_addr(g_localHost);
clnAddr.sin_port = htons(PEER_PORT); 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); ret = strcpy_s(buf, BUF_SIZE, g_udpMsg);
EXPECT_EQ(0, ret); EXPECT_EQ(0, ret);
msg.msg_name = &clnAddr; msg.msg_name = &clnAddr;
...@@ -761,7 +761,7 @@ HWTEST_F(ActsLwipTest, testSocketOpt, Function | MediumTest | Level2) ...@@ -761,7 +761,7 @@ HWTEST_F(ActsLwipTest, testSocketOpt, Function | MediumTest | Level2)
ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, len); ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, len);
EXPECT_EQ(0, ret); 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); ret = getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, &len);
EXPECT_EQ(0, ret); EXPECT_EQ(0, ret);
EXPECT_EQ(1000, timeout.tv_sec); EXPECT_EQ(1000, timeout.tv_sec);
......
...@@ -595,10 +595,10 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanType, Function | MediumT ...@@ -595,10 +595,10 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanType, Function | MediumT
int freq = 2460; int freq = 2460;
WifiScanParams scanParams = {0}; WifiScanParams scanParams = {0};
char bssid[WIFI_MAC_LEN] = {0xac, 0x75, 0x1d, 0xd8, 0x55, 0xc1}; 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.ssidLen = strlen(scanParams.ssid);
scanParams.freqs = freq; 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; scanParams.scanType = WIFI_SSID_SCAN;
g_staScanSuccess = 0; g_staScanSuccess = 0;
...@@ -676,7 +676,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam02, Function ...@@ -676,7 +676,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam02, Function
WifiScanParams* scanParams = malloc(sizeof(WifiScanParams)); WifiScanParams* scanParams = malloc(sizeof(WifiScanParams));
TEST_ASSERT_NOT_NULL(scanParams); 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); error = AdvanceScan(scanParams);
TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error); TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error);
...@@ -689,8 +689,8 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam02, Function ...@@ -689,8 +689,8 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam02, Function
error = AdvanceScan(scanParams); error = AdvanceScan(scanParams);
TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error); TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error);
memset_s(scanParams, sizeof(WifiScanParams), 0, sizeof(WifiScanParams)); (viod) memset_s(scanParams, sizeof(WifiScanParams), 0, sizeof(WifiScanParams));
strcpy_s(scanParams->ssid, sizeof(scanParams->ssid), "wifi_service_xts"); (viod) strcpy_s(scanParams->ssid, sizeof(scanParams->ssid), "wifi_service_xts");
scanParams->scanType = WIFI_SSID_SCAN; scanParams->scanType = WIFI_SSID_SCAN;
error = AdvanceScan(scanParams); error = AdvanceScan(scanParams);
TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error); TEST_ASSERT_EQUAL_INT(ERROR_WIFI_UNKNOWN, error);
...@@ -721,7 +721,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam03, Function ...@@ -721,7 +721,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam03, Function
WifiScanParams* scanParams = malloc(sizeof(WifiScanParams)); WifiScanParams* scanParams = malloc(sizeof(WifiScanParams));
TEST_ASSERT_NOT_NULL(scanParams); 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; scanParams->scanType = WIFI_BAND_SCAN;
g_staScanSuccess = 0; g_staScanSuccess = 0;
...@@ -739,7 +739,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam03, Function ...@@ -739,7 +739,7 @@ LITE_TEST_CASE(WifiServiceFuncTestSuite, testAdvanceScanInvalidParam03, Function
TEST_ASSERT_EQUAL_INT(1, g_staScanSuccess); TEST_ASSERT_EQUAL_INT(1, g_staScanSuccess);
char bssid[WIFI_MAC_LEN] = {0xac, 0x75, 0x1d, 0xd8, 0x55, 0xc1}; 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; scanParams->scanType = WIFI_BSSID_SCAN;
g_staScanSuccess = 0; g_staScanSuccess = 0;
error = AdvanceScan(scanParams); error = AdvanceScan(scanParams);
......
# Copyright (c) 2021 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.
import("//build/ohos_var.gni")
group("dsoftbus") {
testonly = true
if (is_standard_system) {
deps = [ "ipcrpc_standard:ActsRpcJsTest" ]
}
}
# Copyright (C) 2021 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.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsRpcJsTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":rpc_js_assets",
":rpc_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsRpcHapTest"
}
ohos_js_assets("rpc_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("rpc_js_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for rpc Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "60000",
"package": "com.ohos.rpctest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsRpcHapTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.ohos.rpctest",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.rpctest",
"name": "com.ohos.rpc.MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.ohos.rpc.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"visible":true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 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.
*/
import app from '@system.app'
import {Core} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ''
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../test/List.test')
core.execute()
},
onReady() {
},
}
/*
* Copyright (C) 2021 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.
*/
require('./RpcJsunit.test.js')
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "rpctest"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Rpc"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册