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

!7711 修改ipc用例

Merge pull request !7711 from 张攀/cherry-pick-1677118168
......@@ -3959,7 +3959,7 @@ export default function actsRpcClientJsTest() {
let a = [new MySequenceable(1, "aaa"), new MySequenceable(2, "bbb"),
new MySequenceable(3, "ccc")]
data.writeParcelableArray(a);
await gIRemoteObject.sendMessageRequest(CODE_ALL_ARRAY_TYPE, data, reply, option,(err, result) => {
await gIRemoteObject.sendMessageRequest(CODE_ALL_ARRAY_TYPE, data, reply, option).then((result) => {
expect(result.errCode).assertEqual(0);
assertArrayElementEqual(result.reply.readByteArray(), [1, 2, 3]);
assertArrayElementEqual(result.reply.readShortArray(), [4, 5, 6]);
......@@ -4015,15 +4015,33 @@ export default function actsRpcClientJsTest() {
data.writeParcelableArray(a);
await gIRemoteObject.sendMessageRequest(CODE_ALL_ARRAY_TYPE, data, reply, option).then((result) => {
expect(result.errCode).assertEqual(0);
assertArrayElementEqual(result.reply.readByteArray(), [1, 2, 3]);
assertArrayElementEqual(result.reply.readShortArray(), [4, 5, 6]);
assertArrayElementEqual(result.reply.readIntArray(), [7, 8, 9]);
assertArrayElementEqual(result.reply.readLongArray(), [10, 11, 12]);
assertArrayElementEqual(result.reply.readFloatArray(), [1.1, 1.2, 1.3]);
assertArrayElementEqual(result.reply.readDoubleArray(), [2.1, 2.2, 2.3]);
assertArrayElementEqual(result.reply.readBooleanArray(), [true, true, false]);
assertArrayElementEqual(result.reply.readCharArray(), [65,97,122]);
assertArrayElementEqual(result.reply.readStringArray(), ['abc', 'seggg']);
let ByteArray = new Array();
result.reply.readByteArray(ByteArray)
assertArrayElementEqual(ByteArray, [1, 2, 3]);
let ShortArray = new Array();
result.reply.readShortArray(ShortArray)
assertArrayElementEqual(ShortArray, [4, 5, 6]);
let IntArray = new Array();
result.reply.readIntArray(IntArray)
assertArrayElementEqual(IntArray, [7, 8, 9]);
let LongArray = new Array();
result.reply.readLongArray(LongArray)
assertArrayElementEqual(LongArray, [10, 11, 12]);
let FloatArray = new Array();
result.reply.readFloatArray(FloatArray)
assertArrayElementEqual(FloatArray, [1.1, 1.2, 1.3]);
let DoubleArray = new Array();
result.reply.readDoubleArray(DoubleArray)
assertArrayElementEqual(DoubleArray, [2.1, 2.2, 2.3]);
let BooleanArray = new Array();
result.reply.readBooleanArray(BooleanArray)
assertArrayElementEqual(BooleanArray, [true, true, false]);
let CharArray = new Array();
result.reply.readCharArray(CharArray)
assertArrayElementEqual(CharArray, [65,97,122]);
let StringArray = new Array();
result.reply.readStringArray(StringArray);
assertArrayElementEqual(StringArray, ['abc', 'seggg']);
let b = [new MySequenceable(null, null), new MySequenceable(null, null),
new MySequenceable(null, null)];
result.reply.readParcelableArray(b);
......@@ -9533,7 +9551,7 @@ export default function actsRpcClientJsTest() {
let a = [new MySequenceable(1, "aaa"), new MySequenceable(2, "bbb"),
new MySequenceable(3, "ccc")];
expect(data.writeSequenceableArray(a)).assertTrue();
gIRemoteObject.sendRequest(CODE_ALL_ARRAY_TYPE, data, reply, option,(err, result) => {
gIRemoteObject.sendRequest(CODE_ALL_ARRAY_TYPE, data, reply, option).then((result) => {
expect(result.errCode).assertEqual(0);
assertArrayElementEqual(result.reply.readByteArray(), [1, 2, 3]);
assertArrayElementEqual(result.reply.readShortArray(), [4, 5, 6]);
......@@ -9593,15 +9611,33 @@ export default function actsRpcClientJsTest() {
expect(data.writeSequenceableArray(a)).assertTrue();
gIRemoteObject.sendRequest(CODE_ALL_ARRAY_TYPE, data, reply, option).then((result) => {
expect(result.errCode).assertEqual(0);
assertArrayElementEqual(result.reply.readByteArray(), [1, 2, 3]);
assertArrayElementEqual(result.reply.readShortArray(), [4, 5, 6]);
assertArrayElementEqual(result.reply.readIntArray(), [7, 8, 9]);
assertArrayElementEqual(result.reply.readLongArray(), [10, 11, 12]);
assertArrayElementEqual(result.reply.readFloatArray(), [1.1, 1.2, 1.3]);
assertArrayElementEqual(result.reply.readDoubleArray(), [2.1, 2.2, 2.3]);
assertArrayElementEqual(result.reply.readBooleanArray(), [true, true, false]);
assertArrayElementEqual(result.reply.readCharArray(), [10, 20, 30]);
assertArrayElementEqual(result.reply.readStringArray(), ['abc', 'seggg']);
let ByteArray = new Array();
result.reply.readByteArray(ByteArray)
assertArrayElementEqual(ByteArray, [1, 2, 3]);
let ShortArray = new Array();
result.reply.readShortArray(ShortArray)
assertArrayElementEqual(ShortArray, [4, 5, 6]);
let IntArray = new Array();
result.reply.readIntArray(IntArray)
assertArrayElementEqual(IntArray, [7, 8, 9]);
let LongArray = new Array();
result.reply.readLongArray(LongArray)
assertArrayElementEqual(LongArray, [10, 11, 12]);
let FloatArray = new Array();
result.reply.readFloatArray(FloatArray)
assertArrayElementEqual(FloatArray, [1.1, 1.2, 1.3]);
let DoubleArray = new Array();
result.reply.readDoubleArray(DoubleArray)
assertArrayElementEqual(DoubleArray, [2.1, 2.2, 2.3]);
let BooleanArray = new Array();
result.reply.readBooleanArray(BooleanArray)
assertArrayElementEqual(BooleanArray, [true, true, false]);
let CharArray = new Array();
result.reply.readCharArray(CharArray)
assertArrayElementEqual(CharArray, [65,97,122]);
let StringArray = new Array();
result.reply.readStringArray(StringArray);
assertArrayElementEqual(StringArray, ['abc', 'seggg']);
let b = [new MySequenceable(null, null), new MySequenceable(null, null),
new MySequenceable(null, null)];
result.reply.readSequenceableArray(b);
......@@ -13206,7 +13242,7 @@ export default function actsRpcClientJsTest() {
data.writeString("HelloWorld");
data.writeParcelable(new MySequenceable(1, "aaa"));
await gIRemoteObject.sendMessageRequest(CODE_ALL_TYPE, data, reply, option, (err, result) => {
await gIRemoteObject.sendMessageRequest(CODE_ALL_TYPE, data, reply, option).then((result) => {
console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00900 errorcode: " + result.errCode);
expect(result.errCode).assertEqual(0);
expect(result.reply.readByte()).assertEqual(1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册