RpcClientJsunit.test.js 779.7 KB
Newer Older
J
jiyong 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * 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.
 */

16
import rpc from '@ohos.rpc';
J
jiyong 已提交
17
import fileio from '@ohos.fileio';
18 19
import FA from '@ohos.ability.featureAbility';
import {describe, expect, beforeAll, it} from 'deccjsunit/index';
20
var gIRemoteObject = null;
Z
zhangpa2021 已提交
21
export default function actsRpcClientJsTest() {
Y
yang-qibo 已提交
22 23
    describe('ActsRpcClientJsTest', function(){
        console.info("-----------------------SUB_Softbus_IPC_Compatibility_MessageParce_Test is starting-----------------------");
24
        beforeAll(async function () {
25
            console.info('beforeAll called');
26 27 28
            gIRemoteObject = new Stub("rpcTestAbility");
            return gIRemoteObject;
        });
Y
yang-qibo 已提交
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75

        beforeEach(async function (){
            console.info('beforeEach called');
        });

        afterEach(async function (){
            console.info('afterEach called');
        });

        afterAll(async function (){
            console.info('afterAll called');
        });

        const K = 1024;
        const M = 1024*1024;
        const G = 1024*1024*1024;
        const CODE_WRITE_BYTEARRAY = 1;
        const CODE_SAME_PROCESS = 1;
        const CODE_WRITE_INTARRAY = 2;
        const CODE_WRITE_FLOATARRAY = 3;
        const CODE_WRITE_SHORT = 4;
        const CODE_WRITE_LONG = 5;
        const CODE_WRITE_DOUBLE = 6;
        const CODE_WRITE_BOOLEAN = 7;
        const CODE_WRITE_CHAR = 8;
        const CODE_WRITE_STRING = 9;
        const CODE_WRITE_BYTE = 10;
        const CODE_WRITE_INT = 11;
        const CODE_WRITE_FLOAT = 12;
        const CODE_WRITE_RAWDATA = 13;
        const CODE_WRITE_REMOTEOBJECT = 14;
        const CODE_WRITE_SEQUENCEABLE = 15;
        const CODE_WRITE_NOEXCEPTION = 16;
        const CODE_WRITE_SEQUENCEABLEARRAY = 17;
        const CODE_WRITE_REMOTEOBJECTARRAY = 18;
        const CODE_ALL_TYPE = 20;
        const CODE_ALL_ARRAY_TYPE = 21;
        const CODE_IPCSKELETON_INT = 22;
        const CODE_WRITESEQUENCEABLE = 23
        const CODE_WRITE_SHORT_MULTI = 24;
        const CODE_WRITE_BYTE_MULTI = 25;
        const CODE_WRITE_INT_MULTI = 26;
        const CODE_TRANSACTION = 27;
        const CODE_IPCSKELETON = 28;
        const CODE_FILESDIR = 29;
        const CODE_WRITE_REMOTEOBJECTARRAY_1 = 30;
        const CODE_WRITE_REMOTEOBJECTARRAY_2 = 31;
76 77
        const CODE_ONREMOTEMESSAGE_OR_ONREMOTE = 32;
        const CODE_ONREMOTEMESSAGEREQUEST = 33;
78 79 80 81 82 83
        const CODE_INTERFACETOKEN = 34;
        const CODE_WRITE_SHORTARRAY = 35;
        const CODE_WRITE_LONGARRAY = 36;
        const CODE_WRITE_DOUBLEARRAY = 37;
        const CODE_WRITE_BOOLEANARRAY = 38;
        const CODE_WRITE_CHARARRAY = 39;
84 85
        const CODE_WRITE_STRINGARRAY = 40;
        
Y
yang-qibo 已提交
86 87 88 89 90 91 92 93 94
        function sleep(numberMillis)
        {
            var now = new Date();
            var exitTime = now.getTime() + numberMillis;
            while (true) {
                now = new Date();
                if (now.getTime() > exitTime)
                    return;
            }
95
        }
Y
yang-qibo 已提交
96

Y
yang-qibo 已提交
97 98 99 100 101 102 103
        class TestRemoteObject extends rpc.RemoteObject {
            constructor(descriptor) {
                super(descriptor);
            }
            asObject(){
                return this;
            }
Y
yang-qibo 已提交
104
        }
J
jiyong 已提交
105

Y
yang-qibo 已提交
106 107 108 109 110 111 112 113 114 115
        class TestProxy {
            remote = rpc.RemoteObject;
            constructor(remote) {
                this.remote = remote;
                console.info("test remote")
            }
            asObject() {
                console.info("server remote")
                return this.remote;
            }
J
jiyong 已提交
116 117
        }

Y
yang-qibo 已提交
118 119
        class MyDeathRecipient {
            constructor(gIRemoteObject, done) {
120 121
                this.gIRemoteObject = gIRemoteObject;
                this.done = done;
Y
yang-qibo 已提交
122
            }
J
jiyong 已提交
123

Y
yang-qibo 已提交
124
            onRemoteDied() {
125 126 127
                console.info("server died");
                expect(this.proxy.removeDeathRecipient(this, 0)).assertTrue();
                let _done = this.done;
Y
yang-qibo 已提交
128 129
                setTimeout(function() {
                    _done()
130
                }, 1000);
Y
yang-qibo 已提交
131
            }
J
jiyong 已提交
132
        }
Z
zhangpa2021 已提交
133

Y
yang-qibo 已提交
134 135
        class MyregisterDeathRecipient {
            constructor(gIRemoteObject, done) {
136 137
                this.gIRemoteObject = gIRemoteObject;
                this.done = done;
Y
yang-qibo 已提交
138 139 140
            }
 
            onRemoteDied() {
141 142 143
                console.info("server died");
                expect(this.proxy.unregisterDeathRecipient(this, 0)).assertTrue();
                let _done = this.done;
Y
yang-qibo 已提交
144 145
                setTimeout(function() {
                    _done()
146
                }, 1000);
Y
yang-qibo 已提交
147 148 149
            }
        }

150 151 152 153 154 155
        class Stub extends rpc.RemoteObject {
            constructor(descriptor) {
                super(descriptor);
            }
            onRemoteRequest(code, data, reply, option) {
                try{
156
                    console.info("onRemoteRequest: " + code);
157
                    if (code === 32){
158 159 160 161
                        console.info("case 32 start");
                        let tmp1 = data.readString();
                        let result =  reply.writeString("onRemoteRequest invoking");
                        return true;
162
                    } else if (code === 33){
163 164 165 166
                        console.info("case 33 start");
                        let tmp1 = data.readString();
                        let result =  reply.writeString(tmp1);
                        return true;
167
                    }else {
168 169
                        console.error("default case " + code);
                        return super.onRemoteRequest(code, data, reply, option);
170 171 172 173 174 175 176 177
                    }
                } catch (error) {
                    console.info("onRemoteRequest: " + error);
                }
                return false
            }
            onRemoteMessageRequest(code, data, reply, option) {
                try{
178
                    console.info("onRemoteMessageRequest: " + code);
179 180 181
                    switch(code) {
                        case 1:
                        {
182 183 184 185
                            console.info("case 1 start");
                            let tmp1 = data.readByteArray();
                            let result =  reply.writeByteArray(tmp1);
                            return true;
186 187 188
                        }
                        case 2:
                        {
189 190 191 192
                            console.info("case 2 start");
                            let tmp1 = data.readIntArray();
                            let result =  reply.writeIntArray(tmp1);
                            return true;
193 194 195
                        }
                        case 3:
                        {
196 197 198
                            console.info("case 3 start");
                            let tmp1 = data.readFloatArray();
                            let result =  reply.writeFloatArray(tmp1);
199 200 201 202
                            return true
                        }
                        case 4:
                        {
203 204 205
                            console.info("case 4 start");
                            let tmp1 = data.readShort();
                            let result =  reply.writeShort(tmp1);
206 207 208 209
                            return true
                        }
                        case 5:
                        {
210 211 212
                            console.info("case 5 start");
                            let tmp1 = data.readLong();
                            let result =  reply.writeLong(tmp1);
213 214 215 216
                            return true
                        }
                        case 6:
                        {
217 218 219
                            console.info("case 6 start");
                            let tmp1 = data.readDouble();
                            let result =  reply.writeDouble(tmp1);
220 221 222 223
                            return true
                        }
                        case 7:
                        {
224 225 226
                            console.info("case 7 start");
                            let tmp1 = data.readBoolean();
                            let result =  reply.writeBoolean(tmp1);
227 228 229 230
                            return true
                        }
                        case 8:
                        {
231 232 233
                            console.info("case 8 start");
                            let tmp1 = data.readChar();
                            let result =  reply.writeChar(tmp1);
234 235 236 237
                            return true
                        }
                        case 9:
                        {
238 239 240
                            console.info("case 9 start");
                            let tmp1 = data.readString();
                            let result =  reply.writeString(tmp1);
241 242 243 244
                            return true
                        }
                        case 10:
                        {
245 246 247
                            console.info("case 10 start");
                            let tmp1 = data.readByte();
                            let result =  reply.writeByte(tmp1);
248 249 250 251
                            return true
                        }
                        case 11:
                        {
252 253 254
                            console.info("case 11 start");
                            let tmp1 = data.readInt();
                            let result =  reply.writeInt(tmp1);
255 256 257 258
                            return true
                        }
                        case 12:
                        {
259 260 261
                            console.info("case 12 start");
                            let tmp1 = data.readFloat();
                            let result =  reply.writeFloat(tmp1);
262 263 264 265
                            return true
                        }
                        case 13:
                        {
266 267 268
                            console.info("case 13 start");
                            var size = data.readInt();
                            let tmp = data.readRawData(size);
269
                            let size1 = reply.writeInt(size);
270
                            let result = reply.writeRawData(tmp, tmp.length);
271 272 273 274
                            return true
                        }
                        case 14:
                        {
275
                            console.info("case 14 start");
276
                            let listener = data.readRemoteObject();
277 278 279 280 281 282 283
                            let num = data.readInt();
                            let str = data.readString();
                            let option2 = new rpc.MessageOption();
                            let data2 = rpc.MessageParcel.create();
                            let reply2 = rpc.MessageParcel.create();
                            data2.writeInt(num);
                            data2.writeString(str);
284 285
                            listener.sendRequest(1, data2, reply2, option2)
                                .then(function(result) {
286
                                    console.info("14 send request done, error code: " + result.errCode );
287 288
                                })
                                .catch(function(e) {
289
                                    console.error("14 send request got exception: " + e);
290 291
                                })
                                .finally(() => {
292 293 294
                                    data2.reclaim();
                                    reply2.reclaim();
                                    console.info("case 14 test done");
295
                                })
296
                            reply.writeNoException();
297 298 299 300
                            return true
                        }
                        case 15:
                        {
301 302 303 304
                            console.info("case 15 start");
                            let s = new MySequenceable(null, null);
                            var tmp1 = data.readParcelable(s);
                            let result =  reply.writeParcelable(s);
305 306 307 308
                            return true
                        }
                        case 16:
                        {
309 310
                            console.info("case 16 start");
                            data.readException();
311
                            var tmp = data.readInt();
312
                            reply.writeNoException();
313 314 315 316 317
                            var result = reply.writeInt(tmp);
                            return true
                        }
                        case 17:
                        {
318
                            console.info("case 17 start");
319 320 321 322 323 324 325 326
                            var s = [new MySequenceable(null, null), new MySequenceable(null, null),
                                new MySequenceable(null, null)];
                            data.readParcelableArray(s);
                            let result =  reply.writeParcelableArray(s);
                            return true
                        }
                        case 18:
                        {
327
                            console.info("case 18 start");
328 329
                            let listeners = data.readRemoteObjectArray();
                            for (let i = 0; i < listeners.length; i++) {
330 331 332
                                let option2 = new rpc.MessageOption();
                                let data2 = rpc.MessageParcel.create();
                                let reply2 = rpc.MessageParcel.create();
333 334
                                listeners[i].sendRequest(1, data2, reply2, option2)
                                    .then(function(result) {
335
                                        console.info("18 send request done, error code: " + result.errCode + ", index: " + i);
336 337
                                    })
                                    .catch(function(e) {
338
                                        console.error("18 send request got exception: " + e);
339 340
                                    })
                                    .finally(() => {
341 342 343
                                        data2.reclaim();
                                        reply2.reclaim();
                                        console.info("case 18 test done");
344 345 346 347 348 349 350
                                    })
                            }
                            console.info("18 The server's writeRemoteObjectArray result is " + result);
                            return true
                        }
                        case 19:
                        {
351 352 353
                            console.info("case 19 start");
                            let tmp1 = data.readDoubleArray();
                            let result =  reply.writeDoubleArray(tmp1);
354 355 356 357 358
                            return true
                        }
        
                        case 20:
                        {
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
                            console.info("case 20 start");
                            let tmp1 = data.readByte();
                            let tmp2 = data.readShort();
                            let tmp3 = data.readInt();
                            let tmp4 = data.readLong();
                            let tmp5 = data.readFloat();
                            let tmp6 = data.readDouble();
                            let tmp7 = data.readBoolean();
                            let tmp8 = data.readChar();
                            let tmp9 = data.readString();
                            let s = new MySequenceable(null, null);
                            let tmp10 = data.readParcelable(s);
                            let result1 =  reply.writeByte(tmp1);
                            let result2 =  reply.writeShort(tmp2);
                            let result3 =  reply.writeInt(tmp3);
                            let result4 =  reply.writeLong(tmp4);
                            let result5 =  reply.writeFloat(tmp5);
                            let result6 =  reply.writeDouble(tmp6);
                            let result7 =  reply.writeBoolean(tmp7);
                            let result8 =  reply.writeChar(tmp8);
                            let result9 =  reply.writeString(tmp9);
                            let result10 =  reply.writeParcelable(s);
381 382 383 384
                            return true
                        }
                        case 21:
                        {
385 386 387 388 389 390 391 392 393 394
                            console.info("case 21 start");
                            let tmp1 = data.readByteArray();
                            let tmp2 = data.readShortArray();
                            let tmp3 = data.readIntArray();
                            let tmp4 = data.readLongArray();
                            let tmp5 = data.readFloatArray();
                            let tmp6 = data.readDoubleArray();
                            let tmp7 = data.readBooleanArray();
                            let tmp8 = data.readCharArray();
                            let tmp9 = data.readStringArray();
395
                            let s = [new MySequenceable(null, null), new MySequenceable(null, null),
396 397 398 399 400 401 402 403 404 405 406 407
                                new MySequenceable(null, null)];
                            let tmp10 = data.readParcelableArray(s);
                            let result1 =  reply.writeByteArray(tmp1);
                            let result2 =  reply.writeShortArray(tmp2);
                            let result3 =  reply.writeIntArray(tmp3);
                            let result4 =  reply.writeLongArray(tmp4);
                            let result5 =  reply.writeFloatArray(tmp5);
                            let result6 =  reply.writeDoubleArray(tmp6);
                            let result7 =  reply.writeBooleanArray(tmp7);
                            let result8 =  reply.writeCharArray(tmp8);
                            let result9 =  reply.writeStringArray(tmp9);
                            let result10 =  reply.writeParcelableArray(s);
408 409 410 411
                            return true
                        }
                        case 22:
                        {
412 413 414 415 416 417 418 419 420 421 422 423 424 425
                            console.info("case 22 start");
                            let callingPid = rpc.IPCSkeleton.getCallingPid();
                            let callingUid = rpc.IPCSkeleton.getCallingUid();
                            reply.writeNoException();
                            reply.writeInt(callingPid);
                            reply.writeInt(callingUid);
                            reply.writeInt(this.getCallingPid());
                            reply.writeInt(this.getCallingUid());
                            let id = rpc.IPCSkeleton.resetCallingIdentity();
                            rpc.IPCSkeleton.setCallingIdentity(id);
                            reply.writeInt(rpc.IPCSkeleton.getCallingPid());
                            reply.writeInt(rpc.IPCSkeleton.getCallingUid());
                            reply.writeInt(rpc.IPCSkeleton.flushCommands(this));
                            return true;
426 427 428
                        }
                        case 23:
                        {
429
                            console.info("case 23 start");
430 431 432
                            let s = new MySequenceable(null, null);
                            var tmp1 = data.readParcelable(s);
                            var result =  reply.writeParcelable(s);
433
                            return true;
434 435 436
                        }
                        case 24:
                        {
437
                            console.info("case 24 start");
438 439 440 441 442 443 444 445 446 447 448 449 450 451
                            var tmp1 = data.readShort();
                            var tmp2 = data.readShort();
                            var tmp3 = data.readShort();
                            var tmp4 = data.readShort();
                            var tmp5 = data.readShort();
                            var result1 =  reply.writeShort(tmp1);
                            var result2 =  reply.writeShort(tmp2);
                            var result3 =  reply.writeShort(tmp3);
                            var result4 =  reply.writeShort(tmp4);
                            var result5 =  reply.writeShort(tmp5);
                            return true
                        }
                        case 25:
                        {
452
                            console.info("case 25 start");
453 454 455 456 457 458 459 460 461 462 463 464 465 466
                            var tmp1 = data.readByte();
                            var tmp2 = data.readByte();
                            var tmp3 = data.readByte();
                            var tmp4 = data.readByte();
                            var tmp5 = data.readByte();
                            var result1 =  reply.writeByte(tmp1);
                            var result2 =  reply.writeByte(tmp2);
                            var result3 =  reply.writeByte(tmp3);
                            var result4 =  reply.writeByte(tmp4);
                            var result5 =  reply.writeByte(tmp5);
                            return true
                        }
                        case 26:
                        {
467
                            console.info("case 26 start");
468 469 470 471 472 473 474 475 476 477 478 479 480 481
                            var tmp1 = data.readInt();
                            var tmp2 = data.readInt();
                            var tmp3 = data.readInt();
                            var tmp4 = data.readInt();
                            var tmp5 = data.readInt();
                            var result1 =  reply.writeInt(tmp1);
                            var result2 =  reply.writeInt(tmp2);
                            var result3 =  reply.writeInt(tmp3);
                            var result4 =  reply.writeInt(tmp4);
                            var result5 =  reply.writeInt(tmp5);
                            return true
                        }
                        case 28:
                        {
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
                            console.info("case 28 start");
                            let callingPid = rpc.IPCSkeleton.getCallingPid();
                            let callingUid = rpc.IPCSkeleton.getCallingUid();
                            let callingDeviceID = rpc.IPCSkeleton.getCallingDeviceID();
                            let localDeviceID = rpc.IPCSkeleton.getLocalDeviceID();
                            let isLocalCalling = rpc.IPCSkeleton.isLocalCalling();
                            reply.writeNoException();
                            reply.writeInt(callingPid);
                            reply.writeInt(callingUid);
                            reply.writeString(callingDeviceID);
                            reply.writeString(localDeviceID);
                            reply.writeBoolean(isLocalCalling);
                            reply.writeInt(this.getCallingPid());
                            reply.writeInt(this.getCallingUid());
                            let id = rpc.IPCSkeleton.resetCallingIdentity();
                            rpc.IPCSkeleton.setCallingIdentity(id);
                            reply.writeInt(rpc.IPCSkeleton.getCallingPid());
                            reply.writeInt(rpc.IPCSkeleton.getCallingUid());
                            reply.writeInt(rpc.IPCSkeleton.flushCommands(this));
                            return true;
502 503 504
                        }
                        case 29:
                        {
505 506 507
                            console.info("case 29 starts");
                            let bytesWr = data.readInt();
                            let fd = data.readFileDescriptor();
508 509 510 511
                            reply.writeFileDescriptor(fd);
                            fileio.writeSync(fd, "HELLO RPC", {position: bytesWr + 1});
                            reply.writeFileDescriptor(fd);
                            rpc.MessageSequence.closeFileDescriptor(fd)
512 513 514 515
                            return true
                        }
                        case 30:
                        {
516
                            console.info("case 30 start");
517
                            let listeners = data.readRemoteObjectArray();
518 519
                            let num = data.readInt();
                            let str = data.readString();
520
                            for (let i = 0; i < listeners.length; i++) {
521 522 523 524 525
                                let option2 = new rpc.MessageOption();
                                let data2 = rpc.MessageParcel.create();
                                let reply2 = rpc.MessageParcel.create();
                                data2.writeInt(num);
                                data2.writeString(str);
526 527
                                listeners[i].sendRequest(1, data2, reply2, option2)
                                    .then(function(result) {
528
                                        console.info("30 send request done, error code: " + result.errCode + ", index: " + i);
529 530
                                    })
                                    .catch(function(e) {
531
                                        console.error("30 send request got exception: " + e);
532 533
                                    })
                                    .finally(() => {
534 535 536
                                        data2.reclaim();
                                        reply2.reclaim();
                                        console.info("case 30 test done");
537 538
                                    })
                            }
539
                            reply.writeNoException();
540 541 542 543 544
                            return true
                        }
        
                        case 31:
                        {
545
                            console.info("case 31 start");
546
                            let listeners = data.readRemoteObjectArray();
547 548
                            let num = data.readInt();
                            let str = data.readString();
549 550 551
                            console.info("31 num: " + num);
                            console.info("31 str: " + str);
                            for (let i = 0; i < listeners.length; i++) {
552 553 554 555 556
                                let option2 = new rpc.MessageOption();
                                let data2 = rpc.MessageParcel.create();
                                let reply2 = rpc.MessageParcel.create();
                                data2.writeInt(num);
                                data2.writeString(str);
557 558
                                listeners[i].sendRequest(1, data2, reply2, option2)
                                    .then(function(result) {
559
                                        console.info("31 send request done, error code: " + result.errCode + ", index: " + i);
560 561
                                    })
                                    .catch(function(e) {
562
                                        console.error("31 send request got exception: " + e);
563 564
                                    })
                                    .finally(() => {
565 566 567
                                        data2.reclaim();
                                        reply2.reclaim();
                                        console.info("case 31 test done");
568 569
                                    })
                            }
570 571
                            reply.writeNoException();
                            return true;
572 573 574
                        }
                        case 32:
                        {
575 576 577 578
                            console.info("case 32 start");
                            let tmp1 = data.readString();
                            let result =  reply.writeString("onRemoteMessageRequest invoking");
                            return true;
579
                        }
580 581
                        case 34:
                        {
582 583 584
                            console.info("case 34 start");
                            let tmp = data.readInterfaceToken();
                            let result =  reply.writeInterfaceToken(tmp);
585 586 587 588
                            return true
                        }
                        case 35:
                        {
589 590 591
                            console.info("case 35 start");
                            let tmp1 = data.readShortArray();
                            let result =  reply.writeShortArray(tmp1);
592 593 594 595
                            return true
                        }
                        case 36:
                        {
596 597 598
                            console.info("case 36 start");
                            let tmp1 = data.readLongArray();
                            let result =  reply.writeLongArray(tmp1);
599 600 601 602
                            return true
                        }
                        case 37:
                            {
603 604 605
                                console.info("case 37 start");
                                let tmp1 = data.readDoubleArray();
                                let result =  reply.writeDoubleArray(tmp1);
606 607 608 609
                                return true
                            }
                        case 38:
                            {
610 611 612
                                console.info("case 38 start");
                                let tmp1 = data.readBooleanArray();
                                let result =  reply.writeBooleanArray(tmp1);
613 614 615 616
                                return true
                            }
                        case 39:
                            {
617 618 619
                                console.info("case 39 start");
                                let tmp1 = data.readCharArray();
                                let result =  reply.writeCharArray(tmp1);
620 621 622 623
                                return true
                            }
                        case 40:
                            {
624 625 626
                                console.info("case 40 start");
                                let tmp1 = data.readStringArray();
                                let result =  reply.writeStringArray(tmp1);
627 628
                                return true
                            }
629
                        default:
630
                            this.onRemoteRequest(code, data, reply, option);
631 632 633 634 635 636 637 638
                    }
                } catch (error) {
                    console.info("onRemoteMessageRequest: " + error);
                }
                return false
            }
        }        

Y
yang-qibo 已提交
639 640
        class TestAbilityStub extends rpc.RemoteObject {
            constructor(descriptor) {
641
                super(descriptor);
Z
zhangpa2021 已提交
642
            }
Y
yang-qibo 已提交
643 644

            onRemoteRequest(code, data, reply, option) {
645 646
                console.info("TestAbilityStub: onRemoteRequest called, code: " + code);
                let descriptor = data.readInterfaceToken();
Y
yang-qibo 已提交
647
                if (descriptor !== "TestAbilityStub") {
648
                    console.error("received unknown descriptor: " + descriptor);
649
                    return false
650
                }
Y
yang-qibo 已提交
651 652 653
                switch (code) {
                    case 1:
                    {
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
                        let tmp1 = data.readByte();
                        let tmp2 = data.readShort();
                        let tmp3 = data.readInt();
                        let tmp4 = data.readLong();
                        let tmp5 = data.readFloat();
                        let tmp6 = data.readDouble();
                        let tmp7 = data.readBoolean();
                        let tmp8 = data.readChar();
                        let tmp9 = data.readString();
                        let s = new MySequenceable(null, null);
                        data.readSequenceable(s);
                        reply.writeNoException();
                        reply.writeByte(tmp1);
                        reply.writeShort(tmp2);
                        reply.writeInt(tmp3);
                        reply.writeLong(tmp4);
                        reply.writeFloat(tmp5);
                        reply.writeDouble(tmp6);
                        reply.writeBoolean(tmp7);
                        reply.writeChar(tmp8);
                        reply.writeString(tmp9);
                        reply.writeSequenceable(s);
Y
yang-qibo 已提交
676 677 678 679
                        return true
                    }
                    default:
                    {
680
                        console.error("default case, code: " + code);
Y
yang-qibo 已提交
681 682 683
                        return false
                    }
                }
Z
zhangpa2021 已提交
684 685
            }
        }
J
jiyong 已提交
686

Y
yang-qibo 已提交
687 688
        class TestAbilityMessageStub extends rpc.RemoteObject {
            constructor(descriptor) {
689
                super(descriptor);
Y
yang-qibo 已提交
690 691
            }
            onRemoteMessageRequest(code, data, reply, option) {
692 693
                console.info("TestAbilityMessageStub: onRemoteMessageRequest called, code: " + code);
                let descriptor = data.readInterfaceToken();
Y
yang-qibo 已提交
694
                if (descriptor !== "TestAbilityMessageStub") {
695
                    console.error("received unknown descriptor: " + descriptor);
Y
yang-qibo 已提交
696 697 698 699 700
                    return false
                }
                switch (code) {
                    case 1:
                    {
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722
                        let tmp1 = data.readByte();
                        let tmp2 = data.readShort();
                        let tmp3 = data.readInt();
                        let tmp4 = data.readLong();
                        let tmp5 = data.readFloat();
                        let tmp6 = data.readDouble();
                        let tmp7 = data.readBoolean();
                        let tmp8 = data.readChar();
                        let tmp9 = data.readString();
                        let s = new MySequenceable(null, null);
                        data.readParcelable(s);
                        reply.writeNoException();
                        reply.writeByte(tmp1);
                        reply.writeShort(tmp2);
                        reply.writeInt(tmp3);
                        reply.writeLong(tmp4);
                        reply.writeFloat(tmp5);
                        reply.writeDouble(tmp6);
                        reply.writeBoolean(tmp7);
                        reply.writeChar(tmp8);
                        reply.writeString(tmp9);
                        reply.writeParcelable(s);
Y
yang-qibo 已提交
723 724 725 726
                        return true
                    }
                    default:
                    {
727
                        console.error("default case, code: " + code);
Y
yang-qibo 已提交
728 729 730 731 732
                        return false
                    }
                }
            }
        }
Z
zhangpa2021 已提交
733

Y
yang-qibo 已提交
734 735 736
        class TestListener extends rpc.RemoteObject {
            constructor(descriptor, checkResult) {
                super(descriptor);
737
                this.checkResult = checkResult;
Y
yang-qibo 已提交
738 739
            }
            onRemoteRequest(code, data, reply, option) {
740
                let result = false;
Y
yang-qibo 已提交
741
                if (code  == 1) {
742 743
                    console.info("onRemoteRequest called, descriptor: " + this.getInterfaceDescriptor());
                    result = true;
Y
yang-qibo 已提交
744
                } else {
745
                    console.info("unknown code: " + code);
Y
yang-qibo 已提交
746 747
                }
                let _checkResult = this.checkResult
748 749
                let _num = data.readInt();
                let _str = data.readString();
Y
yang-qibo 已提交
750 751 752 753 754
                setTimeout(function(){
                    _checkResult(_num, _str)
                }, 2*1000);
                return result
            }
J
jiyong 已提交
755 756
        }

Y
yang-qibo 已提交
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771
        class MySequenceable {
            constructor(num, string) {
                this.num = num;
                this.str = string;
            }
            marshalling(messageParcel) {
                messageParcel.writeInt(this.num);
                messageParcel.writeString(this.str);
                return true;
            }
            unmarshalling(messageParcel) {
                this.num = messageParcel.readInt();
                this.str = messageParcel.readString();
                return true;
            }
772
        }
773

Y
yang-qibo 已提交
774
        function assertArrayElementEqual(actual, expected) {
775
            expect(actual.length).assertEqual(expected.length);
Y
yang-qibo 已提交
776
            for (let i = 0; i < actual.length; i++) {
777
                expect(actual[i]).assertEqual(expected[i]);
Y
yang-qibo 已提交
778
            }
779
        }
Y
yang-qibo 已提交
780

781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00100
        * @tc.name    Call the writeinterfacetoken interface, write the interface descriptor, and read interfacetoken
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = "hello ruan zong xian";
                data.writeInterfaceToken(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_INTERFACETOKEN, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInterfaceToken()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00200
         * @tc.name    The writeInterfaceToken interface is looping, the interface descriptor is written, and the
                        InterfaceToken is read
         * @tc.desc    Function test
814
         * @tc.level   3
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00200---------------------------");
            try{
                for (let i = 0; i < 5;i++){
                    var data = rpc.MessageSequence.create();
                    var reply = rpc.MessageSequence.create();
                    var option = new rpc.MessageOption();
                    let token = "hello ruan zong xian";
                    data.writeInterfaceToken(token);
                    expect(gIRemoteObject != undefined).assertTrue();
                    await gIRemoteObject.sendMessageRequest(CODE_INTERFACETOKEN, data, reply, option).then((result) => {
                        expect(result.errCode).assertEqual(0);
                        expect(result.reply.readInterfaceToken()).assertEqual(token);
                    });
                    data.reclaim();
                    reply.reclaim();
                }
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00300
         * @tc.name    Call the WriteInterfaceToken interface, write the maximum length interface descriptor, and read
                        the InterfaceToken
         * @tc.desc    Function test
845
         * @tc.level   3
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = "";
                for(let i = 0; i < (40*K - 1); i++){
                    token += 'a';
                }
                data.writeInterfaceToken(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_INTERFACETOKEN, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInterfaceToken()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00400
         * @tc.name    The WriteInterfaceToken interface is called, the exceeding-length interface descriptor is written,
                        and the InterfaceToken is read
         * @tc.desc    Function test
877
         * @tc.level   3
878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00400", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = "";
                for(let i = 0; i < 40*K; i++){
                    token += 'a';
                }
                data.writeInterfaceToken(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00500
         * @tc.name    Call the writeinterfacetoken interface to write a non string interface descriptor
                       and read interfacetoken
         * @tc.desc    Function test
902
         * @tc.level   3
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00500", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = 123;
                data.writeInterfaceToken(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00600
         * @tc.name    Call the writeshortarray interface, write the array to the MessageSequence instance,
         *             and call readshortarray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wShortArryData = [-1, 0, 1];
                data.writeShortArray(wShortArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SHORTARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readShortArray(),wShortArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00700
         * @tc.name    Call the writeshortarray interface, write the short integer array to the MessageSequence instance,
         *             and call readshortarray (datain: number []) to read the data
         * @tc.desc    Function test
953
         * @tc.level   3
954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wShortArryData = [];
                for(let i=0;i<(50*1024 - 1);i++){
                    wShortArryData[i] = 1;
                }
                data.writeShortArray(wShortArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SHORTARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rShortArryData =[];
                    result.reply.readShortArray(rShortArryData);
                    assertArrayElementEqual(rShortArryData,wShortArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00800
         * @tc.name    Writeshortarray interface, boundary value verification
         * @tc.desc    Function test
986
         * @tc.level   3
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wShortArryData = [-32768, 0, 1, 2, 32767];
                data.writeShortArray(wShortArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SHORTARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readShortArray(),wShortArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_00900
         * @tc.name    Writeshortarray interface, illegal value validation
         * @tc.desc    Function test
1014
         * @tc.level   3
1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_00900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_00900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var eShortArryData = [-32769, 32768];
                data.writeShortArray(eShortArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SHORTARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var erShortArryData = [32767, -32768];
                    assertArrayElementEqual(result.reply.readShortArray(),erShortArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_00900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01000
         * @tc.name    Writeshortarray interface, transmission length verification
         * @tc.desc    Function test
1043
         * @tc.level   3
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01000", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var eShortArryData = [];
                for(let i=0;i<50*K;i++){
                    eShortArryData[i] = 1;
                };
                data.writeShortArray(eShortArryData);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01100
         * @tc.name    Call the writelongarray interface, write the long integer array to the MessageSequence instance,
         *             and call readlongarray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wLongArryData = [3276826, 123456, 9999999];
                data.writeLongArray(wLongArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_LONGARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readLongArray(),wLongArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01200
         * @tc.name    Call the writelongarray interface, write the long integer array to the MessageSequence instance,
         *             and call readlongarray (datain: number []) to read the data
         * @tc.desc    Function test
1097
         * @tc.level   3
1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wLongArryData = [];
                for(let i=0;i<(25*K - 1);i++){
                    wLongArryData[i] = 11;
                };
                data.writeLongArray(wLongArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_LONGARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rLongArryData = [];
                    result.reply.readLongArray(rLongArryData);
                    assertArrayElementEqual(rLongArryData,wLongArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01300
         * @tc.name    Writelongarray interface, boundary value verification
         * @tc.desc    Function test
1130
         * @tc.level   3
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wLongArryData = [-9007199254740992, 0, 1, 2, 9007199254740991];
                data.writeLongArray(wLongArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_LONGARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rLongArryData = [];
                    result.reply.readLongArray(rLongArryData);
                    assertArrayElementEqual(rLongArryData,wLongArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01400
         * @tc.name    Writelongarray interface, long type precision verification
         * @tc.desc    Function test
1160
         * @tc.level   3
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wLongArryData = [-9999999999999999, 9999999999999999];
                data.writeLongArray(wLongArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_LONGARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rLongArryData = result.reply.readLongArray();
                    let newlongdata = [-10000000000000000,10000000000000000];
                    expect(rLongArryData[0]).assertEqual(newlongdata[0]);
                    expect(rLongArryData[1]).assertEqual(newlongdata[1]);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01500
         * @tc.name    Writelongarray Indicates an interface for verifying the input length
         * @tc.desc    Function test
1191
         * @tc.level   3
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01500", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var wLongArryData = [];
                for(let i=0;i<25*K;i++){
                    wLongArryData[i] = 11;
                };
                data.writeLongArray(wLongArryData);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01600
         * @tc.name    Call the writedoublearray interface, write the array to the MessageSequence instance,
         *             and call readdoublearra to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wDoubleArryData = [1.2, 235.67, 99.76];
                data.writeDoubleArray(wDoubleArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_DOUBLEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readDoubleArray(), wDoubleArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01700
         * @tc.name    Call the writedoublearray interface, write the array to the MessageSequence instance,
         *             and call readdoublearra (datain: number []) to read the data
         * @tc.desc    Function test
1245
         * @tc.level   3
1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wDoubleArryData = [];
                for(let i = 0;i < (25*K - 1);i++){
                    wDoubleArryData[i] = 11.1;
                };
                data.writeDoubleArray(wDoubleArryData);    
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_DOUBLEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rDoubleArryData = [];
                    result.reply.readDoubleArray(rDoubleArryData);
                    assertArrayElementEqual(rDoubleArryData, wDoubleArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01800
         * @tc.name    Writedoublearray interface, boundary value verification
         * @tc.desc    Function test
1278
         * @tc.level   3
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wDoubleArryData = [4.9E-324, 235.67, 1.79E+308];
                data.writeDoubleArray(wDoubleArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_DOUBLEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readDoubleArray(), wDoubleArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_01900
         * @tc.name    Writedoublearray interface, illegal value validation
         * @tc.desc    Function test
1306
         * @tc.level   3
1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_01900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_01900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();   
                var eDoubleArryData = [(4.9E-324) - 1, (1.79E+308) + 1];
                data.writeDoubleArray(eDoubleArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_DOUBLEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rDoubleArryData = result.reply.readDoubleArray();
                    expect(rDoubleArryData[0]).assertEqual(-1);
                    expect(rDoubleArryData[1]).assertEqual(1.79e+308);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_01900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02000
         * @tc.name    Writedoublearray interface, Out-of-bounds value verification
         * @tc.desc    Function test
1336
         * @tc.level   3
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02000", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var eDoubleArryData = [];
                for(let i = 0;i < 25*K;i++){
                    eDoubleArryData[i] = 11.1;
                }
                data.writeDoubleArray(eDoubleArryData);   
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02100
         * @tc.name    Call the writebooleanarray interface, write the array to the MessageSequence instance,
         *             and call readbooleanarray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wBooleanArryData = [true, false, false];
                data.writeBooleanArray(wBooleanArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BOOLEANARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readBooleanArray(),wBooleanArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02200
         * @tc.name    Call the writebooleanarray interface, write the array to the MessageSequence instance,
         *             and call readbooleanarray (datain: number []) to read the data
         * @tc.desc    Function test
1390
         * @tc.level   3
1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wBooleanArryData = [];
                for (let i=0;i<(50*K - 1);i++){
                    if (i % 2 == 0){
                        wBooleanArryData[i] = false;
                    }else {
                        wBooleanArryData[i] = true;
                    }
                }
                data.writeBooleanArray(wBooleanArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BOOLEANARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rBooleanArryData = [];
                    result.reply.readBooleanArray(rBooleanArryData);
                    assertArrayElementEqual(rBooleanArryData,wBooleanArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02300
         * @tc.name    Writebooleanarray interface, illegal value validation
         * @tc.desc    Function test
1427
         * @tc.level   3
1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var errorBooleanArryData = [true, 9, false];
                data.writeBooleanArray(errorBooleanArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BOOLEANARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var eCharArrayData = [true, false, false];
                    assertArrayElementEqual(result.reply.readBooleanArray(),eCharArrayData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02400
         * @tc.name    Writebooleanarray Interface for length verification of input parameters
         * @tc.desc    Function test
1456
         * @tc.level   3
1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02400", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var wBooleanArryData = [];
                for (let i=0;i<50*K;i++){
                    if (i % 2 == 0){
                        wBooleanArryData[i] = false;
                    }else {
                        wBooleanArryData[i] = true;
                    };
                }
                data.writeBooleanArray(wBooleanArryData);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02500
         * @tc.name    Call the writechararray interface, write the array to the MessageSequence instance,
         *             and call readchararray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wCharArryData = [0,97,255];
                data.writeCharArray(wCharArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_CHARARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readCharArray(),wCharArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02600
         * @tc.name    Call the writechararray interface, write the array to the MessageSequence instance,
         *             and call readchararray (datain: number []) to read the data
         * @tc.desc    Function test
1514
         * @tc.level   3
1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wCharArryData = [];
                for(let i=0;i<(50*K - 1);i++){
                    wCharArryData[i] = 96;
                };
                data.writeCharArray(wCharArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_CHARARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rCharArryData = [];
                    result.reply.readCharArray(rCharArryData);
                    assertArrayElementEqual(rCharArryData,wCharArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02700
         * @tc.name    Writechararray interface, illegal value validation
         * @tc.desc    Function test
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var errorCharArryData = [96, 'asfgdgdtu', 97];
                data.writeCharArray(errorCharArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_CHARARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let eCharArrayData = [96, 0, 97];
                    let readchardata = result.reply.readCharArray();
                    assertArrayElementEqual(readchardata, eCharArrayData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02800
         * @tc.name    Writechararray Indicates the length of an interface input parameter
         * @tc.desc    Function test
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02800", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var errorCharArryData = [];
                for(let i=0;i<50*K;i++){
                    errorCharArryData[i] = 96;
                };
                data.writeCharArray(errorCharArryData);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_02900
         * @tc.name    Call the writestringarray interface, write the array to the MessageSequence instance,
         *             and call readstringarray (datain: number []) to read the data
         * @tc.desc    Function test
1600
         * @tc.level   3
1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_02900", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_02900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wStringArryData = ['abc', 'hello', 'beauty'];
                data.writeStringArray(wStringArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRINGARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readStringArray(),wStringArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_02900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03000
         * @tc.name    Call the writestringarray interface, write the array to the MessageSequence instance,
         *             and call readstringarray() to read the data
         * @tc.desc    Function test
1627
         * @tc.level   3
1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03000", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wStringArryData = [];
                for (let i = 0;i < (10*K - 1);i++){
                    wStringArryData[i] = "heddSDF";
                };
                data.writeStringArray(wStringArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRINGARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var rStringArryData = [];
                    result.reply.readStringArray(rStringArryData);
                    assertArrayElementEqual(rStringArryData,wStringArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03100
         * @tc.name    Writestringarray interface, illegal value validation
         * @tc.desc    Function test
1658
         * @tc.level   3
1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03100", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var errorStringArryData = ['abc' , 123, 'beauty'];
                data.writeStringArray(errorStringArryData);
    
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03200
         * @tc.name    writeStringArray Interface for length verification of input parameters
         * @tc.desc    Function test
1680
         * @tc.level   3
1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03200", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var wStringArryData = [];
                for (let i = 0;i < 10 * K;i++){
                    wStringArryData[i] = "heddSDF";
                }
                data.writeStringArray(wStringArryData);
            } catch (error) {
                expect(error != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03300
         * @tc.name    Call the writebytearray interface, write the array to the MessageSequence instance,
         *             and call readbytearray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                let ByteArrayVar = [1, 2, 3, 4, 5];
                data.writeByteArray(ByteArrayVar);
    
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readByteArray(),ByteArrayVar);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03400
         * @tc.name    Call the writebytearray interface, write the array to the MessageSequence instance,
         *             and call readbytearray (datain: number []) to read the data
         * @tc.desc    Function test
1735
         * @tc.level   3
1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                let ByteArrayVar = [-128, 0, 1, 2, 127];
                data.writeByteArray(ByteArrayVar);
    
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var newArr = new Array(5);
                    result.reply.readByteArray(newArr);
                    assertArrayElementEqual(ByteArrayVar,newArr);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03500
         * @tc.name    Writebytearray interface, boundary value verification
         * @tc.desc    Function test
1766
         * @tc.level   3
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
    
                let ByteArrayVar = [];
                for (let i=0;i<(40*K - 1);i++){
                    ByteArrayVar[i] = 1;
                }
                data.writeByteArray(ByteArrayVar);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var newArr = new Array(5)
                    result.reply.readByteArray(newArr);
                    assertArrayElementEqual(newArr,ByteArrayVar);
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03600
         * @tc.name    Writebytearray interface, illegal value validation
         * @tc.desc    Function test
1800
         * @tc.level   3
1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                let ByteArrayVar = [-129, 0, 1, 2, 128];
                data.writeByteArray(ByteArrayVar);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var shortArryDataReply = result.reply.readByteArray();
                    expect(shortArryDataReply[0] == 127).assertTrue();
                    expect(shortArryDataReply[1] == ByteArrayVar[1]).assertTrue();
                    expect(shortArryDataReply[2] == ByteArrayVar[2]).assertTrue();
                    expect(shortArryDataReply[3] == ByteArrayVar[3]).assertTrue();
                    expect(shortArryDataReply[4] == -128).assertTrue();
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03700
         * @tc.name    Writebytearray Interface,input parameter length verification
         * @tc.desc    Function test
1833
         * @tc.level   3
1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03700", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                let ByteArrayVar = [];
                for (let i=0;i<40*K;i++){
                    ByteArrayVar[i] = 1;
                }
                data.writeByteArray(ByteArrayVar)
                data.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03800
         * @tc.name    Call the writeintarray interface, write the array to the MessageSequence instance,
         *             and call readintarray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var intArryData = [100, 111, 112];
                data.writeIntArray(intArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readIntArray(),intArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_03900
         * @tc.name    Call the writeintarray interface, write the array to the MessageSequence instance,
         *             and call readintarray (datain: number []) to read the data
         * @tc.desc    Function test
1887
         * @tc.level   3
1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_03900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_03900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var intArryData = [];
                for (let i=0;i<(50*K - 1);i++){
                    intArryData[i] = 1;
                };
                data.writeIntArray(intArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
1903
                    var newArr = new Array(3);
1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919
                    result.reply.readIntArray(newArr);
                    assertArrayElementEqual(newArr,intArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_03900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04000
         * @tc.name    Writeintarray interface, boundary value verification
         * @tc.desc    Function test
1920
         * @tc.level   3
1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04000", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var intArryData = [-2147483648, 0, 1, 2, 2147483647];
                data.writeIntArray(intArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readIntArray(),intArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04100
         * @tc.name    Writeintarray interface, illegal value verification
         * @tc.desc    Function test
1947
         * @tc.level   3
1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04100", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var intArryData = [-2147483649, 0, 1, 2, 2147483648];
                data.writeIntArray(intArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var shortArryDataReply = result.reply.readIntArray();
                    expect(shortArryDataReply[0] == 2147483647).assertTrue();
                    expect(shortArryDataReply[1] == intArryData[1]).assertTrue();
                    expect(shortArryDataReply[2] == intArryData[2]).assertTrue();
                    expect(shortArryDataReply[3] == intArryData[3]).assertTrue();
                    expect(shortArryDataReply[4] == -2147483648).assertTrue();
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04200
         * @tc.name    Writeintarray interface, input parameter length verification
         * @tc.desc    Function test
1979
         * @tc.level   3
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04200", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var intArryData = [];
                for (let i=0;i<50*K;i++){
                    intArryData[i] = 1;
                }
                data.writeIntArray(intArryData);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04300
         * @tc.name    Call the writefloatarray interface, write the array to the MessageSequence instance,
         *             and call readfloatarray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var floatArryData = [1.2, 1.3, 1.4];
                data.writeFloatArray(floatArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOATARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readFloatArray(),floatArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04400
         * @tc.name    Call the writefloatarray interface, write the array to the MessageSequence instance,
         *             and call readfloatarray (datain: number []) to read the data
         * @tc.desc    Function test
2033
         * @tc.level   3
2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var floatArryData = [1.4E-45, 1.3, 3.4028235E38];
                data.writeFloatArray(floatArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOATARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
2046
                    var newArr = new Array(3);
2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062
                    result.reply.readFloatArray(newArr);
                    assertArrayElementEqual(newArr,floatArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04500
         * @tc.name    Writefloatarray interface, boundary value verification
         * @tc.desc    Function test
2063
         * @tc.level   3
2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var floatArryData = [(1.4E-45) - 1, 1.3, (3.4028235E38) + 1];
                data.writeFloatArray(floatArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOATARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var newArr = result.reply.readFloatArray();
                    expect(newArr[0]).assertEqual(-1);
                    expect(newArr[1]).assertEqual(1.3);
                    expect(newArr[2]).assertEqual(3.4028235e+38);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04600
         * @tc.name    Writefloatarray interface, boundary value verification
         * @tc.desc    Function test
2094
         * @tc.level   3
2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var floatArryData = [];
                for (let i = 0;i < (25*K - 1);i++){
                    floatArryData[i] = 1.1;
                };
                data.writeFloatArray(floatArryData);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOATARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    assertArrayElementEqual(result.reply.readFloatArray(),floatArryData);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04700
         * @tc.name    Writefloatarray interface, Longest array verification
         * @tc.desc    Function test
2125
         * @tc.level   3
2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04700", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var floatArryData = [];
                for (let i = 0;i < (25*K);i++){
                    floatArryData[i] = 1.1;
                };
                data.writeFloatArray(floatArryData);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04800
         * @tc.name    Call the writeShort interface to write the short integer data to the MessageSequence instance,
         *             and call readshort to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var short = 8;
                data.writeShort(short);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SHORT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923
                    assertArrayElementEqual(result.reply.readShort(),short);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_04900
         * @tc.name    WriteShort interface, boundary value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_04900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_04900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeShort(-32768);
                data.writeShort(0);
                data.writeShort(1);
                data.writeShort(2);
                data.writeShort(32767);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SHORT_MULTI, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readShort() == -32768).assertTrue();
                    expect(result.reply.readShort() == 0).assertTrue();
                    expect(result.reply.readShort() == 1).assertTrue();
                    expect(result.reply.readShort() == 2).assertTrue();
                    expect(result.reply.readShort() == 32767).assertTrue();
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_04900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05000
         * @tc.name    WriteShort interface, Boundary value minimum value out of bounds verification
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeShort(-32769);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SHORT_MULTI, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readShort() == 32767).assertTrue();
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05100
         * @tc.name    WriteShort interface, Boundary value maximum value out of bounds verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeShort(32768);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SHORT_MULTI, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readShort() == -32768).assertTrue();
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05100---------------------------");
        });
        
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05200
         * @tc.name    Call writelong interface to write long integer data to MessageSequence instance
         *             and call readlong to read data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var long = 9007199254740991;
                data.writeLong(long);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_LONG, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readLong()).assertEqual(long);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05200---------------------------");
        });
    
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05300
         * @tc.name    Writelong interface, Verification of maximum accuracy value
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var long = -9007199254740992;
                data.writeLong(long);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_LONG, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readLong() == long).assertTrue();
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05400
         * @tc.name    Writelong interface, Minimum loss accuracy verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var long = -9223372036854775300;
                data.writeLong(long);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_LONG, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readLong()).assertEqual(-9223372036854776000);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05500
         * @tc.name    Writelong interface, Maximum loss accuracy verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var short = 9223372036854775300;
                data.writeLong(short);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_LONG, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let readlong = result.reply.readLong();
                    expect(readlong != 0).assertTrue();
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05600
         * @tc.name    Call the parallel interface to read and write data to the double instance
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 4.9E-324;
                data.writeDouble(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_DOUBLE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readDouble()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05700
         * @tc.name    Writedouble interface, boundary value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 1.79E+308;
                data.writeDouble(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_DOUBLE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readDouble()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05800
         * @tc.name    Writedouble interface, Minimum boundary value out of bounds verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = (4.9E-324) - 1;
                data.writeDouble(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_DOUBLE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readDouble()).assertEqual(-1);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_05900
         * @tc.name    Writedouble interface, illegal value validation
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_05900", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_05900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = "1.79E+465312156";
                data.writeDouble(token);
                data.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_05900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06000
         * @tc.name    Call the writeboolean interface to write the data to the MessageSequence instance,
         *             and call readboolean to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06000", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = true;
                data.writeBoolean(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BOOLEAN, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readBoolean()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06100
         * @tc.name    Call the writeboolean interface to write the data to the MessageSequence instance,
         *             and call readboolean to read the data
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06100", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = false;
                data.writeBoolean(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BOOLEAN, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readBoolean()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06200
         * @tc.name    Writeboolean interface, illegal value number type verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06200", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                data.writeBoolean(9);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06300
         * @tc.name    Writeboolean interface, illegal value string type verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = "true";
                data.writeBoolean(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06400
         * @tc.name    Call the writechar interface to write the minimum data to the MessageSequence instance,
         *               and call readchar to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 0;
                data.writeChar(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readChar()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06500
         * @tc.name    Call the writechar interface to write the maximum data to the MessageSequence instance,
         *              and call readchar to read the data
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06500", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 255;
                data.writeChar(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readChar()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06600
         * @tc.name    Call the writechar interface to write the minimum out of range data to the MessageSequence instance,
         *              and call readchar to read the data
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = -1;
                data.writeChar(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readChar()).assertEqual(255);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06700
         * @tc.name    Call the writechar interface to write the maximum out of range data to the MessageSequence instance,
         *              and call readchar to read the data
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06700", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 256;
                data.writeChar(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readChar()).assertEqual(0);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06800
         * @tc.name    Writechar interface, illegal value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = 'ades';
                data.writeChar(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_06900
         * @tc.name    Call the writestring interface to write the data to the MessageSequence instance,
         *             and call readstring() to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_06900", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_06900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = '';
                for(var i = 0; i < (40*K - 1); i++){
                    token += 'a';
                }
                data.writeString(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readString()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_06900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07000
         * @tc.name    Writestring interface Maximum data out of range verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07000", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = '';
                for(var i = 0; i < 40*K; i++){
                    token += 'a';
                }
                data.writeString(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07100
         * @tc.name    Writestring interface, illegal value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = 123;
                data.writeString(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07200
         * @tc.name    Call the writebyte interface to write data to the MessageSequence instance,
         *             and call readbyte to read data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 2;
                data.writeByte(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BYTE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readByte()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07300
         * @tc.name    Writebyte interface, boundary value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeByte(128);
                data.writeByte(0);
                data.writeByte(1);
                data.writeByte(2);
                data.writeByte(127);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BYTE_MULTI, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(reply.readByte()).assertEqual(-128);
                    expect(reply.readByte()).assertEqual(0);
                    expect(reply.readByte()).assertEqual(1);
                    expect(reply.readByte()).assertEqual(2);
                    expect(reply.readByte()).assertEqual(127);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim()
            reply.reclaim()
            done()
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07400
         * @tc.name    Writebyte interface, Maximum boundary value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeByte(-129);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BYTE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readByte()).assertEqual(127);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07500
         * @tc.name    Writebyte interface, Minimum boundary value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07500", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeByte(128);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_BYTE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readByte()).assertEqual(-128);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07600
         * @tc.name    Writebyte interface, illegal value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07600", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                data.writeByte("error");  
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07700
         * @tc.name    Call the writeint interface to write the data to the MessageSequence instance,
         *             and call readint to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07700", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 2;
                data.writeInt(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07800
         * @tc.name    Writeint interface, boundary value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeInt(-2147483648);
                data.writeInt(0);
                data.writeInt(1);
                data.writeInt(2);
                data.writeInt(2147483647);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT_MULTI, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(-2147483648);
                    expect(result.reply.readInt()).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(1);
                    expect(result.reply.readInt()).assertEqual(2);
                    expect(result.reply.readInt()).assertEqual(2147483647);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_07900
         * @tc.name    Writeint interface, Verification of minimum boundary overrun value
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_07900", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_07900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeInt(-2147483649);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT_MULTI, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(2147483647);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_07900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08000
         * @tc.name    Writeint interface, Verification of maximum boundary overrun value
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08000", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeInt(2147483648);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT_MULTI, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(-2147483648);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08100
         * @tc.name    Writeint interface, illegal value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                data.writeInt("error");
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08200
         * @tc.name    Call the writefloat interface to write data to the MessageSequence instance,
         *             and call readfloat to read data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 2.2;
                data.writeFloat(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readFloat()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08300
         * @tc.name    Writefloat interface, Minimum boundary value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 1.4E-45;
                data.writeFloat(token);
    
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readFloat()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08400
         * @tc.name    Writefloat interface, Maximum boundary value verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = 3.4028235E38;
                data.writeFloat(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readFloat()).assertEqual(token);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08500
         * @tc.name    Writefloat interface, Verification of maximum boundary overrun value
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08500", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = (3.4028235E38) + 1;
                data.writeFloat(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readFloat()).assertEqual(3.4028235e+38);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08600
         * @tc.name    Writefloat interface, Verification of minimum boundary overrun value
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = (1.4E-45) - 1;
                data.writeFloat(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readFloat()).assertEqual(-1);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08700
         * @tc.name    Writefloat interface, illegal value validation
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = 'a';
                data.writeFloat(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08800
         * @tc.name    Call the getRawDataCapacity interface to get the maximum amount of raw data that a MessageSequence
                         can hold
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08800---------------------------");
            try{
                let parcel = new rpc.MessageSequence();
                let reply = new rpc.MessageSequence();
                let option = new  rpc.MessageOption();
                expect(parcel.getRawDataCapacity()).assertEqual(128*M);
                parcel.writeIntArray([1, 2, 3, 4, 5]);
                expect(parcel.getRawDataCapacity()).assertEqual(128*M);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INTARRAY, parcel, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.getRawDataCapacity()).assertEqual(128*M);
                    assertArrayElementEqual(result.reply.readIntArray(),[1, 2, 3, 4, 5]);
                    expect(result.reply.getRawDataCapacity()).assertEqual(128*M);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08800---------------------------");
        });
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_08900
        * @tc.name    Test MessageSequence to deliver rawdata data
        * @tc.desc    Function test
        * @tc.level   3
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_08900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_08900---------------------------");
            try{
                let parcel = new rpc.MessageSequence();
                let reply = new rpc.MessageSequence();
                let option = new rpc.MessageOption();
                let arr = [1, 2, 3, 4, 5];
                parcel.writeInt(arr.length);
                parcel.writeRawData(arr, arr.length);
                expect(parcel.getRawDataCapacity()).assertEqual(128*M);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_RAWDATA, parcel, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let size = result.reply.readInt();
                    expect(size).assertEqual(arr.length);
                    expect(result.reply.getRawDataCapacity()).assertEqual(128*M);
                    assertArrayElementEqual(result.reply.readRawData(size),arr);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_08900---------------------------");
        });
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09000
        * @tc.name    Test MessageSequence to pass abnormal rawdata data, and expand the capacity for verification
        * @tc.desc    Function test
        * @tc.level   3
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09000---------------------------");
            try{
                let parcel = new rpc.MessageSequence();
                let reply = new rpc.MessageSequence();
                let option = new rpc.MessageOption();
                let arr = [1, 2, 3, 4, 5];
                parcel.writeInt(arr.length + 1);
                parcel.writeRawData(arr, (arr.length + 1));
                expect(parcel.getRawDataCapacity()).assertEqual(128*M);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_RAWDATA, parcel, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let size = result.reply.readInt();
                    expect(size).assertEqual(arr.length + 1);
                    expect(result.reply.getRawDataCapacity()).assertEqual(128*M);
                    let newReadResult = result.reply.readRawData(size);
                    expect(arr[0]).assertEqual(newReadResult[0]);
                    expect(arr[1]).assertEqual(newReadResult[1]);
                    expect(arr[2]).assertEqual(newReadResult[2]);
                    expect(arr[3]).assertEqual(newReadResult[3]);
                    expect(arr[4]).assertEqual(newReadResult[4]);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09000---------------------------");
        });
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09100
        * @tc.name    Test MessageSequence to pass exception rawdata data data interception verification
        * @tc.desc    Function test
        * @tc.level   3
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09100---------------------------");
            try{
                let parcel = new rpc.MessageSequence();
                let reply = new rpc.MessageSequence();
                let option = new rpc.MessageOption();
                let arr = [1, 2, 3, 4, 5];
                parcel.writeInt(arr.length - 1);
                parcel.writeRawData(arr, (arr.length - 1));
                expect(parcel.getRawDataCapacity()).assertEqual(128*M);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_RAWDATA, parcel, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let size = result.reply.readInt();
                    expect(size).assertEqual(arr.length - 1);
                    expect(result.reply.getRawDataCapacity()).assertEqual(128*M);
                    let newReadResult = result.reply.readRawData(size);
                    expect(arr[0]).assertEqual(newReadResult[0]);
                    expect(arr[1]).assertEqual(newReadResult[1]);
                    expect(arr[2]).assertEqual(newReadResult[2]);
                    expect(arr[3]).assertEqual(newReadResult[3]);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09100---------------------------");
        });
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09200
        * @tc.name    Test MessageSequence to deliver out-of-bounds RawData data
        * @tc.desc    Function test
        * @tc.level   3
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09200---------------------------");
            try{
                let parcel = new rpc.MessageSequence();
                let reply = new rpc.MessageSequence();
                let option = new rpc.MessageOption();
                let arr = [-129, 2, 3, 4, 128];
                parcel.writeInt(arr.length);
                parcel.writeRawData(arr, arr.length);
                expect(parcel.getRawDataCapacity()).assertEqual(128*M);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_RAWDATA, parcel, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let size = result.reply.readInt();
                    expect(size).assertEqual(arr.length);
                    expect(result.reply.getRawDataCapacity()).assertEqual(128*M);
                    assertArrayElementEqual(result.reply.readRawData(size),arr);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09200---------------------------");
        });
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09300
        * @tc.name    Test MessageSequence to deliver illegal RawData data
        * @tc.desc    Function test
        * @tc.level   3
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09300", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09300---------------------------");
            try{
                let parcel = new rpc.MessageSequence();
                let arr = ["aaa", 1, 2, 3];
                parcel.writeInt(arr.length);
                parcel.writeRawData(arr, arr.length);
                expect(parcel.getRawDataCapacity()).assertEqual(128*M);
                parcel.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09300---------------------------");
        }); 
        
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09400
         * @tc.name    Call the writeremoteobject interface to serialize the remote object
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09400", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09400---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let testRemoteObject = new TestRemoteObject("testObject");
                data.writeRemoteObject(testRemoteObject);
                expect( data.readRemoteObject() != null).assertTrue();
                data.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09500
         * @tc.name    Call the writeremoteobject interface to serialize the remote object and pass in the empty object
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09500", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = new TestRemoteObject(null);
                data.writeRemoteObject(token);
            } catch (error) {
                expect(error != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09500---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09600
        * @tc.name    Call the writeremoteobject interface to serialize the remote object and pass in the empty object
        * @tc.desc    Function test
        * @tc.level   3   
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09600", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = {};
                data.writeRemoteObject(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.PROXY_OR_REMOTE_OBJECT_INVALID_ERROR}`;
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageSequence_09600: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09600---------------------------");
        });        
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09700
         * @tc.name    Call the writeParcelable interface to write the custom serialized
         *             object to the MessageSequence instance
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                let sequenceable = new MySequenceable(1, "aaa");
                data.writeParcelable(sequenceable);
                let ret = new MySequenceable(0, "");
                data.readParcelable(ret);
            } catch (error) {
                expect(error).assertEqual(null);
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09800
         * @tc.name    Call the writeParcelable interface to write the custom serialized
         *             object to the MessageSequence instance, Migration to read
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                let sequenceable = new MySequenceable(1, "aaa");
                data.writeParcelable(sequenceable);
                let ret = new MySequenceable(1, "");
                data.readParcelable(ret);
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_09900
         * @tc.name    After the server finishes processing, write noexception first before writing the result,
         *             and the client calls readexception to judge whether the server is abnormal
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_09900", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_09900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeNoException();
                data.writeInt(6);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_NOEXCEPTION, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    result.reply.readException();
                    expect(result.reply.readInt()).assertEqual(6);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_09900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10000
         * @tc.name    If the data on the server is abnormal, the client calls readexception
         *             to judge whether the server is abnormal
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10000", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeNoException();
                data.writeInt(1232222223444);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_NOEXCEPTION, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    result.reply.readException();
                    expect(result.reply.readInt() != 1232222223444).assertTrue();
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10100
         * @tc.name    Serializable object marshaling and unmarshalling test
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var sequenceable = new MySequenceable(1, "aaa");
                data.writeParcelable(sequenceable);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SEQUENCEABLE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var s = new MySequenceable(null,null);
                    result.reply.readParcelable(s);
                    expect(s.str).assertEqual(sequenceable.str);
                    expect(s.num).assertEqual(sequenceable.num);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10200
         * @tc.name    Non serializable object marshaling test
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var sequenceable = new MySequenceable(1, 1);
                data.writeParcelable(sequenceable);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code == errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10300
         * @tc.name    The server did not send a serializable object, and the client was ungrouped
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var sequenceable = 10;
                data.writeInt(sequenceable);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var s = new MySequenceable(0,null);
                    result.reply.readParcelable(s);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10400
         * @tc.name    Call the writeParcelable interface to write the custom serialized object to the
         *             MessageSequence instance, and call readParcelable to read the data
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var sequenceable = new MySequenceable(2, "abc");
                data.writeParcelable(sequenceable);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SEQUENCEABLE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var s = new MySequenceable(null,null);
                    result.reply.readParcelable(s);
                    expect(s.str).assertEqual(sequenceable.str);
                    expect(s.num).assertEqual(sequenceable.num);
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10400---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10500
         * @tc.name    Call the writeParcelablearray interface to write the custom serialized object array (1, 2, 3) to
         *              the MessageSequence instance, and call readParcelablearray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10500", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var sequenceable = [new MySequenceable(1, "aaa"),
                    new MySequenceable(2, "bbb"), new MySequenceable(3, "ccc")];
                data.writeParcelableArray(sequenceable);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SEQUENCEABLEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var s = [new MySequenceable(null, null), new MySequenceable(null, null),
                        new MySequenceable(null, null)];
                    result.reply.readParcelableArray(s);
                    for (let i = 0; i < s.length; i++) {
                        expect(s[i].str).assertEqual(sequenceable[i].str);
                        expect(s[i].num).assertEqual(sequenceable[i].num);
                    }
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10600
         * @tc.name    Call the writeParcelablearray interface to write the custom serialized object to the
         *             MessageSequence instance, and call readParcelablearray to read the data
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var sequenceable = [new MySequenceable(4, "abc"),
                    new MySequenceable(5, "bcd"), new MySequenceable(6, "cef")];
                data.writeParcelableArray(sequenceable);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_SEQUENCEABLEARRAY, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    var s = [new MySequenceable(null, null),
                        new MySequenceable(null, null), new MySequenceable(null, null)];
                    result.reply.readParcelableArray(s);
                    for (let i = 0; i < s.length; i++) {
                        expect(s[i].str).assertEqual(sequenceable[i].str);
                        expect(s[i].num).assertEqual(sequenceable[i].num);
                    };
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10700
         * @tc.name    Call the writeParcelablearray interface to write the custom
         *             serialized object to the MessageSequence instance
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var sequenceable = 1;
                data.writeParcelableArray(sequenceable);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`;
                expect(error.code == errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10800
         * @tc.name    Call the writeremoteobjectarray interface to write the object array to the MessageSequence
         *             instance, and call readremoteobjectarray to read the data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10800---------------------------");
            try{
                let count = 0;
                function checkResult(num, str) {
                    expect(num).assertEqual(123);
                    expect(str).assertEqual("rpcListenerTest");
                    count++;
                    console.info("check result done, count: " + count);
                    if (count == 3) {
                        done();
                    };
                };
                let data = rpc.MessageSequence.create();
                let reply = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                data.writeInterfaceToken("rpcTestAbility");
                let listeners = [new TestListener("rpcListener", checkResult),
                    new TestListener("rpcListener2", checkResult),
                    new TestListener("rpcListener3", checkResult)];
                data.writeRemoteObjectArray(listeners);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageSequence_10800: sendMessageRequest is " + result.errCode);
                    expect(result.errCode).assertEqual(0);
                    expect(result.code).assertEqual(CODE_WRITE_REMOTEOBJECTARRAY);
                    expect(result.data).assertEqual(data);
                    expect(result.reply).assertEqual(reply);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_10900
         * @tc.name    Call the writeremoteobjectarray interface to write the object array to the MessageSequence instance,
         *             and call readremoteobjectarray (objects: iremoteobject []) to read the data
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_10900", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_10900---------------------------");
            try{
                let count = 0;
                function checkResult(num, str) {
                    expect(num).assertEqual(123);
                    expect(str).assertEqual("rpcListenerTest");
                    count++;
                    console.info("check result done, count: " + count);
                    if (count == 3) {
                        done();
                    }
                }
                let data = rpc.MessageSequence.create();
                let reply = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                data.writeInterfaceToken("rpcTestAbility");
                let listeners = [new TestListener("rpcListener", checkResult),
                    new TestListener("rpcListener2", checkResult),
                    new TestListener("rpcListener3", checkResult)];
                data.writeRemoteObjectArray(listeners);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageSequence_10900: sendMessageRequest is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_10900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11000
         * @tc.name    Test MessageSequence to deliver the reply message received in promise across processes
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_11000", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeByte(2);
                data.writeShort(3);
                data.writeInt(4);
                data.writeLong(5);
                data.writeFloat(1.2);
                data.writeDouble(10.2);
                data.writeBoolean(true);
                data.writeChar(97);
                data.writeString("HelloWorld");
                data.writeParcelable(new MySequenceable(1, "aaa"));
                await gIRemoteObject.sendMessageRequest(CODE_ALL_TYPE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readByte()).assertEqual(2);
                    expect(result.reply.readShort()).assertEqual(3);
                    expect(result.reply.readInt()).assertEqual(4);
                    expect(result.reply.readLong()).assertEqual(5);
                    expect(result.reply.readFloat()).assertEqual(1.2);
                    expect(result.reply.readDouble()).assertEqual(10.2);
                    expect(result.reply.readBoolean()).assertTrue();
                    expect(result.reply.readChar()).assertEqual(97)
                    expect(result.reply.readString()).assertEqual("HelloWorld");
                    let s = new MySequenceable(null, null);
                    result.reply.readParcelable(s);
                    expect(s.num).assertEqual(1);
                    expect(s.str).assertEqual("aaa");
3924 3925 3926 3927 3928 3929 3930
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
3931
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11000---------------------------");
3932 3933 3934
        });
    
        /*
3935 3936 3937
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11100
         * @tc.name    Test the cross process delivery of MessageSequence and receive the reply message
         *             in the callback function
3938
         * @tc.desc    Function test
3939
         * @tc.level   3
3940
         */
3941 3942
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_11100", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11100---------------------------");
3943 3944 3945 3946
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982
                data.writeByte(2);
                data.writeShort(3);
                data.writeInt(4);
                data.writeLong(5);
                data.writeFloat(1.2);
                data.writeDouble(10.2);
                data.writeBoolean(true);
                data.writeChar(97);
                data.writeString("HelloWorld");
                data.writeParcelable(new MySequenceable(1, "aaa"));
                function sendMessageRequestCallback(result) {
                    try{
                        console.info("sendMessageRequest Callback");
                        expect(result.errCode).assertEqual(0);
                        expect(result.reply.readByte()).assertEqual(2);
                        expect(result.reply.readShort()).assertEqual(3);
                        expect(result.reply.readInt()).assertEqual(4);
                        expect(result.reply.readLong()).assertEqual(5);
                        expect(result.reply.readFloat()).assertEqual(1.2);
                        expect(result.reply.readDouble()).assertEqual(10.2);
                        expect(result.reply.readBoolean()).assertTrue();
                        expect(result.reply.readChar()).assertEqual(97);
                        expect(result.reply.readString()).assertEqual("HelloWorld");
                        let s = new MySequenceable(null, null);
                        result.reply.readParcelable(s);
                        expect(s.num).assertEqual(1);
                        expect(s.str).assertEqual("aaa");
                    } finally {
                        result.data.reclaim();
                        result.reply.reclaim();
                        console.info("test done");
                        done();
                    }
                }
                console.info("start send request");
                await gIRemoteObject.sendMessageRequest(CODE_ALL_TYPE, data, reply, option, sendMessageRequestCallback);
3983 3984 3985 3986
    
            } catch (error) {
                expect(error == null).assertTrue();
            }
3987
            console.info("--------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11100--------------------------");
3988 3989 3990
        });
    
        /*
3991 3992 3993
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11200
         * @tc.name    Test the cross process transmission of MessageSequence.
         *             After receiving the reply message in promise, read various types of arrays in order
3994
         * @tc.desc    Function test
3995
         * @tc.level   3
3996
         */
3997 3998
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_11200", 0,async function(done){
            console.info("--------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11200--------------------------");
3999 4000 4001 4002
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015
                data.writeByteArray([1, 2, 3]);
                data.writeShortArray([4, 5, 6]);
                data.writeIntArray([7, 8, 9]);
                data.writeLongArray([10, 11, 12]);
                data.writeFloatArray([1.1, 1.2, 1.3]);
                data.writeDoubleArray([2.1, 2.2, 2.3]);
                data.writeBooleanArray([true, true, false]);
                data.writeCharArray([65,97,122]);
                data.writeStringArray(['abc', 'seggg']);
                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) => {
4016
                    expect(result.errCode).assertEqual(0);
4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032
                    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 b = [new MySequenceable(null, null), new MySequenceable(null, null),
                        new MySequenceable(null, null)];
                    result.reply.readParcelableArray(b);
                    for (let i = 0; i < b.length; i++) {
                        expect(b[i].str).assertEqual(a[i].str);
                        expect(b[i].num).assertEqual(a[i].num);
                    }
4033 4034 4035 4036 4037 4038 4039
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
4040
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11200---------------------------");
4041 4042 4043
        });
    
        /*
4044 4045 4046 4047
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11300
         * @tc.name    Test MessageSequence cross process delivery. After receiving the reply message in promise,
         *             the client constructs an empty array in sequence and reads the data from the reply message
         *             into the corresponding array
4048
         * @tc.desc    Function test
4049
         * @tc.level   3
4050
         */
4051 4052
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_11300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11300---------------------------");
4053 4054 4055 4056
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069
                data.writeByteArray([1, 2, 3]);
                data.writeShortArray([4, 5, 6]);
                data.writeIntArray([7, 8, 9]);
                data.writeLongArray([10, 11, 12]);
                data.writeFloatArray([1.1, 1.2, 1.3]);
                data.writeDoubleArray([2.1, 2.2, 2.3]);
                data.writeBooleanArray([true, true, false]);
                data.writeCharArray([65,97,122]);
                data.writeStringArray(['abc', 'seggg']);
                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).then((result) => {
4070
                    expect(result.errCode).assertEqual(0);
4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086
                    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 b = [new MySequenceable(null, null), new MySequenceable(null, null),
                        new MySequenceable(null, null)];
                    result.reply.readParcelableArray(b);
                    for (let i = 0; i < b.length; i++) {
                        expect(b[i].str).assertEqual(a[i].str);
                        expect(b[i].num).assertEqual(a[i].num);
                    }
4087 4088 4089 4090 4091 4092 4093
                });
            } catch (error) {
                expect(error == null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            done();
4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11400
         * @tc.name    Test MessageSequence to pass an object of type iremoteobject across processes
         * @tc.desc    Function test
         * @tc.level   3
         */
        it('SUB_Softbus_IPC_Compatibility_MessageSequence_11400', 0, async function(done) {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11400---------------------------");
            function checkResult(num, str) {
                expect(num).assertEqual(123);
                expect(str).assertEqual("rpcListenerTest");
                done();
            };
            try{
                let option = new rpc.MessageOption();
                let data = rpc.MessageSequence.create();
                let reply = rpc.MessageSequence.create();
                let listener = new TestListener("rpcListener", checkResult);
                data.writeRemoteObject(listener);
                data.writeInt(123);
                data.writeString("rpcListenerTest");
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_REMOTEOBJECT, data, reply, option).then((result)=> {
                    expect(result.errCode).assertEqual(0);
                    result.reply.readException();
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch(error) {
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11400---------------------------");
4129
        });
4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11500
         * @tc.name    Test MessageSequence to pass an array of iremoteobject objects across processes
         * @tc.desc    Function test
         * @tc.level   3
         */
        it('SUB_Softbus_IPC_Compatibility_MessageSequence_11500', 0, async function(done) {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11500---------------------------");
            let count = 0;
            function checkResult(num, str) {
                expect(num).assertEqual(123);
                expect(str).assertEqual("rpcListenerTest");
                count++;
                console.info("check result done, count: " + count);
                if (count == 3) {
                    done();
                }
            }
            try{
                let option = new rpc.MessageOption();
                let data = rpc.MessageSequence.create();
                let reply = rpc.MessageSequence.create();
                let listeners = [new TestListener("rpcListener", checkResult),
                    new TestListener("rpcListener2", checkResult),
                    new TestListener("rpcListener3", checkResult)];
                data.writeRemoteObjectArray(listeners);
                data.writeInt(123);
                data.writeString("rpcListenerTest");
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_REMOTEOBJECTARRAY_1, data, reply, option)
                    .then((result)=> {
                        expect(result.errCode).assertEqual(0);
                        result.reply.readException();
4163
                    });
4164 4165 4166 4167 4168 4169 4170
                data.reclaim();
                reply.reclaim();
            } catch(error) {
                expect(error == null).assertTrue();
            }
            done()
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11500---------------------------");
4171
        });
4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11600
         * @tc.name    Test MessageSequence to pass the array of iremoteobject objects across processes. The server
         *             constructs an empty array in onremoterequest and reads it from MessageSequence
         * @tc.desc    Function test
         * @tc.level   3
         */
        it('SUB_Softbus_IPC_Compatibility_MessageSequence_11600', 0, async function(done) {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11600---------------------------");
            let count = 0;
            function checkResult(num, str) {
                expect(num).assertEqual(123);
                expect(str).assertEqual("rpcListenerTest");
                count++;
                console.info("check result done, count: " + count);
                if (count == 3) {
                    done();
                }
            }
            try{
                let option = new rpc.MessageOption();
                let data = rpc.MessageSequence.create();
                let reply = rpc.MessageSequence.create();
                let listeners = [new TestListener("rpcListener", checkResult),
                    new TestListener("rpcListener2", checkResult),
                    new TestListener("rpcListener3", checkResult)];
                data.writeRemoteObjectArray(listeners);
                data.readRemoteObjectArray();
                data.writeInt(123);
                data.writeString("rpcListenerTest");
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_REMOTEOBJECTARRAY_2, data, reply, option)
                    .then((result)=> {
                        expect(result.errCode).assertEqual(0);
                        result.reply.readException();
                    })
                data.reclaim();
                reply.reclaim();
            } catch(error) {
                expect(error == null).assertTrue();
            }
            done()
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11600---------------------------");
4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772
        });
        
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11700
         * @tc.name    Invoke the rewindRead interface,Set 0-bit offset and read the data after offset
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_11700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11700---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeInt(12);
                data.writeString("parcel");
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(12);
                    result.reply.rewindRead(0);
                    expect(result.reply.readInt()).assertEqual(12);
                    expect(result.reply.readString()).assertEqual("");
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11800
         * @tc.name    Invoke the rewindRead interface,Set 1-bit offset and read the data after offset
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_11800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11700---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeInt(12);
                data.writeString("parcel");
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode == 0).assertTrue();
                    expect(result.reply.readInt()).assertEqual(12);
                    result.reply.rewindRead(1);
                    expect(result.reply.readInt()).assertEqual(0);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_11900
         * @tc.name    Invoke the rewindWrite interface, Set 0-bit offset and write the data after offset
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_11900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_11800---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeInt(4);
                data.rewindWrite(0);
                data.writeInt(5);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode == 0).assertTrue();
                    expect(result.reply.readInt()).assertEqual(5);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_11900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12000
         * @tc.name    Invoke the rewindWrite interface, Set 1-bit offset and write the data after offset
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12000---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeInt(4);
                data.rewindWrite(1);
                data.writeInt(5);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInt() != 5).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12000---------------------------");
        });         
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12100
         * @tc.name    setCapacity Sets the storage capacity of the null MessageSequence instance. The getCapacity
                       obtains the current MessageSequence capacity
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12100---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                expect(data.getCapacity()).assertEqual(0);
                data.setCapacity(100);
                data.writeString("constant");
                expect(data.getCapacity()).assertEqual(100);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.getCapacity()).assertEqual("constant".length * 8);
                    expect(result.reply.readString()).assertEqual("constant");
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12200
         * @tc.name    setCapacity Sets the storage capacity of the MessageSequence instance. The getCapacity
                       obtains the current MessageSequence capacity
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12200---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeString("constant");
                data.setCapacity(100);
                expect(data.getCapacity()).assertEqual(100);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readString()).assertEqual("constant");
                    expect(result.reply.getCapacity()).assertEqual("constant".length * 8);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12300
         * @tc.name    Setcapacity test: size limit verification of MessageSequence instance
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12300", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12300---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                expect(data.getCapacity()).assertEqual(0);
                data.writeString("constant");
                let getSizedata = data.getSize();
                data.setCapacity(getSizedata + 1);
                data.setCapacity(getSizedata);
                data.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`;
                expect(error.message != null).assertTrue();
                expect(error.code == errCode).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12300---------------------------");
        });
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12400
        * @tc.name    SetCapacity Tests the storage capacity threshold of the MessageSequence instance
        * @tc.desc    Function test
        * @tc.level   3
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12400---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeString("constant");
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let getSizeresult = result.reply.getSize();
                    expect(result.reply.getCapacity()).assertEqual("constant".length * 8);
                    result.reply.setCapacity(getSizeresult + 1);
                    result.reply.setCapacity(getSizeresult);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`;
                expect(error.message != null).assertTrue();
                expect(error.code == errCode).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12400---------------------------");
        });
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12500
        * @tc.name    Setcapacity test storage capacity boundary value verification of MessageSequence instance
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12500", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12500---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                expect(data.getSize()).assertEqual(0);
                data.setCapacity(M);
                expect(data.getCapacity()).assertEqual(M);
                data.setCapacity(2*G);
                data.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`;
                expect(error.message != null).assertTrue();
                expect(error.code == errCode).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12500---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12600
         * @tc.name    setSize Sets the size of the data contained in the MessageSequence instance. The getSize command
                        reads the data
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12600---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                expect(data.getSize()).assertEqual(0);
                data.setSize(0);
                data.writeString("constant");
                expect(data.getSize()).assertEqual(("constant".length * 2) + 8);
    
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.getSize()).assertEqual(("constant".length * 2) + 8);
                    expect(result.reply.readString()).assertEqual("constant");
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12700
         * @tc.name    SetSize: Increases the value of the data contained in the MessageSequence instance by 1,
                        Write setSize
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12700---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeString("constant");
                expect(data.getSize()).assertEqual(("constant".length * 2) + 8);
                data.setSize(0);
                expect(data.getSize()).assertEqual(0);
    
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.getSize()).assertEqual(8);
                    expect(result.reply.readString()).assertEqual("");
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12800
         * @tc.name    Verify the MessageSequence instance SetSize setting and the instance capacitydata qualification verification
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12800", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12800---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                expect(data.getSize()).assertEqual(0);
                data.writeString("constant");
                expect(data.getSize()).assertEqual(("constant".length * 2) + 8);
                let getCapacitydata = data.getCapacity();
                expect(getCapacitydata).assertEqual(64);
                data.setSize(getCapacitydata);
                expect(data.getSize()).assertEqual(getCapacitydata);
                data.setSize(getCapacitydata + 1);
                data.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_12900
         * @tc.name    setSize Sets the storage capacity of the MessageSequence instance to decrease by one.
                       The getSize obtains the current MessageSequence capacity
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_12900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_12900---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeString("constant");
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readString()).assertEqual("constant");
                    expect(result.reply.getSize()).assertEqual(("constant".length * 2) + 8);
                    let getCapacityresult = result.reply.getCapacity();
                    result.reply.setSize(getCapacityresult);
                    expect(result.reply.getSize()).assertEqual(getCapacityresult);
                    result.reply.setSize(getCapacityresult + 1);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_12900---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13000
         * @tc.name    Validate the setSize boundary value in the MessageSequence instance
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13000---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                expect(data.getCapacity()).assertEqual(0);
                data.setSize(4*G);
                expect(data.getSize()).assertEqual(0);
                data.setSize(4*G - 1);
                data.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13000---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13100
         * @tc.name    Verify that setSize is out of bounds in a MessageSequence instance
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13100---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                data.setSize(0);
                expect(data.getSize()).assertEqual(0);
                data.setSize(2*4*G);
                expect(data.getSize()).assertEqual(0);
                data.setSize(2*G);
                data.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13100---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13200
         * @tc.name    Obtains the write and read positions of the MessageSequence
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13200---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                expect(data.getWritePosition()).assertEqual(0);
                data.writeInt(10);
                expect(data.getWritePosition()).assertEqual(4);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.getReadPosition()).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(10);
                    expect(result.reply.getReadPosition()).assertEqual(4);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13200---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13300
         * @tc.name    Obtaining the Writable and Readable Byte Spaces of MessageSequence
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13300---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                expect(data.getWritableBytes()).assertEqual(0);
                data.writeInt(10);
                expect(data.getWritableBytes()).assertEqual(60);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(10);
                    expect(result.reply.getReadableBytes()).assertEqual(0);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13300---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13400
         * @tc.name    Obtains the writeable and readable byte space and read position of the MessageSequence
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13400---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeInt(10);
                expect(data.getWritePosition()).assertEqual(4);
                expect(data.getWritableBytes()).assertEqual(60);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.getReadableBytes()).assertEqual(4);
                    expect(result.reply.getReadPosition()).assertEqual(0);
                    expect(result.reply.readInt()).assertEqual(10);
                    expect(result.reply.getReadableBytes()).assertEqual(0);
                    expect(result.reply.getReadPosition()).assertEqual(4);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13400---------------------------");
        });
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13500
        * @tc.name    Get the space size of MessageSequence to pass rawdata data
        * @tc.desc    Function test
        * @tc.level   3
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13500---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeInt(10);
                expect(data.getWritePosition()).assertEqual(4);
                expect(data.getWritableBytes()).assertEqual(60);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.getReadPosition()).assertEqual(0);
                    expect(result.reply.getReadableBytes()).assertEqual(4);
                    expect(result.reply.readInt()).assertEqual(10);
                    expect(result.reply.getReadPosition()).assertEqual(4);
                    expect(result.reply.getReadableBytes()).assertEqual(0);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13500---------------------------");
        });
4773

4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13600
         * @tc.name    Test fixed MessageSequence space size to pass rawData data
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13600---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                expect(data.getRawDataCapacity()).assertEqual(128*M);
                let rawdata = [1, 2, 3];
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
4788 4789
                data.writeInt(rawdata.length);
                data.writeRawData(rawdata, rawdata.length);
4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_RAWDATA, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let size = result.reply.readInt();
                    expect(result.reply.readRawData(size) != rawdata).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13600---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13700
         * @tc.name    Test MessageSequence delivery file descriptor object
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13700---------------------------");
            try{
                let testab = new TestProxy(gIRemoteObject).asObject();
                expect(testab != null).assertTrue();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13700---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13800
         * @tc.name    Test that the asObject interface is called by a RemoteObject and returns itself
         * @tc.desc    Function test
         * @tc.level   0
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13800---------------------------");
            try{
                let testRemoteObject = new TestRemoteObject("testObject");
                expect(testRemoteObject.asObject() != null).assertTrue();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13800---------------------------");
        });
    
        /*
         * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_13900
         * @tc.name    MessageSequence sendMessageRequest API test
         * @tc.desc    Function test
         * @tc.level   3
         */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_13900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_13900---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let rawdata = [1, 2, 3];
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.getRawDataCapacity();
4853 4854
                data.writeInt(rawdata.length);
                data.writeRawData(rawdata, rawdata.length);
4855 4856 4857
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_RAWDATA, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
4858 4859
                    expect(result.reply.readInt()).assertEqual(rawdata.length);
                    expect(result.reply.readRawData(rawdata.length) != rawdata).assertTrue();
4860 4861 4862 4863 4864 4865 4866 4867
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_13900---------------------------");
4868
        }); 
4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14000
        * @tc.name    Invoke the writestring interface to write data to the MessageSequence instance. sendMessageRequest asynchronously
        *               verifies the priority processing levels of onRemoteMessageRequest and onRemoteRequest
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = "onRemoteRequest or onRemoteMessageRequest invoking";
                data.writeString(token);
                expect(gIRemoteObject != undefined).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_ONREMOTEMESSAGE_OR_ONREMOTE, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readString()).assertEqual("onRemoteMessageRequest invoking");
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14000---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14100
        * @tc.name    writeRemoteObject is proxy or remote object is invalid Error message verification
        * @tc.desc    Function test
        * @tc.level   0   
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = {};
                data.writeRemoteObject(token);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.PROXY_OR_REMOTE_OBJECT_INVALID_ERROR}`;
                expect(error.code == errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14100---------------------------");
        });         

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14200
        * @tc.name    readParcelable is Call JS callback function failedv Error message verification
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14200", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                let sequenceable = new MySequenceableCode(1, "aaa");
                data.writeParcelable(sequenceable);
                data.setCapacity(0);
                data.setSize(0);
                let ret = new MySequenceable(1, "");
                data.readParcelable(ret);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.CALL_JS_METHOD_ERROR}`;
                expect(error.message != null).assertTrue();
                expect(error.code != errCode).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14200---------------------------");
        });
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14300
        * @tc.name    Call the writeinterfacetoken interface, write the interface descriptor, and read interfacetoken
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14300", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = "hello ruan zong xian";
                data.writeInterfaceToken(token);
                data.setCapacity(0);
                data.setSize(0);
                data.readInterfaceToken();
                data.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.READ_DATA_FROM_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.message != null).assertTrue();
                expect(error.code != errCode).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14300---------------------------");
        });         
    
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14400
        * @tc.name    writeString check param error Error message verification
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14400", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = '';
                for(var i = 0; i < 40*K; i++){
                    token += 'a';
                };
                data.writeString(token);
                data.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`;
                expect(error.code == errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14400---------------------------");
        });
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14500
        * @tc.name    writeInterfaceToken Sequence memory alloc failed Error message verification
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14500", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                data.setSize(0);
                data.setCapacity(0);
                var token = "hello ruan zong xian";
                data.writeInterfaceToken(token);
                data.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`;
                expect(error.code == errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14500---------------------------");
        }); 
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14600
        * @tc.name    writeInterfaceToken Write data to message sequence failed Error message verification
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14600", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                data.setSize(true);
                data.setCapacity(true);
                var token = "hello ruan zong xian";
                data.writeInterfaceToken(token);
                data.reclaim();
            } catch (error) {
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
                expect(error.code != errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14600---------------------------");
        });          
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14700
        * @tc.name    readParcelable Sequence memory alloc failed Error message verification
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14700", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14700---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                let sequenceable = new MySequenceable(1, "aaa");
                data.writeParcelable(sequenceable);
                let ret = new MySequenceable(0, "");
                data.setCapacity(0);
                data.readParcelable(ret);
            } catch (error) {
                let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`;
                expect(error.code == errCode).assertTrue();
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14700---------------------------");
        });       
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageSequence_14800
        * @tc.name    Test messageparcel delivery file descriptor object
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageSequence_14800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageSequence_14800---------------------------");
            let context = FA.getContext();
            await context.getFilesDir()
                .then(async function(path) {
                    expect(path != null).assertTrue();
                    let basePath = path;
                    let filePath = basePath + "/test1.txt";
                    let fd = fileio.openSync(filePath, 0o2| 0o100 | 0o2000, 0o666);
                    expect(fd >= 0).assertTrue();
                    let str = "HELLO RPC";
                    let bytesWr = fileio.writeSync(fd, str);
                    let option = new rpc.MessageOption();
                    let data = rpc.MessageSequence.create();
                    let reply = rpc.MessageSequence.create();
                    data.containFileDescriptors();
                    data.writeInt(bytesWr);
                    data.writeFileDescriptor(fd);
                    data.containFileDescriptors();
                    data.containFileDescriptors();
                    await gIRemoteObject.sendMessageRequest(CODE_FILESDIR, data, reply, option)
                        .then(function(result) {
                            expect(result.errCode).assertEqual(0);
                            let buf = new ArrayBuffer(str.length * 2);
                            let bytesRd = fileio.readSync(fd, buf, {position:0,});
                            expect(bytesRd == (bytesWr + bytesWr)).assertTrue();
                            let fdResult = result.reply.readFileDescriptor();
                            expect(fdResult >= fd).assertTrue();
                            let content = String.fromCharCode.apply(null, new Uint8Array(buf));
                            expect(content).assertEqual(str + str);
                            let dupFd = rpc.MessageSequence.dupFileDescriptor(fd);
                            expect(dupFd >= fd).assertTrue();
                            let buf2 = new ArrayBuffer(str.length * 2);
                            let byteRd2 = fileio.readSync(dupFd, buf2, {position:0,});
                            expect(byteRd2 == (bytesWr + bytesWr)).assertTrue();
                            let content2 = String.fromCharCode.apply(null, new Uint8Array(buf2));
                            expect(content2).assertEqual(str + str);
                            rpc.MessageSequence.closeFileDescriptor(fd);
                            rpc.MessageSequence.closeFileDescriptor(dupFd);
                        })
                    try {
                        console.info("after close fd, write again");
                        fileio.writeSync(fd, str);
                        expect(0).assertEqual(1);
                    } catch(e) {
                        console.error("got exception: " + e);
                    }
                })
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageSequence_14800---------------------------");
        });        
5119

Y
yang-qibo 已提交
5120
        /*
Z
zhangpa2021 已提交
5121
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00100
Z
zhangpa2021 已提交
5122 5123 5124 5125
     * @tc.name    Call the writeinterfacetoken interface, write the interface descriptor, and read interfacetoken
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00100", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00100: create object successfully.");
                var token = "hello ruan zong xian";
                var result = data.writeInterfaceToken(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00100:run writeInterfaceToken result is " + result);
                expect(result).assertTrue();
                var resultToken = data.readInterfaceToken();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00100:run readInterfaceToken result is " + resultToken);
                expect(resultToken).assertEqual(token);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00100:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00100---------------------------");
        });
Y
yang-qibo 已提交
5144

Y
yang-qibo 已提交
5145
        /*
Z
zhangpa2021 已提交
5146
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00200
Y
yang-qibo 已提交
5147 5148
     * @tc.name    Call the writeinterfacetoken interface, write the interface descriptor, and read interfacetoken
     * @tc.desc    Function test
5149
     * @tc.level   3
Y
yang-qibo 已提交
5150
     */
Y
yang-qibo 已提交
5151 5152 5153 5154 5155 5156
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00200", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00200---------------------------");
            try{
                for (let i = 0; i<5; i++){
                    var data = rpc.MessageParcel.create();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00200: create object successfully.");
Y
yang-qibo 已提交
5157

Y
yang-qibo 已提交
5158 5159 5160 5161
                    var token = "hello ruan zong xian";
                    var result = data.writeInterfaceToken(token);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00200:run writeInterfaceToken result is " + result);
                    expect(result).assertTrue();
Y
yang-qibo 已提交
5162

Y
yang-qibo 已提交
5163 5164 5165
                    var resultToken = data.readInterfaceToken();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00200:run readInterfaceToken result is " + resultToken);
                    expect(resultToken).assertEqual(token);
Y
yang-qibo 已提交
5166

Y
yang-qibo 已提交
5167 5168 5169 5170
                    data.reclaim();
                }
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00200:error = " + error);
Y
yang-qibo 已提交
5171
            }
Y
yang-qibo 已提交
5172 5173
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00200---------------------------");
        });
Z
zhangpa2021 已提交
5174

Y
yang-qibo 已提交
5175
        /*
Z
zhangpa2021 已提交
5176
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00300
Z
zhangpa2021 已提交
5177
     * @tc.name    Call the writeinterfacetoken interface to write a non string interface descriptor
Y
yang-qibo 已提交
5178
                   and read interfacetoken
Z
zhangpa2021 已提交
5179
     * @tc.desc    Function test
5180
     * @tc.level   3
Z
zhangpa2021 已提交
5181
     */
Y
yang-qibo 已提交
5182 5183 5184 5185 5186
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00300", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00300: create object successfully.");
Y
yang-qibo 已提交
5187

Y
yang-qibo 已提交
5188 5189 5190 5191 5192 5193 5194
                var token = "";
                for(let i = 0; i < (40*K -1); i++){
                    token += 'a';
                };
                var result = data.writeInterfaceToken(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00300:run writeInterfaceToken is" + result);
                expect(result).assertTrue();
Y
yang-qibo 已提交
5195

Y
yang-qibo 已提交
5196 5197 5198 5199 5200 5201 5202 5203 5204
                var resultToken = data.readInterfaceToken();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00300:run readInterfaceToken is " + resultToken.length);
                expect(resultToken).assertEqual(token);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00300: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00300---------------------------");
        });
Y
yang-qibo 已提交
5205

Y
yang-qibo 已提交
5206
        /*
Z
zhangpa2021 已提交
5207
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00400
Y
yang-qibo 已提交
5208 5209 5210
     * @tc.name    The WriteInterfaceToken interface is called, the exceeding-length interface descriptor is written,
                    and the InterfaceToken is read
     * @tc.desc    Function test
5211
     * @tc.level   3
Y
yang-qibo 已提交
5212
     */
Y
yang-qibo 已提交
5213 5214 5215 5216 5217
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00400", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00400: create object successfully.");
Y
yang-qibo 已提交
5218

Y
yang-qibo 已提交
5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232
                var token = "";
                for(let i = 0; i < 40*K; i++){
                    token += 'a';
                };
                var result = data.writeInterfaceToken(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00400:run writeInterfaceToken is " + result);
                expect(result).assertEqual(false);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00400: error = " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00400---------------------------");
        });
Z
zhangpa2021 已提交
5233

Y
yang-qibo 已提交
5234
        /*
Z
zhangpa2021 已提交
5235
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00500
Y
yang-qibo 已提交
5236 5237 5238
     * @tc.name    Call the writeinterfacetoken interface to write a non string interface descriptor
                   and read interfacetoken
     * @tc.desc    Function test
5239
     * @tc.level   3
Y
yang-qibo 已提交
5240
     */
Y
yang-qibo 已提交
5241 5242 5243 5244 5245
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00500", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00500: create object successfully.");
Z
zhangpa2021 已提交
5246

Y
yang-qibo 已提交
5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257
                var token = 123;
                var result = data.writeInterfaceToken(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00500:run writeInterfaceToken is " + result);
                expect(result).assertEqual(false);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00500: error = " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00500---------------------------");
        });
Z
zhangpa2021 已提交
5258

Y
yang-qibo 已提交
5259
        /*
Z
zhangpa2021 已提交
5260
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00600
Z
zhangpa2021 已提交
5261 5262
     * @tc.name    The data size of the messageparcel obtained by calling the getSize interface
     * @tc.desc    Function test
5263
     * @tc.level   3
Z
zhangpa2021 已提交
5264
     */
Y
yang-qibo 已提交
5265 5266 5267 5268 5269
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00600", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00600: create object successfully.");
Z
zhangpa2021 已提交
5270

Y
yang-qibo 已提交
5271 5272 5273
                var size = data.getSize();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00600:run getSize is " + size);
                expect(size).assertEqual(0);
Z
zhangpa2021 已提交
5274

Y
yang-qibo 已提交
5275 5276 5277 5278
                var addData = 1;
                var result = data.writeInt(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00600:run writeInt is " + result);
                expect(result).assertTrue();
Z
zhangpa2021 已提交
5279

Y
yang-qibo 已提交
5280 5281 5282
                size = data.getSize();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00600:run getSize is " + size);
                expect(size).assertEqual(4);
Z
zhangpa2021 已提交
5283

Y
yang-qibo 已提交
5284 5285 5286 5287 5288 5289
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00600: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00600---------------------------");
        });
Z
zhangpa2021 已提交
5290

Y
yang-qibo 已提交
5291
        /*
Z
zhangpa2021 已提交
5292
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00700
Z
zhangpa2021 已提交
5293 5294
     * @tc.name    The capacity of the messageparcel obtained by calling the getcapacity interface
     * @tc.desc    Function test
5295
     * @tc.level   3
Z
zhangpa2021 已提交
5296
     */
Y
yang-qibo 已提交
5297 5298 5299 5300 5301
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00700", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00700: create object successfully.");
Z
zhangpa2021 已提交
5302

Y
yang-qibo 已提交
5303 5304 5305
                var size = data.getCapacity();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00700:run getCapacity is " + size);
                expect(size).assertEqual(0);
Z
zhangpa2021 已提交
5306

Y
yang-qibo 已提交
5307 5308 5309 5310
                var addData = 1;
                var result = data.writeInt(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00700:run writeInt is " + result);
                expect(result).assertTrue();
Z
zhangpa2021 已提交
5311

Y
yang-qibo 已提交
5312 5313 5314
                size = data.getCapacity();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00700:run getCapacity is " + size);
                expect(size).assertEqual(64);
Z
zhangpa2021 已提交
5315

Y
yang-qibo 已提交
5316 5317 5318 5319 5320 5321
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00700: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00700---------------------------");
        });
Z
zhangpa2021 已提交
5322

Y
yang-qibo 已提交
5323
        /*
Z
zhangpa2021 已提交
5324
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00800
Z
zhangpa2021 已提交
5325 5326
     * @tc.name    Call the SetSize interface to set the data size of messageparcel
     * @tc.desc    Function test
5327
     * @tc.level   3
Z
zhangpa2021 已提交
5328
     */
Y
yang-qibo 已提交
5329 5330 5331 5332 5333
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00800", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00800: create object successfully.");
Z
zhangpa2021 已提交
5334

Y
yang-qibo 已提交
5335 5336 5337 5338
                var addData = 1;
                var result = data.writeInt(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00800:run writeInt is " + result);
                expect(result).assertTrue();
Z
zhangpa2021 已提交
5339

Y
yang-qibo 已提交
5340 5341 5342 5343
                var size = 6;
                var setResult = data.setSize(size);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00800:run setSize " + setResult);
                expect(setResult).assertTrue();
Z
zhangpa2021 已提交
5344

Y
yang-qibo 已提交
5345 5346 5347 5348 5349 5350
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00800: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00800---------------------------");
        });
Y
yang-qibo 已提交
5351

Y
yang-qibo 已提交
5352
        /*
Z
zhangpa2021 已提交
5353
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_00900
Y
yang-qibo 已提交
5354 5355
     * @tc.name    Call the SetSize interface to set the data size of messageparcel
     * @tc.desc    Function test
5356
     * @tc.level   3
Y
yang-qibo 已提交
5357
     */
Y
yang-qibo 已提交
5358 5359 5360 5361 5362
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_00900", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_00900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00900: create object successfully.");
Y
yang-qibo 已提交
5363

Y
yang-qibo 已提交
5364 5365 5366 5367
                var addData = 1;
                var result = data.writeInt(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00900:run writeInt is " + result);
                expect(result).assertTrue();
Y
yang-qibo 已提交
5368

Y
yang-qibo 已提交
5369 5370 5371 5372
                var size = 4*G;
                var setResult = data.setSize(size);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00900:run setSize " + setResult);
                expect(setResult).assertTrue();
Y
yang-qibo 已提交
5373

Y
yang-qibo 已提交
5374 5375 5376 5377 5378 5379
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_00900: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_00900---------------------------");
        });
Y
yang-qibo 已提交
5380

Y
yang-qibo 已提交
5381
        /*
Z
zhangpa2021 已提交
5382
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01000
Y
yang-qibo 已提交
5383 5384
     * @tc.name    Call the SetSize interface to set the data size of messageparcel
     * @tc.desc    Function test
5385
     * @tc.level   3
Y
yang-qibo 已提交
5386
     */
Y
yang-qibo 已提交
5387 5388 5389 5390 5391
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01000", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01000: create object successfully.");
Y
yang-qibo 已提交
5392

Y
yang-qibo 已提交
5393 5394 5395 5396
                var addData = 1;
                var result = data.writeInt(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01000:run writeInt is " + result);
                expect(result).assertTrue();
Y
yang-qibo 已提交
5397

Y
yang-qibo 已提交
5398 5399 5400 5401 5402 5403 5404 5405 5406 5407
                var size = 4*G - 4;
                var setResult = data.setSize(size);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01000:run setSize " + setResult);
                expect(setResult).assertEqual(false);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01000: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01000---------------------------");
        });
Z
zhangpa2021 已提交
5408

Y
yang-qibo 已提交
5409
        /*
Z
zhangpa2021 已提交
5410
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01100
Z
zhangpa2021 已提交
5411
     * @tc.name    Call the SetSize interface to set the data size of messageparcel. The write data size
Y
yang-qibo 已提交
5412
                   does not match the set value
Z
zhangpa2021 已提交
5413
     * @tc.desc    Function test
5414
     * @tc.level   3
Z
zhangpa2021 已提交
5415
     */
Y
yang-qibo 已提交
5416 5417 5418 5419 5420
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01100", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01100: create object successfully.");
Z
zhangpa2021 已提交
5421

Y
yang-qibo 已提交
5422 5423 5424 5425
                var capacity = 64;
                var setResult = data.setCapacity(capacity);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01100:run setCapacity " + setResult);
                expect(setResult).assertTrue();
Z
zhangpa2021 已提交
5426

Y
yang-qibo 已提交
5427 5428 5429 5430
                var size = 4;
                setResult = data.setSize(size);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01100:run setSize " + setResult);
                expect(setResult).assertTrue();
Z
zhangpa2021 已提交
5431

Y
yang-qibo 已提交
5432 5433 5434 5435
                var addData = 2;
                var result = data.writeLong(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01100:run writeInt is " + result);
                expect(result).assertTrue();
Z
zhangpa2021 已提交
5436

Y
yang-qibo 已提交
5437 5438 5439 5440 5441 5442
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01100: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01100---------------------------");
        });
Z
zhangpa2021 已提交
5443

Y
yang-qibo 已提交
5444
        /*
Z
zhangpa2021 已提交
5445
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01200
Z
zhangpa2021 已提交
5446 5447
     * @tc.name    Call the setcapacity interface to set the capacity of messageparcel
     * @tc.desc    Function test
5448
     * @tc.level   3
Z
zhangpa2021 已提交
5449
     */
Y
yang-qibo 已提交
5450 5451 5452 5453 5454
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01200", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01200: create object successfully.");
Z
zhangpa2021 已提交
5455

Y
yang-qibo 已提交
5456 5457 5458 5459
                var size = 64;
                var setResult = data.setCapacity(size);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01200:run setSize " + setResult);
                expect(setResult).assertTrue();
Z
zhangpa2021 已提交
5460

Y
yang-qibo 已提交
5461 5462 5463 5464
                var addData = 1;
                var result = data.writeInt(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01200:run writeInt is " + result);
                expect(result).assertTrue();
Z
zhangpa2021 已提交
5465

Y
yang-qibo 已提交
5466 5467 5468 5469 5470 5471
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01200: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01200---------------------------");
        });
Y
yang-qibo 已提交
5472

Y
yang-qibo 已提交
5473
        /*
Z
zhangpa2021 已提交
5474
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01300
Y
yang-qibo 已提交
5475 5476
     * @tc.name    Call the setcapacity interface to set the capacity of messageparcel
     * @tc.desc    Function test
5477
     * @tc.level   3
Y
yang-qibo 已提交
5478
     */
Y
yang-qibo 已提交
5479 5480 5481 5482 5483
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01300", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01300: create object successfully.");
Y
yang-qibo 已提交
5484

Y
yang-qibo 已提交
5485 5486 5487 5488
                var size = M;
                var setResult = data.setCapacity(size);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01300:run setSize " + setResult);
                expect(setResult).assertTrue();
Y
yang-qibo 已提交
5489

Y
yang-qibo 已提交
5490 5491 5492 5493
                var addData = 1;
                var result = data.writeInt(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01300:run writeInt is " + result);
                expect(result).assertTrue();
Y
yang-qibo 已提交
5494

Y
yang-qibo 已提交
5495 5496 5497 5498 5499 5500
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01300: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01300---------------------------");
        });
Y
yang-qibo 已提交
5501

Y
yang-qibo 已提交
5502
        /*
Z
zhangpa2021 已提交
5503
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01400
Y
yang-qibo 已提交
5504 5505
     * @tc.name    Call the setcapacity interface to set the capacity of messageparcel
     * @tc.desc    Function test
5506
     * @tc.level   3
Y
yang-qibo 已提交
5507
     */
Y
yang-qibo 已提交
5508 5509 5510 5511 5512
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01400", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01400: create object successfully.");
Y
yang-qibo 已提交
5513

Y
yang-qibo 已提交
5514 5515 5516 5517
                var size = 4*G;
                var setResult = data.setCapacity(size);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01400:run setSize " + setResult);
                expect(setResult).assertEqual(false);
Y
yang-qibo 已提交
5518

Y
yang-qibo 已提交
5519 5520 5521 5522 5523 5524
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01400: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01400---------------------------");
        });
Z
zhangpa2021 已提交
5525

Y
yang-qibo 已提交
5526
        /*
Z
zhangpa2021 已提交
5527
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01500
Y
yang-qibo 已提交
5528
     * @tc.name    Call the setcapacity interface to set the capacity of messageparcel.
Z
zhangpa2021 已提交
5529 5530
     *             The write data capacity is inconsistent with the set value
     * @tc.desc    Function test
5531
     * @tc.level   3
Z
zhangpa2021 已提交
5532
     */
Y
yang-qibo 已提交
5533 5534 5535 5536 5537
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01500", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01500: create object successfully.");
Z
zhangpa2021 已提交
5538

Y
yang-qibo 已提交
5539 5540 5541 5542
                var size = 4;
                var setResult = data.setCapacity(size);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01500:run setSize " + setResult);
                expect(setResult).assertTrue();
Z
zhangpa2021 已提交
5543

Y
yang-qibo 已提交
5544 5545 5546 5547
                var addData = [1, 2, 3, 4, 5, 6, 7, 8];
                var result = data.writeIntArray(addData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01500:run writeInt is " + result);
                expect(result).assertEqual(false);
Z
zhangpa2021 已提交
5548

Y
yang-qibo 已提交
5549 5550 5551 5552 5553 5554 5555
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01500: error = " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01500---------------------------");
        });
Z
zhangpa2021 已提交
5556

Y
yang-qibo 已提交
5557
        /*
Z
zhangpa2021 已提交
5558
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01600
Y
yang-qibo 已提交
5559
     * @tc.name    Empty object to obtain the readable byte space, read location,
Z
zhangpa2021 已提交
5560 5561
     *             writable byte space and write location information of messageparcel
     * @tc.desc    Function test
5562
     * @tc.level   3
Z
zhangpa2021 已提交
5563
     */
Y
yang-qibo 已提交
5564 5565 5566 5567 5568
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01600", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01600: create object successfully.");
Z
zhangpa2021 已提交
5569

Y
yang-qibo 已提交
5570 5571 5572 5573 5574 5575
                var result1 = data.getWritableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01600: run getWritableBytes is " + result1);
                expect(result1).assertEqual(0);
                var result2 = data.getReadableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01600: run getReadableBytes is " + result2);
                expect(result2).assertEqual(0);
Z
zhangpa2021 已提交
5576

Y
yang-qibo 已提交
5577 5578 5579
                var result3 = data.getReadPosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01600: run getReadPosition is " + result2);
                expect(result3).assertEqual(0);
Z
zhangpa2021 已提交
5580

Y
yang-qibo 已提交
5581 5582 5583
                var result4 = data.getWritePosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01600: run getWritePosition is " + result2);
                expect(result4).assertEqual(0);
Z
zhangpa2021 已提交
5584

Y
yang-qibo 已提交
5585 5586 5587 5588 5589 5590
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01600: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01600---------------------------");
        });
Z
zhangpa2021 已提交
5591

Y
yang-qibo 已提交
5592
        /*
Z
zhangpa2021 已提交
5593
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01700
Y
yang-qibo 已提交
5594
     * @tc.name    Create an object and write data to obtain the readable byte space, read location,
Z
zhangpa2021 已提交
5595 5596
     *             writable byte space and write location information of messageparcel
     * @tc.desc    Function test
5597
     * @tc.level   3
Z
zhangpa2021 已提交
5598
     */
Y
yang-qibo 已提交
5599 5600 5601 5602 5603
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01700", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01700: create object successfully.");
Z
zhangpa2021 已提交
5604

Y
yang-qibo 已提交
5605 5606 5607
                var dataInt = 1;
                var resultInt = data.writeInt(dataInt);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01700: run writeInt is " + resultInt);
Z
zhangpa2021 已提交
5608

Y
yang-qibo 已提交
5609 5610 5611
                var dataLong = 2;
                var resultLong = data.writeLong(dataLong);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01700: run writeLong is " + resultLong);
Z
zhangpa2021 已提交
5612

Y
yang-qibo 已提交
5613 5614 5615
                var result1 = data.getWritableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01700: run getWritableBytes is " + result1);
                expect(result1).assertEqual(52);
Z
zhangpa2021 已提交
5616

Y
yang-qibo 已提交
5617 5618 5619
                var result2 = data.getReadableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01700: run getReadableBytes is " + result2);
                expect(result2).assertEqual(12);
Z
zhangpa2021 已提交
5620

Y
yang-qibo 已提交
5621 5622 5623
                var result3 = data.getReadPosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01700: run getReadPosition is " + result3);
                expect(result3).assertEqual(0);
Z
zhangpa2021 已提交
5624

Y
yang-qibo 已提交
5625 5626 5627
                var result4 = data.getWritePosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01700: run getWritePosition is " + result4);
                expect(result4).assertEqual(12);
Z
zhangpa2021 已提交
5628

Y
yang-qibo 已提交
5629 5630 5631 5632 5633 5634
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01700: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01700---------------------------");
        });
Z
zhangpa2021 已提交
5635

Y
yang-qibo 已提交
5636
        /*
Z
zhangpa2021 已提交
5637
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01800
Z
zhangpa2021 已提交
5638 5639 5640 5641
     * @tc.name    Call rewindread interface to offset the read position to the specified position
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01800", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                expect(data.getWritableBytes()).assertEqual(0);
                expect(data.getReadableBytes()).assertEqual(0);
                expect(data.getReadPosition()).assertEqual(0);
                expect(data.getWritePosition()).assertEqual(0);

                var dataInt = 1;
                var resultInt = data.writeInt(dataInt);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01800: run writeInt is " + resultInt);
                var dataLong = 2;
                var resultLong = data.writeLong(dataLong);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01800: run writeLong is " + resultLong);

                expect(data.getWritableBytes()).assertEqual(52);
                expect(data.getReadableBytes()).assertEqual(12);
                expect(data.getReadPosition()).assertEqual(0);
                expect(data.getWritePosition()).assertEqual(12);

                var readIntData = data.readInt();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01800: run readInt is " + readIntData);
                expect(readIntData).assertEqual(dataInt);

                var writePosition = 0;
                var writeResult = data.rewindWrite(writePosition);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01800: run rewindWrite is " + writeResult);
                expect(writeResult).assertTrue();

                expect(data.getWritePosition()).assertEqual(0);
                dataInt = 3;
                resultInt = data.writeInt(dataInt);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01800: run writeInt is " + resultInt);

                var readPosition = 0;
                var readResult = data.rewindRead(readPosition);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01800: run rewindWrite is " + readResult);
                expect(readResult).assertTrue();

                readIntData = data.readInt();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01800: run readInt is " + readIntData);
                expect(readIntData).assertEqual(dataInt);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01800: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01800---------------------------");
        });
Z
zhangpa2021 已提交
5691

Y
yang-qibo 已提交
5692
        /*
Z
zhangpa2021 已提交
5693
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_01900
Z
zhangpa2021 已提交
5694
     * @tc.name    The rewindread interface is called to re offset the read position to the specified position.
Y
yang-qibo 已提交
5695
                   The specified position is out of range
Z
zhangpa2021 已提交
5696
     * @tc.desc    Function test
5697
     * @tc.level   3
Z
zhangpa2021 已提交
5698
     */
Y
yang-qibo 已提交
5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_01900", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_01900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: create object successfully.");

                var result1 = data.getWritableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run getWritableBytes is " + result1);
                expect(result1 == 0).assertTrue();
                var result2 = data.getReadableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run getReadableBytes is " + result2);
                expect(result2 == 0).assertTrue();
                var result3 = data.getReadPosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run getReadPosition is " + result3);
                expect(result3 == 0).assertTrue();
                var result4 = data.getWritePosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run getWritePosition is " + result4);
                expect(result4 == 0).assertTrue();

                var dataInt = 1;
                var resultInt = data.writeInt(dataInt);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run writeInt is " + resultInt);
                expect(resultInt).assertTrue();
                var dataLong = 2;
                var resultLong = data.writeLong(dataLong);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run writeLong is " + resultLong);
                expect(resultLong).assertTrue();

                result1 = data.getWritableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run getWritableBytes is " + result1);
                expect(result1 == 52).assertTrue();
                result2 = data.getReadableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run getReadableBytes is " + result2);
                expect(result2 == 12).assertTrue();
                result3 = data.getReadPosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run getReadPosition is " + result3);
                expect(result3 == 0).assertTrue();
                result4 = data.getWritePosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run getWritePosition is " + result4);
                expect(result4 == 12).assertTrue();

                var readPosition = 100;
                var readResult = data.rewindRead(readPosition);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: run rewindRead is " + readResult);
                expect(readResult == false).assertTrue();
Z
zhangpa2021 已提交
5744

Y
yang-qibo 已提交
5745 5746 5747 5748 5749 5750
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_01900: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_01900---------------------------");
        });
Z
zhangpa2021 已提交
5751

Y
yang-qibo 已提交
5752
        /*
Z
zhangpa2021 已提交
5753
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02000
Z
zhangpa2021 已提交
5754 5755
     * @tc.name    Call rewindwrite and the interface offsets the write position to the specified position
     * @tc.desc    Function test
5756
     * @tc.level   3
Z
zhangpa2021 已提交
5757
     */
Y
yang-qibo 已提交
5758 5759 5760 5761 5762
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02000", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02000: create object successfully.");
Z
zhangpa2021 已提交
5763

Y
yang-qibo 已提交
5764 5765 5766 5767
                var dataInt = 1;
                var resultInt = data.writeInt(dataInt);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02000: run writeInt is " + resultInt);
                expect(resultInt).assertTrue();
Z
zhangpa2021 已提交
5768

Y
yang-qibo 已提交
5769 5770 5771
                var readIntData = data.readInt();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02000: run readInt is " + readIntData);
                expect(readIntData).assertEqual(dataInt);
Z
zhangpa2021 已提交
5772

Y
yang-qibo 已提交
5773 5774 5775 5776
                var writePosition = 0;
                var rewindWriteResult = data.rewindWrite(writePosition);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02000: run rewindWrite is" + rewindWriteResult);
                expect(rewindWriteResult).assertTrue();
Z
zhangpa2021 已提交
5777

Y
yang-qibo 已提交
5778 5779 5780 5781
                dataInt = 3;
                resultInt = data.writeInt(dataInt);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02000: run writeInt is " + resultInt);
                expect(resultInt).assertTrue();
Z
zhangpa2021 已提交
5782

Y
yang-qibo 已提交
5783 5784 5785 5786
                var readPosition = 0;
                var rewindReadResult = data.rewindRead(readPosition);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02000: run rewindRead is " + rewindReadResult);
                expect(rewindReadResult);
Z
zhangpa2021 已提交
5787

Y
yang-qibo 已提交
5788 5789 5790
                readIntData = data.readInt();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02000: run readInt is " + readIntData);
                expect(readIntData).assertEqual(dataInt);
Z
zhangpa2021 已提交
5791

Y
yang-qibo 已提交
5792 5793 5794 5795 5796 5797
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02000: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02000---------------------------");
        });
Z
zhangpa2021 已提交
5798

Y
yang-qibo 已提交
5799
        /*
Z
zhangpa2021 已提交
5800
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02100
Z
zhangpa2021 已提交
5801
     * @tc.name    Call rewindwrite and the interface offsets the write position to the specified position.
Y
yang-qibo 已提交
5802
                   The specified position is out of range
Z
zhangpa2021 已提交
5803
     * @tc.desc    Function test
5804
     * @tc.level   3
Z
zhangpa2021 已提交
5805
     */
Y
yang-qibo 已提交
5806 5807 5808 5809 5810
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02100", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02100: create object successfully.");
Z
zhangpa2021 已提交
5811

Y
yang-qibo 已提交
5812 5813 5814 5815
                var dataInt = 1;
                var resultInt = data.writeInt(dataInt);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02100: run writeInt result is " + resultInt);
                expect(resultInt).assertTrue();
Z
zhangpa2021 已提交
5816

Y
yang-qibo 已提交
5817 5818 5819
                var readIntData = data.readInt();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02100: run readInt is" + readIntData);
                expect(readIntData == dataInt).assertTrue();
Z
zhangpa2021 已提交
5820

Y
yang-qibo 已提交
5821 5822 5823 5824
                var writePosition = 99;
                var rewindWriteResult = data.rewindWrite(writePosition);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02100: run rewindWrite is " + rewindWriteResult);
                expect(rewindWriteResult).assertEqual(false);
Z
zhangpa2021 已提交
5825

Y
yang-qibo 已提交
5826 5827 5828 5829 5830 5831
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02100: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02100---------------------------");
        });
Z
zhangpa2021 已提交
5832

Y
yang-qibo 已提交
5833
        /*
Z
zhangpa2021 已提交
5834
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02200
Y
yang-qibo 已提交
5835
     * @tc.name    Call the writeshortarray interface, write the array to the messageparcel instance,
Z
zhangpa2021 已提交
5836 5837 5838 5839
     *             and call readshortarray to read the data
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
5840 5841 5842 5843 5844
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02200", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02200: create object successfully.");
Z
zhangpa2021 已提交
5845

Y
yang-qibo 已提交
5846 5847 5848 5849 5850
                var wShortArryData = [3, 5, 9];
                var writeShortArrayResult = data.writeShortArray(wShortArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02200: run writeShortArray "
                    + writeShortArrayResult);
                expect(writeShortArrayResult).assertTrue();
Y
yang-qibo 已提交
5851

Y
yang-qibo 已提交
5852 5853 5854
                var rShortArryData = data.readShortArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02200: run readShortArray is " + rShortArryData);
                assertArrayElementEqual(rShortArryData,wShortArryData);
Y
yang-qibo 已提交
5855

Y
yang-qibo 已提交
5856 5857 5858 5859 5860 5861
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02200: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02200---------------------------");
        });
Z
zhangpa2021 已提交
5862

Y
yang-qibo 已提交
5863
        /*
Z
zhangpa2021 已提交
5864
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02300
Y
yang-qibo 已提交
5865
     * @tc.name    Call the writeshortarray interface, write the short integer array to the messageparcel instance,
Z
zhangpa2021 已提交
5866 5867
     *             and call readshortarray (datain: number []) to read the data
     * @tc.desc    Function test
5868
     * @tc.level   3
Z
zhangpa2021 已提交
5869
     */
Y
yang-qibo 已提交
5870 5871 5872 5873 5874
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02300", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02300: create object successfully.");
Z
zhangpa2021 已提交
5875

Y
yang-qibo 已提交
5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891
                var wShortArryData = [];
                for(let i=0;i<(50*K - 1);i++){
                    wShortArryData[i] = 1;
                }
                var writeShortArrayResult = data.writeShortArray(wShortArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02300: run writeShortArray "
                    + writeShortArrayResult);
                expect(writeShortArrayResult).assertTrue();

                var rShortArryData = [];
                data.readShortArray(rShortArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02300: run readShortArray is " + rShortArryData.length);
                assertArrayElementEqual(rShortArryData,wShortArryData);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02300: error " + error);
Y
yang-qibo 已提交
5892
            }
Y
yang-qibo 已提交
5893 5894
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02300---------------------------");
        });
Z
zhangpa2021 已提交
5895

Y
yang-qibo 已提交
5896
        /*
Z
zhangpa2021 已提交
5897
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02400
Z
zhangpa2021 已提交
5898 5899
     * @tc.name    Writeshortarray interface, boundary value verification
     * @tc.desc    Function test
5900
     * @tc.level   3
Z
zhangpa2021 已提交
5901
     */
Y
yang-qibo 已提交
5902 5903 5904 5905 5906
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02400", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02400: create object successfully.");
Z
zhangpa2021 已提交
5907

Y
yang-qibo 已提交
5908 5909 5910 5911
                var wShortArryData = [-32768, 0, 1, 2, 32767];
                var writeShortArrayResult = data.writeShortArray(wShortArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02400: run writeShortArray is " + writeShortArrayResult);
                expect(writeShortArrayResult).assertTrue();
Y
yang-qibo 已提交
5912

Y
yang-qibo 已提交
5913 5914 5915 5916
                var rShortArryData = [];
                data.readShortArray(rShortArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02400: run readShortArray is " + rShortArryData);
                assertArrayElementEqual(rShortArryData,wShortArryData);
Y
yang-qibo 已提交
5917

Y
yang-qibo 已提交
5918 5919 5920 5921 5922 5923
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02400: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02400---------------------------");
        });
Z
zhangpa2021 已提交
5924

Y
yang-qibo 已提交
5925
        /*
Z
zhangpa2021 已提交
5926
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02500
Z
zhangpa2021 已提交
5927 5928
     * @tc.name    Writeshortarray interface, illegal value validation
     * @tc.desc    Function test
5929
     * @tc.level   3
Z
zhangpa2021 已提交
5930
     */
Y
yang-qibo 已提交
5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02500", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02500: create object successfully.");

                var wShortArryData = [-32769, 0, 1, 2];
                var writeShortArrayResult = data.writeShortArray(wShortArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02500: run writeShortArray is " + writeShortArrayResult);
                expect(writeShortArrayResult).assertTrue();
                var rShotrArrayData = data.readShortArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02500: run readShortArray is " + rShotrArrayData);
                expect(32767).assertEqual(rShotrArrayData[0]);
                expect(wShortArryData[1]).assertEqual(rShotrArrayData[1]);
                expect(wShortArryData[2]).assertEqual(rShotrArrayData[2]);
                expect(wShortArryData[3]).assertEqual(rShotrArrayData[3]);
5947

Y
yang-qibo 已提交
5948 5949 5950 5951
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02500: error = " + error);
            }
Z
zhangpa2021 已提交
5952

Y
yang-qibo 已提交
5953 5954
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02500---------------------------");
        });
Z
zhangpa2021 已提交
5955

Y
yang-qibo 已提交
5956
        /*
Z
zhangpa2021 已提交
5957
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02600
Y
yang-qibo 已提交
5958
     * @tc.name    Writeshortarray interface, illegal value validation
Z
zhangpa2021 已提交
5959
     * @tc.desc    Function test
5960
     * @tc.level   3
Z
zhangpa2021 已提交
5961
     */
Y
yang-qibo 已提交
5962 5963 5964 5965 5966
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02600", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02600: create object successfully.");
Z
zhangpa2021 已提交
5967

Y
yang-qibo 已提交
5968 5969 5970 5971
                var wShortArryData = [0, 1, 2, 32768];
                var writeShortArrayResult = data.writeShortArray(wShortArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02600: run writeShortArray is " + writeShortArrayResult);
                expect(writeShortArrayResult).assertTrue();
Z
zhangpa2021 已提交
5972

Y
yang-qibo 已提交
5973 5974 5975 5976 5977 5978
                var rShotrArrayData = data.readShortArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02600: run readShortArray " + rShotrArrayData);
                expect(wShortArryData[0]).assertEqual(rShotrArrayData[0]);
                expect(wShortArryData[1]).assertEqual(rShotrArrayData[1]);
                expect(wShortArryData[2]).assertEqual(rShotrArrayData[2]);
                expect(-32768).assertEqual(rShotrArrayData[3]);
Z
zhangpa2021 已提交
5979

Y
yang-qibo 已提交
5980 5981 5982 5983 5984 5985
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02600: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02600---------------------------");
        });
Z
zhangpa2021 已提交
5986

Y
yang-qibo 已提交
5987
        /*
Z
zhangpa2021 已提交
5988
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02700
Y
yang-qibo 已提交
5989
     * @tc.name    Writeshortarray interface, illegal value validation
Z
zhangpa2021 已提交
5990
     * @tc.desc    Function test
5991
     * @tc.level   3
Z
zhangpa2021 已提交
5992
     */
Y
yang-qibo 已提交
5993 5994 5995 5996 5997
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02700", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02700: create object successfully.");
Z
zhangpa2021 已提交
5998

Y
yang-qibo 已提交
5999 6000 6001 6002 6003 6004 6005
                var wShortArryData = [];
                for (let i = 0; i < 50*K; i++){
                    wShortArryData[i] = 11111;
                }
                var writeShortArrayResult = data.writeShortArray(wShortArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02700: run writeShortArray " + writeShortArrayResult);
                expect(writeShortArrayResult).assertEqual(false);
6006

Y
yang-qibo 已提交
6007 6008 6009 6010 6011 6012 6013
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02700: error = " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02700---------------------------");
        });
Z
zhangpa2021 已提交
6014

Y
yang-qibo 已提交
6015
        /*
Z
zhangpa2021 已提交
6016
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02800
Y
yang-qibo 已提交
6017 6018
     * @tc.name    Call the writelongarray interface, write the long integer array to the messageparcel instance,
     *             and call readlongarray to read the data
Z
zhangpa2021 已提交
6019 6020 6021
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
6022 6023 6024 6025 6026
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02800", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02800: create object successfully.");
Y
yang-qibo 已提交
6027

Y
yang-qibo 已提交
6028 6029 6030 6031 6032 6033 6034
                var LongArryData = [];
                for (let i = 0;i<(25*K - 1);i++){
                    LongArryData[i] = 11;
                }
                var WriteLongArray = data.writeLongArray(LongArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03200: run writeShortArray  is " + WriteLongArray);
                expect(WriteLongArray).assertTrue();
Z
zhangpa2021 已提交
6035

Y
yang-qibo 已提交
6036 6037 6038
                var rLongArryData = data.readLongArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03200: run readShortArray is " + rLongArryData.length);
                assertArrayElementEqual(LongArryData,rLongArryData);
Z
zhangpa2021 已提交
6039

Y
yang-qibo 已提交
6040 6041 6042 6043 6044 6045
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02800: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02800---------------------------");
        });
Z
zhangpa2021 已提交
6046

Y
yang-qibo 已提交
6047
        /*
Z
zhangpa2021 已提交
6048
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_02900
Y
yang-qibo 已提交
6049
     * @tc.name    Writelongarray interface, boundary value verification
Z
zhangpa2021 已提交
6050
     * @tc.desc    Function test
6051
     * @tc.level   3
Z
zhangpa2021 已提交
6052
     */
Y
yang-qibo 已提交
6053 6054 6055 6056 6057
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_02900", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_02900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02900: create object successfully.");
Z
zhangpa2021 已提交
6058

Y
yang-qibo 已提交
6059 6060 6061 6062
                var wLongArryData = [-2147483648, 0, 1, 2, 2147483647];
                var writeLongArrayResult = data.writeLongArray(wLongArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02900: run writeShortArrayis is " + writeLongArrayResult);
                expect(writeLongArrayResult).assertTrue();
Y
yang-qibo 已提交
6063

Y
yang-qibo 已提交
6064 6065 6066
                var rLongArryData = data.readLongArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02900: run readShortArray is " + rLongArryData);
                assertArrayElementEqual(wLongArryData,rLongArryData);
Y
yang-qibo 已提交
6067

Y
yang-qibo 已提交
6068 6069 6070 6071 6072 6073
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_02900: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_02900---------------------------");
        });
Z
zhangpa2021 已提交
6074

Y
yang-qibo 已提交
6075
        /*
Z
zhangpa2021 已提交
6076
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03000
Y
yang-qibo 已提交
6077
     * @tc.name    Writelongarray interface, illegal value validation
Z
zhangpa2021 已提交
6078
     * @tc.desc    Function test
6079
     * @tc.level   3
Z
zhangpa2021 已提交
6080
     */
Y
yang-qibo 已提交
6081 6082 6083 6084 6085
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03000", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03000: create object successfully.");
Z
zhangpa2021 已提交
6086

Y
yang-qibo 已提交
6087 6088 6089 6090
                var errorLongArryData = [-2147483649, 0, 1, 2, 3];
                var erWriteLongArray = data.writeLongArray(errorLongArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03000: run writeShortArrayis is " + erWriteLongArray);
                expect(erWriteLongArray).assertTrue();
Y
yang-qibo 已提交
6091

Y
yang-qibo 已提交
6092 6093 6094
                var erLongArryData = data.readLongArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03000: run readShortArray is " + erLongArryData);
                assertArrayElementEqual(errorLongArryData,erLongArryData);
Y
yang-qibo 已提交
6095

Y
yang-qibo 已提交
6096 6097 6098 6099 6100 6101
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03000: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03000---------------------------");
        });
Z
zhangpa2021 已提交
6102

Y
yang-qibo 已提交
6103
        /*
Z
zhangpa2021 已提交
6104
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03100
Y
yang-qibo 已提交
6105
     * @tc.name    Writelongarray interface, illegal value validation
Z
zhangpa2021 已提交
6106
     * @tc.desc    Function test
6107
     * @tc.level   3
Z
zhangpa2021 已提交
6108
     */
Y
yang-qibo 已提交
6109 6110 6111 6112 6113
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03100", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03100: create object successfully.");
Z
zhangpa2021 已提交
6114

Y
yang-qibo 已提交
6115 6116 6117 6118
                var errorLongArryData = [0, 1, 2, 3, 2147483648];
                var erWriteLongArray = data.writeLongArray(errorLongArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03100: run writeShortArrayis is " + erWriteLongArray);
                expect(erWriteLongArray).assertTrue();
Y
yang-qibo 已提交
6119

Y
yang-qibo 已提交
6120 6121 6122
                var erLongArryData = data.readLongArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03100: run readShortArray is " + erLongArryData);
                assertArrayElementEqual(errorLongArryData,erLongArryData);
Y
yang-qibo 已提交
6123

Y
yang-qibo 已提交
6124 6125 6126 6127 6128 6129
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03100: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03100---------------------------");
        });
Z
zhangpa2021 已提交
6130

Y
yang-qibo 已提交
6131
        /*
Z
zhangpa2021 已提交
6132
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03200
Y
yang-qibo 已提交
6133
     * @tc.name    Writelongarray interface, illegal value validation
Z
zhangpa2021 已提交
6134
     * @tc.desc    Function test
6135
     * @tc.level   3
Z
zhangpa2021 已提交
6136
     */
Y
yang-qibo 已提交
6137 6138 6139 6140 6141
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03200", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03200: create object successfully.");
Z
zhangpa2021 已提交
6142

Y
yang-qibo 已提交
6143 6144 6145 6146 6147 6148 6149
                var errorLongArryData = [];
                for (let i = 0;i<25*K;i++){
                    errorLongArryData[i] = 11;
                }
                var erWriteLongArray = data.writeLongArray(errorLongArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03200: run writeShortArrayis is " + erWriteLongArray);
                expect(erWriteLongArray).assertEqual(false);
6150

Y
yang-qibo 已提交
6151 6152 6153 6154 6155 6156 6157
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03200: error " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03200---------------------------");
        });
Z
zhangpa2021 已提交
6158

Y
yang-qibo 已提交
6159
        /*
Z
zhangpa2021 已提交
6160
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03300
Y
yang-qibo 已提交
6161 6162
     * @tc.name    Call the writedoublearray interface, write the array to the messageparcel instance,
     *             and call readdoublearra to read the data
Z
zhangpa2021 已提交
6163 6164 6165
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
6166 6167 6168 6169 6170
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03300", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03300: create object successfully.");
Z
zhangpa2021 已提交
6171

Y
yang-qibo 已提交
6172 6173 6174 6175
                var wDoubleArryData = [1.2, 235.67, 99.76];
                var writeDoubleArrayResult = data.writeDoubleArray(wDoubleArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03300: run writeShortArrayis is " + writeDoubleArrayResult);
                expect(writeDoubleArrayResult).assertTrue();
Y
yang-qibo 已提交
6176

Y
yang-qibo 已提交
6177 6178 6179
                var rDoubleArryData = data.readDoubleArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03300: run readShortArray is " + rDoubleArryData);
                assertArrayElementEqual(wDoubleArryData,rDoubleArryData);
Y
yang-qibo 已提交
6180

Y
yang-qibo 已提交
6181 6182 6183 6184 6185 6186
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03300: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03300---------------------------");
        });
Z
zhangpa2021 已提交
6187

Y
yang-qibo 已提交
6188
        /*
Z
zhangpa2021 已提交
6189
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03400
Y
yang-qibo 已提交
6190 6191
     * @tc.name    Call the writedoublearray interface, write the array to the messageparcel instance,
     *             and call readdoublearra (datain: number []) to read the data
Z
zhangpa2021 已提交
6192
     * @tc.desc    Function test
6193
     * @tc.level   3
Z
zhangpa2021 已提交
6194
     */
Y
yang-qibo 已提交
6195 6196 6197 6198 6199
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03400", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03400: create object successfully.");
Z
zhangpa2021 已提交
6200

Y
yang-qibo 已提交
6201 6202 6203 6204 6205 6206 6207 6208
                var wDoubleArryData = [];
                for(let i = 0;i < (25*K - 1);i++){
                    wDoubleArryData[i] = 11.1;
                }
                var writeDoubleArrayResult = data.writeDoubleArray(wDoubleArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03400: run writeShortArrayis is "
                    + writeDoubleArrayResult);
                expect(writeDoubleArrayResult).assertTrue();
Y
yang-qibo 已提交
6209

Y
yang-qibo 已提交
6210 6211 6212 6213
                var rDoubleArryData = [];
                data.readDoubleArray(rDoubleArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03400: run readShortArray is " + rDoubleArryData.length);
                assertArrayElementEqual(wDoubleArryData,rDoubleArryData);
Y
yang-qibo 已提交
6214

Y
yang-qibo 已提交
6215 6216 6217 6218 6219 6220
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03400: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03400---------------------------");
        });
Z
zhangpa2021 已提交
6221

Y
yang-qibo 已提交
6222
        /*
Z
zhangpa2021 已提交
6223
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03500
Y
yang-qibo 已提交
6224
     * @tc.name    Writedoublearray interface, boundary value verification
Z
zhangpa2021 已提交
6225
     * @tc.desc    Function test
6226
     * @tc.level   3
Z
zhangpa2021 已提交
6227
     */
Y
yang-qibo 已提交
6228 6229 6230 6231 6232
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03500", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03500: create object successfully.");
Z
zhangpa2021 已提交
6233

Y
yang-qibo 已提交
6234 6235 6236 6237
                var wDoubleArryData = [-1235453.2, 235.67, 9987659.76];
                var writeDoubleArrayResult = data.writeDoubleArray(wDoubleArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03500: run writeShortArrayis is " + writeDoubleArrayResult);
                expect(writeDoubleArrayResult).assertTrue();
Z
zhangpa2021 已提交
6238

Y
yang-qibo 已提交
6239 6240 6241
                var rDoubleArryData = data.readDoubleArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03500: run readShortArray is " + rDoubleArryData);
                assertArrayElementEqual(wDoubleArryData,rDoubleArryData);
Y
yang-qibo 已提交
6242

Y
yang-qibo 已提交
6243 6244 6245 6246 6247 6248
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03500: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03500---------------------------");
        });
Z
zhangpa2021 已提交
6249

Y
yang-qibo 已提交
6250
        /*
Z
zhangpa2021 已提交
6251
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03600
Y
yang-qibo 已提交
6252
     * @tc.name    Writedoublearray interface, illegal value validation
Z
zhangpa2021 已提交
6253
     * @tc.desc    Function test
6254
     * @tc.level   3
Z
zhangpa2021 已提交
6255
     */
Y
yang-qibo 已提交
6256 6257 6258 6259 6260
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03600", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03600: create object successfully.");
Z
zhangpa2021 已提交
6261

Y
yang-qibo 已提交
6262 6263 6264 6265
                var DoubleArryData = [-12354883737337373873853.2, 235.67, 99999999999999993737373773987659.76];
                var WriteDoubleArrayResult = data.writeDoubleArray(DoubleArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03600: run writeDoubleArrayis is " + WriteDoubleArrayResult);
                expect(WriteDoubleArrayResult).assertTrue();
Y
yang-qibo 已提交
6266

Y
yang-qibo 已提交
6267 6268 6269 6270 6271 6272
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03600: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03600---------------------------");
        });
Z
zhangpa2021 已提交
6273

Y
yang-qibo 已提交
6274
        /*
Z
zhangpa2021 已提交
6275
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03700
Y
yang-qibo 已提交
6276
     * @tc.name    Writedoublearray interface, illegal value validation
Z
zhangpa2021 已提交
6277
     * @tc.desc    Function test
6278
     * @tc.level   3
Z
zhangpa2021 已提交
6279
     */
Y
yang-qibo 已提交
6280 6281 6282 6283 6284
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03700", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03700: create object successfully.");
Z
zhangpa2021 已提交
6285

Y
yang-qibo 已提交
6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296
                var errorDoubleArryData = [];
                for (let i=0;i<25*K;i++){
                    errorDoubleArryData[i] = 11.1;
                }
                var WriteDoubleArrayResult = data.writeDoubleArray(errorDoubleArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03700: run writeDoubleArrayis is " + WriteDoubleArrayResult);
                expect(WriteDoubleArrayResult).assertEqual(false);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03700: error " + error);
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
6297
            }
Y
yang-qibo 已提交
6298 6299
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03700---------------------------");
        });
Z
zhangpa2021 已提交
6300

Y
yang-qibo 已提交
6301
        /*
Z
zhangpa2021 已提交
6302
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03800
Y
yang-qibo 已提交
6303 6304
     * @tc.name    Call the writeboolean array interface, write the array to the messageparcel instance,
     *             and call readboolean array to read the data
Z
zhangpa2021 已提交
6305 6306 6307
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
6308 6309 6310 6311 6312
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03800", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03800: create object successfully.");
Z
zhangpa2021 已提交
6313

Y
yang-qibo 已提交
6314 6315 6316 6317
                var wBooleanArryData = [true, false, false];
                var writeBooleanArrayResult = data.writeBooleanArray(wBooleanArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03800: run writeShortArrayis is " + writeBooleanArrayResult);
                expect(writeBooleanArrayResult).assertTrue();
Z
zhangpa2021 已提交
6318

Y
yang-qibo 已提交
6319 6320 6321
                var rBooleanArryData = data.readBooleanArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03800: run readShortArray is " + rBooleanArryData);
                assertArrayElementEqual(wBooleanArryData,rBooleanArryData);
Y
yang-qibo 已提交
6322

Y
yang-qibo 已提交
6323 6324 6325 6326 6327 6328
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03800: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03800---------------------------");
        });
Z
zhangpa2021 已提交
6329

Y
yang-qibo 已提交
6330
        /*
Z
zhangpa2021 已提交
6331
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_03900
Y
yang-qibo 已提交
6332 6333
     * @tc.name    Call the writeboolean array interface, write the array to the messageparcel instance,
     *             and call readboolean array (datain: number []) to read the data
Z
zhangpa2021 已提交
6334
     * @tc.desc    Function test
6335
     * @tc.level   3
Z
zhangpa2021 已提交
6336
     */
Y
yang-qibo 已提交
6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_03900", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_03900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03900: create object successfully.");

                var wBooleanArryData = [];
                for (let i=0;i<(50*K - 1);i++){
                    if (i % 2 == 0){
                        wBooleanArryData[i] = false;
                    }else {
                        wBooleanArryData[i] = true;
                    }
Y
yang-qibo 已提交
6350
                }
Y
yang-qibo 已提交
6351 6352 6353
                var writeBooleanArrayResult = data.writeBooleanArray(wBooleanArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03900: run writeShortArrayis is " + writeBooleanArrayResult);
                expect(writeBooleanArrayResult).assertTrue();
Z
zhangpa2021 已提交
6354

Y
yang-qibo 已提交
6355 6356 6357 6358
                var rBooleanArryData = [];
                data.readBooleanArray(rBooleanArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03900: run readShortArray is " + rBooleanArryData.length);
                assertArrayElementEqual(wBooleanArryData,rBooleanArryData);
Y
yang-qibo 已提交
6359

Y
yang-qibo 已提交
6360 6361 6362 6363 6364 6365
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_03900: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_03900---------------------------");
        });
Z
zhangpa2021 已提交
6366

Y
yang-qibo 已提交
6367
        /*
Z
zhangpa2021 已提交
6368
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04000
Y
yang-qibo 已提交
6369
     * @tc.name    Writeboolean array interface, illegal value validation
Z
zhangpa2021 已提交
6370
     * @tc.desc    Function test
6371
     * @tc.level   3
Z
zhangpa2021 已提交
6372
     */
Y
yang-qibo 已提交
6373 6374 6375 6376 6377
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04000", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04000: create object successfully.");
Z
zhangpa2021 已提交
6378

Y
yang-qibo 已提交
6379 6380 6381 6382 6383 6384 6385 6386
                var BooleanArryData = [true, 'abc', false];
                var WriteBooleanArrayResult = data.writeBooleanArray(BooleanArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04000: run writeShortArrayis is " + WriteBooleanArrayResult);
                expect(WriteBooleanArrayResult).assertTrue();
                var rBooleanArryData = data.readBooleanArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04000: run readShortArray is " + rBooleanArryData);
                var newboolean = [true,false,false];
                assertArrayElementEqual(newboolean,rBooleanArryData);
Z
zhangpa2021 已提交
6387

Y
yang-qibo 已提交
6388 6389 6390 6391 6392 6393
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04000: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04000---------------------------");
        });
Z
zhangpa2021 已提交
6394

Y
yang-qibo 已提交
6395
        /*
Z
zhangpa2021 已提交
6396
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04100
Y
yang-qibo 已提交
6397
     * @tc.name    Writeboolean array interface, illegal value validation
Z
zhangpa2021 已提交
6398
     * @tc.desc    Function test
6399
     * @tc.level   3
Z
zhangpa2021 已提交
6400
     */
Y
yang-qibo 已提交
6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04100", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04100: create object successfully.");

                var errorBooleanArryData = [];
                for (let i=0;i<50*K;i++){
                    if (i % 2 == 0){
                        errorBooleanArryData[i] = false;
                    }else {
                        errorBooleanArryData[i] = true;
                    };
                }
                var WriteBooleanArrayResult = data.writeBooleanArray(errorBooleanArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04100: run writeShortArrayis is " + WriteBooleanArrayResult);
                expect(WriteBooleanArrayResult).assertEqual(false);
Y
yang-qibo 已提交
6418

Y
yang-qibo 已提交
6419 6420 6421 6422
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04100: error " + error);
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
6423
            }
Y
yang-qibo 已提交
6424 6425
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04100---------------------------");
        });
Z
zhangpa2021 已提交
6426

Y
yang-qibo 已提交
6427
        /*
Z
zhangpa2021 已提交
6428
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04200
Y
yang-qibo 已提交
6429 6430
     * @tc.name    Call the writechararray interface, write the array to the messageparcel instance,
     *             and call readchararray to read the data
J
jiyong 已提交
6431 6432 6433
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
6434 6435 6436 6437 6438
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04200", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04200: create object successfully.");
J
jiyong 已提交
6439

Y
yang-qibo 已提交
6440 6441 6442 6443 6444 6445 6446
                var wCharArryData = [];
                for(let i=0;i<(50*K - 1);i++){
                    wCharArryData[i] = 96;
                }
                var writeCharArrayResult = data.writeCharArray(wCharArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04200: run writeShortArrayis is " + writeCharArrayResult);
                expect(writeCharArrayResult).assertTrue();
Y
yang-qibo 已提交
6447

Y
yang-qibo 已提交
6448 6449 6450
                var rCharArryData = data.readCharArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04200: run readShortArray is " + rCharArryData.length);
                assertArrayElementEqual(wCharArryData,rCharArryData);
J
jiyong 已提交
6451

Y
yang-qibo 已提交
6452 6453 6454 6455 6456 6457
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04200: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04200---------------------------");
        });
J
jiyong 已提交
6458

Y
yang-qibo 已提交
6459
        /*
Z
zhangpa2021 已提交
6460
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04300
Y
yang-qibo 已提交
6461 6462
     * @tc.name    Call the writechararray interface, write the array to the messageparcel instance,
     *             and call readchararray (datain: number []) to read the data
J
jiyong 已提交
6463
     * @tc.desc    Function test
6464
     * @tc.level   3
J
jiyong 已提交
6465
     */
Y
yang-qibo 已提交
6466 6467 6468 6469 6470
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04300", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04300: create object successfully.");
J
jiyong 已提交
6471

Y
yang-qibo 已提交
6472 6473 6474 6475 6476 6477 6478
                var wCharArryData = [];
                for(let i=0;i<(50*K - 1);i++){
                    wCharArryData[i] = 96;
                }
                var writeCharArrayResult = data.writeCharArray(wCharArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04300: run writeShortArrayis is " + writeCharArrayResult);
                expect(writeCharArrayResult).assertTrue();
J
jiyong 已提交
6479

Y
yang-qibo 已提交
6480

Y
yang-qibo 已提交
6481 6482 6483 6484
                var rCharArryData = [];
                data.readCharArray(rCharArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04300: run readShortArray is " + rCharArryData.length);
                assertArrayElementEqual(wCharArryData,rCharArryData);
J
jiyong 已提交
6485

Y
yang-qibo 已提交
6486 6487 6488 6489 6490 6491
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04300: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04300---------------------------");
        });
J
jiyong 已提交
6492

Y
yang-qibo 已提交
6493
        /*
Z
zhangpa2021 已提交
6494
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04400
Y
yang-qibo 已提交
6495
     * @tc.name    Writechararray interface, illegal value validation
J
jiyong 已提交
6496
     * @tc.desc    Function test
6497
     * @tc.level   3
J
jiyong 已提交
6498
     */
Y
yang-qibo 已提交
6499 6500 6501 6502 6503
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04400", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04400: create object successfully.");
J
jiyong 已提交
6504

Y
yang-qibo 已提交
6505 6506 6507 6508
                var errorCharArryData = [10, 'asfgdgdtu', 20];
                var WriteCharArrayResult = data.writeCharArray(errorCharArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04400: run writeShortArrayis is " + WriteCharArrayResult);
                expect(WriteCharArrayResult).assertTrue();
J
jiyong 已提交
6509

Y
yang-qibo 已提交
6510 6511 6512 6513
                var rCharArryData = data.readCharArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04400: run readShortArray is " + rCharArryData);
                var xresult = [10,0,20];
                assertArrayElementEqual(xresult,rCharArryData);
J
jiyong 已提交
6514

Y
yang-qibo 已提交
6515 6516 6517 6518 6519 6520
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04400: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04400---------------------------");
        });
J
jiyong 已提交
6521

Y
yang-qibo 已提交
6522
        /*
Z
zhangpa2021 已提交
6523
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04500
Y
yang-qibo 已提交
6524 6525
     * @tc.name    Call the writestringarray interface, write the array to the messageparcel instance,
     *             and call readstringarray (datain: number []) to read the data
J
jiyong 已提交
6526 6527 6528
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
6529 6530 6531 6532 6533
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04500", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04500: create object successfully.");
Y
yang-qibo 已提交
6534

Y
yang-qibo 已提交
6535 6536 6537 6538
                var wStringArryData = ['abc', 'hello', 'beauty'];
                var writeStringArrayResult = data.writeStringArray(wStringArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04500: run writeShortArrayis is " + writeStringArrayResult);
                expect(writeStringArrayResult).assertTrue();
Y
yang-qibo 已提交
6539

Y
yang-qibo 已提交
6540 6541 6542
                var rStringArryData = data.readStringArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04500: run readShortArray is " + rStringArryData);
                assertArrayElementEqual(wStringArryData,rStringArryData);
Y
yang-qibo 已提交
6543

Y
yang-qibo 已提交
6544 6545 6546 6547 6548 6549
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04500: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04500---------------------------");
        });
Y
yang-qibo 已提交
6550

Y
yang-qibo 已提交
6551
        /*
Z
zhangpa2021 已提交
6552
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04600
Y
yang-qibo 已提交
6553 6554 6555
     * @tc.name    Call the writestringarray interface, write the array to the messageparcel instance,
     *             and call readstringarray() to read the data
     * @tc.desc    Function test
6556
     * @tc.level   3
Y
yang-qibo 已提交
6557
     */
Y
yang-qibo 已提交
6558 6559 6560 6561 6562
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04600", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04600: create object successfully.");
Y
yang-qibo 已提交
6563

Y
yang-qibo 已提交
6564 6565 6566 6567
                var wStringArryData = ['abc', 'hello', 'beauty'];
                var writeStringArrayResult = data.writeStringArray(wStringArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04600: run writeShortArrayis is " + writeStringArrayResult);
                expect(writeStringArrayResult).assertTrue();
Y
yang-qibo 已提交
6568 6569


Y
yang-qibo 已提交
6570 6571 6572 6573
                var rStringArryData = [];
                data.readStringArray(rStringArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04600: run readShortArray is " + rStringArryData);
                assertArrayElementEqual(wStringArryData,rStringArryData);
Y
yang-qibo 已提交
6574

Y
yang-qibo 已提交
6575 6576 6577 6578 6579 6580
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04600: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04600---------------------------");
        });
Y
yang-qibo 已提交
6581

Y
yang-qibo 已提交
6582
        /*
Z
zhangpa2021 已提交
6583
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04700
Y
yang-qibo 已提交
6584 6585
     * @tc.name    Writestringarray interface, illegal value validation
     * @tc.desc    Function test
6586
     * @tc.level   3
Y
yang-qibo 已提交
6587
     */
Y
yang-qibo 已提交
6588 6589 6590 6591 6592
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04700", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04700: create object successfully.");
Y
yang-qibo 已提交
6593

Y
yang-qibo 已提交
6594 6595 6596 6597
                var errorStringArryData = ['abc', 123, 'beauty'];
                var WriteStringArrayResult = data.writeStringArray(errorStringArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04700: run writeStringArrayis is " + WriteStringArrayResult);
                expect(WriteStringArrayResult).assertEqual(false);
Y
yang-qibo 已提交
6598

Y
yang-qibo 已提交
6599 6600 6601 6602 6603 6604 6605
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04700: error " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04700---------------------------");
        });
Y
yang-qibo 已提交
6606

Y
yang-qibo 已提交
6607
        /*
Z
zhangpa2021 已提交
6608
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04800
Y
yang-qibo 已提交
6609 6610
     * @tc.name    Writestringarray interface, illegal value validation
     * @tc.desc    Function test
6611
     * @tc.level   3
Y
yang-qibo 已提交
6612
     */
Y
yang-qibo 已提交
6613 6614 6615 6616 6617
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04800", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04800: create object successfully.");
Y
yang-qibo 已提交
6618

Y
yang-qibo 已提交
6619 6620 6621 6622 6623 6624 6625
                var errorStringArryData = [];
                for (let i=0;i<(10*K - 1);i++){
                    errorStringArryData[i] = "heddSDF";
                }
                var WriteStringArrayResult = data.writeStringArray(errorStringArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04800: run writeStringArrayis is " + WriteStringArrayResult);
                expect(WriteStringArrayResult).assertTrue();
6626

Y
yang-qibo 已提交
6627 6628 6629 6630 6631 6632 6633 6634 6635
                var errorStringArray = data.readStringArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04800: run writeStringArrayis is " + errorStringArray.length);
                assertArrayElementEqual(errorStringArray,errorStringArryData);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04800: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04800---------------------------");
        });
Y
yang-qibo 已提交
6636

Y
yang-qibo 已提交
6637
        /*
Z
zhangpa2021 已提交
6638
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_04900
Y
yang-qibo 已提交
6639 6640 6641 6642 6643
     * @tc.name    Call the writebytearray interface, write the array to the messageparcel instance,
     *             and call readbytearray to read the data
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_04900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_04900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04900: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var ByteArrayVar = [1, 2, 3, 4, 5];
                var writeShortArrayResult = data.writeByteArray(ByteArrayVar);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04900: run writeShortArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();

                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04900: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04900: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
Y
yang-qibo 已提交
6663

Y
yang-qibo 已提交
6664 6665 6666 6667 6668 6669 6670 6671 6672
                    var shortArryDataReply = result.reply.readByteArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04900: run readByteArray is " + shortArryDataReply);
                    assertArrayElementEqual(ByteArrayVar,shortArryDataReply);
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_04900: error " +error);
Y
yang-qibo 已提交
6673
            }
Y
yang-qibo 已提交
6674 6675
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_04900---------------------------");
        });
Y
yang-qibo 已提交
6676

Y
yang-qibo 已提交
6677
        /*
Z
zhangpa2021 已提交
6678
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05000
Y
yang-qibo 已提交
6679 6680 6681
     * @tc.name    Call the writebytearray interface, write the array to the messageparcel instance,
     *             and call readbytearray (datain: number []) to read the data
     * @tc.desc    Function test
6682
     * @tc.level   3
Y
yang-qibo 已提交
6683
     */
Y
yang-qibo 已提交
6684 6685 6686 6687 6688 6689 6690
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05000: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
Y
yang-qibo 已提交
6691

Y
yang-qibo 已提交
6692 6693 6694 6695
                var ByteArrayVar = [1, 2, 3, 4, 5];
                var writeShortArrayResult = data.writeByteArray(ByteArrayVar);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05000: run writeShortArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();
Y
yang-qibo 已提交
6696

Y
yang-qibo 已提交
6697 6698 6699 6700 6701 6702
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05000: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05000: sendRequestis is " + result.errCode);
Y
yang-qibo 已提交
6703

Y
yang-qibo 已提交
6704 6705 6706 6707 6708
                    var newArr = new Array(5);
                    result.reply.readByteArray(newArr);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05000: run readByteArray is " + newArr);
                    assertArrayElementEqual(ByteArrayVar,newArr);
                });
Y
yang-qibo 已提交
6709

Y
yang-qibo 已提交
6710 6711 6712 6713 6714 6715 6716 6717
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05000: error " +error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05000---------------------------");
        });
Y
yang-qibo 已提交
6718

Y
yang-qibo 已提交
6719
        /*
Z
zhangpa2021 已提交
6720
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05100
Y
yang-qibo 已提交
6721 6722
     * @tc.name    Writebytearray interface, boundary value verification
     * @tc.desc    Function test
6723
     * @tc.level   3
Y
yang-qibo 已提交
6724
     */
Y
yang-qibo 已提交
6725 6726 6727 6728 6729 6730 6731
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05100: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
Y
yang-qibo 已提交
6732

Y
yang-qibo 已提交
6733 6734 6735 6736
                var teArrayVar = [-128, 0, 1, 2, 127];
                var writeShortArrayResult = data.writeByteArray(teArrayVar);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05100: run writeShortArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();
Y
yang-qibo 已提交
6737

Y
yang-qibo 已提交
6738 6739 6740 6741 6742 6743
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05100: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05100: sendRequestis is " + result.errCode);
Y
yang-qibo 已提交
6744

Y
yang-qibo 已提交
6745 6746 6747 6748 6749
                    var newArr = new Array(5)
                    result.reply.readByteArray(newArr);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05100: run readByteArray is " + newArr);
                    assertArrayElementEqual(newArr,teArrayVar);
                });
Y
yang-qibo 已提交
6750

Y
yang-qibo 已提交
6751 6752 6753 6754 6755 6756 6757 6758
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05100: error " +error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05100---------------------------");
        });
Y
yang-qibo 已提交
6759

Y
yang-qibo 已提交
6760
        /*
Z
zhangpa2021 已提交
6761
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05200
Y
yang-qibo 已提交
6762 6763
     * @tc.name    Writebytearray interface, illegal value validation
     * @tc.desc    Function test
6764
     * @tc.level   3
Y
yang-qibo 已提交
6765
     */
Y
yang-qibo 已提交
6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05200: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var teArrayVar = [-128, 0, 1, 2, 128];
                var writeShortArrayResult = data.writeByteArray(teArrayVar);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05200: run writeShortArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();

                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05200: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05200: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    var shortArryDataReply = result.reply.readByteArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05200: run readByteArray is " + shortArryDataReply);
                    expect(shortArryDataReply[0] == teArrayVar[0]).assertTrue();
                    expect(shortArryDataReply[1] == teArrayVar[1]).assertTrue();
                    expect(shortArryDataReply[2] == teArrayVar[2]).assertTrue();
                    expect(shortArryDataReply[3] == teArrayVar[3]).assertTrue();
                    expect(shortArryDataReply[4] == -128).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05200: error " +error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05200---------------------------");
        });
Y
yang-qibo 已提交
6802

Y
yang-qibo 已提交
6803
        /*
Z
zhangpa2021 已提交
6804
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05300
Y
yang-qibo 已提交
6805 6806
     * @tc.name    Writebytearray interface, illegal value validation
     * @tc.desc    Function test
6807
     * @tc.level   3
Y
yang-qibo 已提交
6808
     */
Y
yang-qibo 已提交
6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05300: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var ByteArrayVar = [-129, 0, 1, 2, 127];
                var writeShortArrayResult = data.writeByteArray(ByteArrayVar);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05300: run writeShortArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();

                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05300: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTEARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05300: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    var shortArryDataReply = result.reply.readByteArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05300: run readByteArray is " + shortArryDataReply);
                    expect(shortArryDataReply[0] == 127).assertTrue();
                    expect(shortArryDataReply[1] == ByteArrayVar[1]).assertTrue();
                    expect(shortArryDataReply[2] == ByteArrayVar[2]).assertTrue();
                    expect(shortArryDataReply[3] == ByteArrayVar[3]).assertTrue();
                    expect(shortArryDataReply[4] == ByteArrayVar[4]).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05300: error " +error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05300---------------------------");
        });
J
jiyong 已提交
6845

Y
yang-qibo 已提交
6846
        /*
Z
zhangpa2021 已提交
6847
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05400
J
jiyong 已提交
6848 6849 6850 6851 6852
     * @tc.name    Call the writeintarray interface, write the array to the messageparcel instance,
     *             and call readintarray to read the data
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
6853 6854 6855 6856 6857 6858 6859
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05400: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
6860

Y
yang-qibo 已提交
6861 6862 6863 6864
                var intArryData = [100, 111, 112];
                var writeShortArrayResult = data.writeIntArray(intArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05400: run writeShortArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();
J
jiyong 已提交
6865

Y
yang-qibo 已提交
6866 6867 6868 6869 6870 6871 6872
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05400: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05400: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
J
jiyong 已提交
6873

Y
yang-qibo 已提交
6874 6875 6876 6877
                    var shortArryDataReply = result.reply.readIntArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05400: run readByteArray is " + shortArryDataReply);
                    assertArrayElementEqual(intArryData,shortArryDataReply);
                });
J
jiyong 已提交
6878

Y
yang-qibo 已提交
6879 6880 6881 6882 6883 6884 6885 6886
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05400: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05400---------------------------");
        });
J
jiyong 已提交
6887

Y
yang-qibo 已提交
6888
        /*
Z
zhangpa2021 已提交
6889
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05500
J
jiyong 已提交
6890 6891 6892
     * @tc.name    Call the writeintarray interface, write the array to the messageparcel instance,
     *             and call readintarray (datain: number []) to read the data
     * @tc.desc    Function test
6893
     * @tc.level   3
J
jiyong 已提交
6894
     */
Y
yang-qibo 已提交
6895 6896 6897 6898 6899 6900 6901
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05500: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
6902

Y
yang-qibo 已提交
6903 6904 6905 6906
                var intArryData = [100, 111, 112];
                var writeShortArrayResult = data.writeIntArray(intArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05500: run writeShortArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();
6907

Y
yang-qibo 已提交
6908 6909 6910 6911 6912 6913 6914 6915
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05500: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05500: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

6916
                    var newArr = [];
Y
yang-qibo 已提交
6917 6918 6919 6920
                    result.reply.readIntArray(newArr);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05500: run readIntArray is " + newArr);
                    assertArrayElementEqual(intArryData,newArr);
                });
6921

Y
yang-qibo 已提交
6922 6923 6924 6925 6926 6927 6928 6929
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05500: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05500---------------------------");
        });
J
jiyong 已提交
6930

Y
yang-qibo 已提交
6931
        /*
Z
zhangpa2021 已提交
6932
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05600
J
jiyong 已提交
6933 6934
     * @tc.name    Writeintarray interface, boundary value verification
     * @tc.desc    Function test
6935
     * @tc.level   3
J
jiyong 已提交
6936
     */
Y
yang-qibo 已提交
6937 6938 6939 6940 6941 6942 6943
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05600", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05600: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
6944

Y
yang-qibo 已提交
6945 6946 6947 6948
                var intArryData = [-2147483648, 0, 1, 2, 2147483647];
                var writeIntArrayResult = data.writeIntArray(intArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05600: run writeShortArrayis is " + writeIntArrayResult);
                expect(writeIntArrayResult == true).assertTrue();
J
jiyong 已提交
6949

Y
yang-qibo 已提交
6950 6951 6952 6953 6954 6955 6956
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05600: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05600: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
J
jiyong 已提交
6957

Y
yang-qibo 已提交
6958 6959 6960 6961
                    var shortArryDataReply = result.reply.readIntArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05600: run readByteArray is " + shortArryDataReply);
                    assertArrayElementEqual(intArryData,shortArryDataReply);
                });
J
jiyong 已提交
6962

Y
yang-qibo 已提交
6963 6964 6965 6966 6967 6968
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05600: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05600---------------------------");
        });
J
jiyong 已提交
6969

Y
yang-qibo 已提交
6970
        /*
Z
zhangpa2021 已提交
6971
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05700
J
jiyong 已提交
6972 6973
     * @tc.name    Writeintarray interface, illegal value verification
     * @tc.desc    Function test
6974
     * @tc.level   3
J
jiyong 已提交
6975
     */
Y
yang-qibo 已提交
6976 6977 6978 6979 6980 6981 6982
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05700", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05700: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
6983

Y
yang-qibo 已提交
6984 6985 6986 6987
                var intArryData = [-2147483649, 0, 1, 2, 2147483647];
                var writeIntArrayResult = data.writeIntArray(intArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05700: run writeShortArrayis is " + writeIntArrayResult);
                expect(writeIntArrayResult == true).assertTrue();
6988

Y
yang-qibo 已提交
6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05700: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05700: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    var shortArryDataReply = result.reply.readIntArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05700: run readByteArray is " + shortArryDataReply);
                    expect(shortArryDataReply[0] == 2147483647).assertTrue();
                    expect(shortArryDataReply[1] == intArryData[1]).assertTrue();
                    expect(shortArryDataReply[2] == intArryData[2]).assertTrue();
                    expect(shortArryDataReply[3] == intArryData[3]).assertTrue();
                    expect(shortArryDataReply[4] == intArryData[4]).assertTrue();
                });
7005

Y
yang-qibo 已提交
7006 7007 7008 7009 7010 7011
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05700: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05700---------------------------");
        });
Y
yang-qibo 已提交
7012

Y
yang-qibo 已提交
7013
        /*
Z
zhangpa2021 已提交
7014
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05800
Y
yang-qibo 已提交
7015 7016
     * @tc.name    Writeintarray interface, illegal value verification
     * @tc.desc    Function test
7017
     * @tc.level   3
Y
yang-qibo 已提交
7018
     */
Y
yang-qibo 已提交
7019 7020 7021 7022 7023 7024 7025
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05800", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05800: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
Y
yang-qibo 已提交
7026

Y
yang-qibo 已提交
7027 7028 7029 7030
                var intArryData = [0, 1, 2, 3, 2147483648];
                var writeIntArrayResult = data.writeIntArray(intArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05800: run writeShortArrayis is " + writeIntArrayResult);
                expect(writeIntArrayResult == true).assertTrue();
7031

Y
yang-qibo 已提交
7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05800: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05800: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    var shortArryDataReply = result.reply.readIntArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05800: run readByteArray is " + shortArryDataReply);
                    var newintArryData = [0, 1, 2, 3, -2147483648];
                    assertArrayElementEqual(newintArryData,shortArryDataReply);
                });
7045

Y
yang-qibo 已提交
7046 7047 7048 7049 7050 7051
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05800: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05800---------------------------");
        });
J
jiyong 已提交
7052

Y
yang-qibo 已提交
7053
        /*
Z
zhangpa2021 已提交
7054
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_05900
J
jiyong 已提交
7055 7056 7057 7058 7059
     * @tc.name    Call the writefloatarray interface, write the array to the messageparcel instance,
     *             and call readfloatarray to read the data
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
7060 7061 7062 7063 7064 7065 7066
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_05900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_05900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05900: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7067

Y
yang-qibo 已提交
7068 7069 7070 7071
                var floatArryData = [1.2, 1.3, 1.4];
                var writeShortArrayResult = data.writeFloatArray(floatArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05900: run writeFloatArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();
J
jiyong 已提交
7072 7073


Y
yang-qibo 已提交
7074 7075 7076 7077 7078 7079 7080
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05900: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_FLOATARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05900: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
J
jiyong 已提交
7081

Y
yang-qibo 已提交
7082 7083 7084 7085
                    var floatArryDataReply = result.reply.readFloatArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05900: run readFloatArray is " + floatArryDataReply);
                    assertArrayElementEqual(floatArryData,floatArryDataReply);
                });
J
jiyong 已提交
7086

Y
yang-qibo 已提交
7087 7088 7089 7090 7091 7092 7093 7094
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_05900: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_05900---------------------------");
        });
J
jiyong 已提交
7095

Y
yang-qibo 已提交
7096
        /*
Z
zhangpa2021 已提交
7097
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06000
J
jiyong 已提交
7098 7099 7100
     * @tc.name    Call the writefloatarray interface, write the array to the messageparcel instance,
     *             and call readfloatarray (datain: number []) to read the data
     * @tc.desc    Function test
7101
     * @tc.level   3
J
jiyong 已提交
7102
     */
Y
yang-qibo 已提交
7103 7104 7105 7106 7107 7108 7109
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06000: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7110

Y
yang-qibo 已提交
7111 7112 7113 7114
                var floatArryData = [1.2, 1.3, 1.4]
                var writeShortArrayResult = data.writeFloatArray(floatArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06000: run writeFloatArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();
J
jiyong 已提交
7115

Y
yang-qibo 已提交
7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06000: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_FLOATARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06000: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    var newArr = []
                    result.reply.readFloatArray(newArr);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06000: readFloatArray is " + newArr);
                    assertArrayElementEqual(floatArryData,newArr);
                });
J
jiyong 已提交
7129

Y
yang-qibo 已提交
7130 7131 7132 7133 7134 7135 7136 7137
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06000: error " +error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06000---------------------------");
        });
7138

Y
yang-qibo 已提交
7139
        /*
Z
zhangpa2021 已提交
7140
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06100
7141 7142
     * @tc.name    Writefloatarray interface, boundary value verification
     * @tc.desc    Function test
7143
     * @tc.level   3
J
jiyong 已提交
7144
     */
Y
yang-qibo 已提交
7145 7146 7147 7148 7149 7150 7151
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06100: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7152

Y
yang-qibo 已提交
7153 7154 7155 7156
                var floatArryData = [-3.40E+38, 1.3, 3.40E+38];
                var writeShortArrayResult = data.writeFloatArray(floatArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06100: run writeFloatArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();
J
jiyong 已提交
7157

Y
yang-qibo 已提交
7158 7159 7160 7161 7162 7163 7164
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06100: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_FLOATARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06100: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
7165

Y
yang-qibo 已提交
7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177
                    var newArr = result.reply.readFloatArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06100: run readFloatArray is " + newArr);
                    assertArrayElementEqual(floatArryData,newArr);
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06100: error " +error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06100---------------------------");
        });
J
jiyong 已提交
7178

Y
yang-qibo 已提交
7179
        /*
Z
zhangpa2021 已提交
7180
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06200
J
jiyong 已提交
7181 7182
     * @tc.name    Writefloatarray interface, illegal value validation
     * @tc.desc    Function test
7183
     * @tc.level   3
J
jiyong 已提交
7184
     */
Y
yang-qibo 已提交
7185 7186 7187 7188 7189 7190 7191
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06200: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7192

Y
yang-qibo 已提交
7193 7194 7195 7196
                var floatArryData = [-4.40E+38, 1.3, 3.40E+38];
                var writeShortArrayResult = data.writeFloatArray(floatArryData);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06200: run writeFloatArrayis is " + writeShortArrayResult);
                expect(writeShortArrayResult == true).assertTrue();
J
jiyong 已提交
7197

Y
yang-qibo 已提交
7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06200: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_FLOATARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06200: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    var newArr = result.reply.readFloatArray();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06200: run readFloatArray is " + newArr);
                    expect(newArr[0] == floatArryData[0]).assertTrue();
                    expect(newArr[1] == floatArryData[1]).assertTrue();
                    expect(newArr[2] == floatArryData[2]).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06200: error " +error);
J
jiyong 已提交
7217
            }
Y
yang-qibo 已提交
7218 7219
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06200---------------------------");
        });
7220

Y
yang-qibo 已提交
7221
        /*
Z
zhangpa2021 已提交
7222
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06300
J
jiyong 已提交
7223 7224 7225 7226 7227
     * @tc.name    Call the writeShort interface to write the short integer data to the messageparcel instance,
     *             and call readshort to read the data
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
7228 7229 7230 7231 7232 7233 7234
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06300: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7235

Y
yang-qibo 已提交
7236 7237 7238 7239
                var short = 8;
                var writeShor = data.writeShort(short);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06300: run writeShort success, writeShor is " + writeShor);
                expect(writeShor == true).assertTrue();
J
jiyong 已提交
7240

Y
yang-qibo 已提交
7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06300: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_SHORT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06300: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    var readShort = result.reply.readShort();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06300: run readFloatArray is success, readShort is "
                        + readShort);
                    expect(readShort == short).assertTrue();
                });
7254

Y
yang-qibo 已提交
7255 7256 7257 7258 7259 7260 7261 7262
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06300: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06300---------------------------");
        });
J
jiyong 已提交
7263

Y
yang-qibo 已提交
7264
        /*
Z
zhangpa2021 已提交
7265
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06400
J
jiyong 已提交
7266
     * @tc.name    WriteShort interface, boundary value verification
J
jiyong 已提交
7267
     * @tc.desc    Function test
7268
     * @tc.level   3
J
jiyong 已提交
7269
     */
Y
yang-qibo 已提交
7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06400: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                expect(data.writeShort(-32768) == true).assertTrue();
                expect(data.writeShort(0) == true).assertTrue();
                expect(data.writeShort(1) == true).assertTrue();
                expect(data.writeShort(2) == true).assertTrue();
                expect(data.writeShort(32767) == true).assertTrue();

                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06400: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_SHORT_MULTI, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06400: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    expect(result.reply.readShort() == -32768).assertTrue();
                    expect(result.reply.readShort() == 0).assertTrue();
                    expect(result.reply.readShort() == 1).assertTrue();
                    expect(result.reply.readShort() == 2).assertTrue();
                    expect(result.reply.readShort() == 32767).assertTrue();
                });
J
jiyong 已提交
7297

Y
yang-qibo 已提交
7298 7299 7300 7301 7302
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06400: error " + error);
J
jiyong 已提交
7303
            }
Y
yang-qibo 已提交
7304 7305
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06400---------------------------");
        });
J
jiyong 已提交
7306

Y
yang-qibo 已提交
7307
        /*
Z
zhangpa2021 已提交
7308
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06500
J
jiyong 已提交
7309
     * @tc.name    WriteShort interface, illegal value verification
J
jiyong 已提交
7310
     * @tc.desc    Function test
7311
     * @tc.level   3
J
jiyong 已提交
7312
     */
Y
yang-qibo 已提交
7313 7314 7315 7316 7317 7318 7319 7320
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06500: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                expect(data.writeShort(32768) == true).assertTrue();
J
jiyong 已提交
7321

Y
yang-qibo 已提交
7322 7323 7324 7325 7326 7327 7328 7329 7330
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06500: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_SHORT_MULTI, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06500: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    expect(result.reply.readShort() == -32768).assertTrue();
                });
7331

Y
yang-qibo 已提交
7332 7333 7334 7335 7336 7337 7338 7339
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06500: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06500---------------------------");
        });
J
jiyong 已提交
7340

Y
yang-qibo 已提交
7341
        /*
Z
zhangpa2021 已提交
7342
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06600
Y
yang-qibo 已提交
7343 7344
     * @tc.name    Call the writeShort interface to write the short integer data to the messageparcel instance,
     *             and call readshort to read the data
J
jiyong 已提交
7345
     * @tc.desc    Function test
7346
     * @tc.level   3
J
jiyong 已提交
7347
     */
Y
yang-qibo 已提交
7348 7349 7350 7351 7352 7353 7354
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06600: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7355

Y
yang-qibo 已提交
7356 7357 7358 7359
                var short = -32769;
                var writeShor = data.writeShort(short);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06600: run writeShort success, writeShor is " + writeShor);
                expect(writeShor == true).assertTrue();
J
jiyong 已提交
7360

Y
yang-qibo 已提交
7361 7362 7363 7364 7365 7366 7367
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06600: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_SHORT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06600: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
J
jiyong 已提交
7368

Y
yang-qibo 已提交
7369 7370 7371 7372
                    var readShort = result.reply.readShort();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06600: run readFloatArray is " + readShort);
                    expect(readShort == 32767).assertTrue();
                });
J
jiyong 已提交
7373

Y
yang-qibo 已提交
7374 7375 7376 7377 7378 7379 7380 7381
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06600: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06600---------------------------");
        });
J
jiyong 已提交
7382

Y
yang-qibo 已提交
7383
        /*
Z
zhangpa2021 已提交
7384
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06700
Y
yang-qibo 已提交
7385 7386
     * @tc.name    Call the writeShort interface to write the short integer data to the messageparcel instance,
     *             and call readshort to read the data
J
jiyong 已提交
7387
     * @tc.desc    Function test
7388
     * @tc.level   3
J
jiyong 已提交
7389
     */
Y
yang-qibo 已提交
7390 7391 7392 7393 7394 7395 7396
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06700: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7397

Y
yang-qibo 已提交
7398 7399 7400 7401
                var short = 32768;
                var writeShor = data.writeShort(short);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06700: run writeShort success, writeShor is " + writeShor);
                expect(writeShor == true).assertTrue();
J
jiyong 已提交
7402

Y
yang-qibo 已提交
7403 7404 7405 7406 7407 7408 7409
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06700: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_SHORT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06700: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
J
jiyong 已提交
7410

Y
yang-qibo 已提交
7411 7412 7413 7414
                    var readShort = result.reply.readShort();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06700: run readFloatArray is " + readShort);
                    expect(readShort == -32768).assertTrue();
                });
J
jiyong 已提交
7415

Y
yang-qibo 已提交
7416 7417 7418 7419 7420 7421 7422 7423
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06700: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06700---------------------------");
        });
J
jiyong 已提交
7424

Y
yang-qibo 已提交
7425
        /*
Z
zhangpa2021 已提交
7426
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06800
Y
yang-qibo 已提交
7427 7428
     * @tc.name    Call writelong interface to write long integer data to messageparcel instance
     *             and call readlong to read data
J
jiyong 已提交
7429 7430 7431
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
7432 7433 7434 7435 7436 7437 7438
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06800: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7439

Y
yang-qibo 已提交
7440 7441 7442 7443
                var short = 10000;
                var writelong = data.writeLong(short);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06800: run writeLong success, writelong is " + writelong);
                expect(writelong == true).assertTrue();
J
jiyong 已提交
7444

Y
yang-qibo 已提交
7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06800: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_LONG, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06800: run sendRequestis is "
                        + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    var readlong = result.reply.readLong();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06800: run readLong is success, readlong is " + readlong);
                    expect(readlong == short).assertTrue();
                });
7458

Y
yang-qibo 已提交
7459 7460 7461 7462 7463 7464 7465 7466
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06800: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06800---------------------------");
        });
7467

Y
yang-qibo 已提交
7468
        /*
Z
zhangpa2021 已提交
7469
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_06900
Y
yang-qibo 已提交
7470
     * @tc.name    Writelong interface, boundary value verification
J
jiyong 已提交
7471
     * @tc.desc    Function test
7472
     * @tc.level   3
J
jiyong 已提交
7473
     */
Y
yang-qibo 已提交
7474 7475 7476 7477 7478 7479 7480
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_06900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_06900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06900: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7481

Y
yang-qibo 已提交
7482 7483 7484 7485
                var short = 2147483647;
                var writelong = data.writeLong(short);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06900: run writeLong success, writelong is " + writelong);
                expect(writelong == true).assertTrue();
Y
yang-qibo 已提交
7486

Y
yang-qibo 已提交
7487 7488 7489 7490 7491 7492 7493
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06900: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_LONG, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06900: run sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
Y
yang-qibo 已提交
7494

Y
yang-qibo 已提交
7495 7496 7497 7498
                    var readlong = result.reply.readLong();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06900: run readLong is success, readlong is " + readlong);
                    expect(readlong == short).assertTrue();
                });
Y
yang-qibo 已提交
7499

Y
yang-qibo 已提交
7500 7501 7502 7503 7504 7505 7506
                data.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_06900: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_06900---------------------------");
        });
J
jiyong 已提交
7507

Y
yang-qibo 已提交
7508
        /*
Z
zhangpa2021 已提交
7509
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07000
Y
yang-qibo 已提交
7510
     * @tc.name    Writelong interface, illegal value verification
J
jiyong 已提交
7511
     * @tc.desc    Function test
7512
     * @tc.level   3
J
jiyong 已提交
7513
     */
Y
yang-qibo 已提交
7514 7515 7516 7517 7518 7519 7520
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07000: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
Y
yang-qibo 已提交
7521

Y
yang-qibo 已提交
7522 7523 7524 7525
                var short = 214748364887;
                var writelong = data.writeLong(short);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07000: run writeLong success, writelong is " + writelong);
                expect(writelong == true).assertTrue();
J
jiyong 已提交
7526

Y
yang-qibo 已提交
7527 7528 7529 7530 7531 7532 7533
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07000: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_LONG, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07000: run sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
Y
yang-qibo 已提交
7534

Y
yang-qibo 已提交
7535 7536 7537 7538
                    var readlong = result.reply.readLong();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07000: run readLong is success, readlong is " + readlong);
                    expect(readlong == short).assertTrue();
                });
J
jiyong 已提交
7539

Y
yang-qibo 已提交
7540 7541 7542 7543 7544 7545 7546
                data.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07000: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07000---------------------------");
        });
J
jiyong 已提交
7547

Y
yang-qibo 已提交
7548
        /*
Z
zhangpa2021 已提交
7549
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07100
Y
yang-qibo 已提交
7550
     * @tc.name    Writelong interface, illegal value verification
J
jiyong 已提交
7551
     * @tc.desc    Function test
7552
     * @tc.level   3
J
jiyong 已提交
7553
     */
Y
yang-qibo 已提交
7554 7555 7556 7557 7558 7559 7560
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07100: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
7561

Y
yang-qibo 已提交
7562 7563 7564 7565
                var short = 2147483649;
                var writelong = data.writeLong(short);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07100: run writeLong success, writelong is " + writelong);
                expect(writelong == true).assertTrue();
Y
yang-qibo 已提交
7566

Y
yang-qibo 已提交
7567 7568 7569 7570 7571 7572 7573
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07100: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_LONG, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07100: run sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
Y
yang-qibo 已提交
7574

Y
yang-qibo 已提交
7575 7576 7577 7578
                    var readlong = result.reply.readLong();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07100: run readLong is success, readlong is " + readlong);
                    expect(readlong == short).assertTrue();
                });
J
jiyong 已提交
7579

Y
yang-qibo 已提交
7580 7581 7582 7583 7584 7585 7586
                data.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07100: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07100---------------------------");
        });
J
jiyong 已提交
7587

Y
yang-qibo 已提交
7588
        /*
Z
zhangpa2021 已提交
7589
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07200
Y
yang-qibo 已提交
7590
     * @tc.name    Call the parallel interface to read and write data to the double instance
J
jiyong 已提交
7591 7592 7593
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07200: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();

                var token = 10.2;
                var result = data.writeDouble(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07200:run writeDoubleis is " + result);
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07200: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_DOUBLE, data, reply, option).then((result) => {
Z
zhangpa2021 已提交
7610
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07200: run sendRequestis is " + result.errCode);
Y
yang-qibo 已提交
7611
                    var replyReadResult = reply.readDouble();
Z
zhangpa2021 已提交
7612
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07200: run replyReadResult is " + replyReadResult);
Y
yang-qibo 已提交
7613 7614
                    expect(replyReadResult == token).assertTrue();
                });
Y
yang-qibo 已提交
7615 7616 7617 7618 7619 7620
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07200:error = " + error);
            }
Y
yang-qibo 已提交
7621

Y
yang-qibo 已提交
7622 7623
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07200---------------------------");
        });
J
jiyong 已提交
7624

Y
yang-qibo 已提交
7625
        /*
Z
zhangpa2021 已提交
7626
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07300
Y
yang-qibo 已提交
7627
     * @tc.name    Writedouble interface, boundary value verification
J
jiyong 已提交
7628
     * @tc.desc    Function test
7629
     * @tc.level   3
J
jiyong 已提交
7630
     */
Y
yang-qibo 已提交
7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07300: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 1.79E+308;
                var result = data.writeDouble(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07300:run writeDoubleis is " + result);
                expect(result == true).assertTrue();

                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07300: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_DOUBLE, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07300: run sendRequestis is " + result.errCode);
                    var replyReadResult = reply.readDouble();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07300: run rreplyReadResult is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
Y
yang-qibo 已提交
7653

Y
yang-qibo 已提交
7654 7655 7656 7657
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07300:error = " + error);
Y
yang-qibo 已提交
7658
            }
Y
yang-qibo 已提交
7659 7660
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07300---------------------------");
        });
7661

Y
yang-qibo 已提交
7662
        /*
Z
zhangpa2021 已提交
7663
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07400
Y
yang-qibo 已提交
7664
     * @tc.name    Writedouble interface, boundary value verification
J
jiyong 已提交
7665
     * @tc.desc    Function test
7666
     * @tc.level   3
J
jiyong 已提交
7667
     */
Y
yang-qibo 已提交
7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07400", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07400: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 4.9000000e-32;
                var result = data.writeDouble(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07400:run writeDoubleis is " + result);
                expect(result == true).assertTrue();

                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07400: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_DOUBLE, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07400: run sendRequestis is " + result.errCode);
                    var replyReadResult = reply.readDouble();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07400: run replyReadResult is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
Y
yang-qibo 已提交
7690

Y
yang-qibo 已提交
7691 7692 7693 7694
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07400:error = " + error);
J
jiyong 已提交
7695
            }
Y
yang-qibo 已提交
7696 7697
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07400---------------------------");
        });
7698

Y
yang-qibo 已提交
7699
        /*
Z
zhangpa2021 已提交
7700
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07500
Y
yang-qibo 已提交
7701
     * @tc.name    Writedouble interface, illegal value validation
J
jiyong 已提交
7702
     * @tc.desc    Function test
7703
     * @tc.level   3
J
jiyong 已提交
7704
     */
Y
yang-qibo 已提交
7705 7706 7707 7708 7709
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07500", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07500: create object successfully.");
Y
yang-qibo 已提交
7710

Y
yang-qibo 已提交
7711 7712 7713
                var token = "1.79E+465312156";
                var result = data.writeDouble(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07500:run writeDoubleis is " + result);
Z
zhangpa2021 已提交
7714

Y
yang-qibo 已提交
7715 7716 7717 7718 7719 7720 7721
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07500:error = " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07500---------------------------");
        });
J
jiyong 已提交
7722

Y
yang-qibo 已提交
7723
        /*
Z
zhangpa2021 已提交
7724
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07600
Y
yang-qibo 已提交
7725 7726
     * @tc.name    Call the writeboolean interface to write the data to the messageparcel instance,
     *             and call readboolean to read the data
J
jiyong 已提交
7727 7728 7729
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07600: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = true;
                var result = data.writeBoolean(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07600:run writeBooleanis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07600: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BOOLEAN, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07600: run sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readBoolean();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07600: run readBoolean is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07600:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07600---------------------------");
        });
J
jiyong 已提交
7759

Y
yang-qibo 已提交
7760
        /*
Z
zhangpa2021 已提交
7761
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07700
Y
yang-qibo 已提交
7762 7763 7764
     * @tc.name    Call the writeboolean interface to write the data to the messageparcel instance,
     *             and call readboolean to read the data
     * @tc.desc    Function test
7765
     * @tc.level   3
Y
yang-qibo 已提交
7766
     */
Y
yang-qibo 已提交
7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07700", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07700: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = false;
                var result = data.writeBoolean(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07700:run writeBooleanis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07700: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BOOLEAN, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07700: run sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readBoolean();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07700: run readBoolean is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07700:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07700---------------------------");
        });
J
jiyong 已提交
7796

Y
yang-qibo 已提交
7797
        /*
Z
zhangpa2021 已提交
7798
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07800
Y
yang-qibo 已提交
7799
     * @tc.name    Writeboolean interface, illegal value verification
J
jiyong 已提交
7800
     * @tc.desc    Function test
7801
     * @tc.level   3
J
jiyong 已提交
7802
     */
Y
yang-qibo 已提交
7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07800: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 9;
                var result = data.writeBoolean(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07800:run writeBooleanis is " + result);
                expect(result == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07800:error = " + error);
                expect(error != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07800---------------------------");
        });
J
jiyong 已提交
7821

Y
yang-qibo 已提交
7822
        /*
Z
zhangpa2021 已提交
7823
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_07900
Y
yang-qibo 已提交
7824
     * @tc.name    Writeboolean interface, illegal value verification
J
jiyong 已提交
7825
     * @tc.desc    Function test
7826
     * @tc.level   3
J
jiyong 已提交
7827
     */
Y
yang-qibo 已提交
7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_07900", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_07900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07900: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = "aaa";
                var result = data.writeBoolean(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07900:run writeBooleanis is " + result);
                expect(result == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_07900:error = " + error);
                expect(error != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_07900---------------------------");
        });
Y
yang-qibo 已提交
7846

Y
yang-qibo 已提交
7847
        /*
Z
zhangpa2021 已提交
7848
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08000
Y
yang-qibo 已提交
7849 7850 7851 7852 7853
     * @tc.name    Call the writechar interface to write the data to the messageparcel instance,
     *             and call readchar to read the data
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08000", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08000: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 65;
                var result = data.writeChar(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08000:run writeCharis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08000: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08000: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readChar();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08000: run readChar is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
J
jiyong 已提交
7875

Y
yang-qibo 已提交
7876 7877 7878 7879 7880 7881 7882 7883
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08000:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08000---------------------------");
        });
J
jiyong 已提交
7884

Y
yang-qibo 已提交
7885
        /*
Z
zhangpa2021 已提交
7886
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08100
Y
yang-qibo 已提交
7887 7888
     * @tc.name    Call the writechar interface to write the data to the messageparcel instance,
     *             and call readchar to read the data
J
jiyong 已提交
7889
     * @tc.desc    Function test
7890
     * @tc.level   3
J
jiyong 已提交
7891
     */
Y
yang-qibo 已提交
7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08100", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08100: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 122;
                var result = data.writeChar(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08100:run writeCharis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08100: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08100: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readChar();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08100: run readChar is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
J
jiyong 已提交
7913

Y
yang-qibo 已提交
7914 7915 7916 7917 7918 7919 7920 7921
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08100:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08100---------------------------");
        });
J
jiyong 已提交
7922

Y
yang-qibo 已提交
7923
        /*
Z
zhangpa2021 已提交
7924
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08200
Y
yang-qibo 已提交
7925 7926
     * @tc.name    Call the writechar interface to write the data to the messageparcel instance,
     *             and call readchar to read the data
J
jiyong 已提交
7927
     * @tc.desc    Function test
7928
     * @tc.level   3
J
jiyong 已提交
7929
     */
Y
yang-qibo 已提交
7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08200: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 64;
                var result = data.writeChar(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08200:run writeCharis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08200: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08200: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readChar();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08200: run readChar is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
J
jiyong 已提交
7951

Y
yang-qibo 已提交
7952 7953 7954 7955 7956 7957 7958 7959
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08200:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08200---------------------------");
        });
J
jiyong 已提交
7960

Y
yang-qibo 已提交
7961
        /*
Z
zhangpa2021 已提交
7962
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08300
Y
yang-qibo 已提交
7963 7964
     * @tc.name    Call the writechar interface to write the data to the messageparcel instance,
     *             and call readchar to read the data
J
jiyong 已提交
7965
     * @tc.desc    Function test
7966
     * @tc.level   3
J
jiyong 已提交
7967
     */
Y
yang-qibo 已提交
7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08300: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 123;
                var result = data.writeChar(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08300:run writeCharis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08300: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08300: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readChar();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08300: run readChar is  " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
J
jiyong 已提交
7989

Y
yang-qibo 已提交
7990 7991 7992 7993 7994 7995 7996 7997
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08300:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08300---------------------------");
        });
J
jiyong 已提交
7998

Y
yang-qibo 已提交
7999
        /*
Z
zhangpa2021 已提交
8000
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08400
Y
yang-qibo 已提交
8001 8002
     * @tc.name    Call the writechar interface to write the data to the messageparcel instance,
     *             and call readchar to read the data
J
jiyong 已提交
8003
     * @tc.desc    Function test
8004
     * @tc.level   3
J
jiyong 已提交
8005
     */
Y
yang-qibo 已提交
8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08400: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 65;
                var result = data.writeChar(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08400:run writeCharis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08400: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_CHAR, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08400: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readChar();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08400: run readChar is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
J
jiyong 已提交
8027

Y
yang-qibo 已提交
8028 8029 8030 8031 8032 8033 8034 8035
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08400:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08400---------------------------");
        });
J
jiyong 已提交
8036

Y
yang-qibo 已提交
8037
        /*
Z
zhangpa2021 已提交
8038
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08500
Y
yang-qibo 已提交
8039
     * @tc.name    Writechar interface, illegal value verification
J
jiyong 已提交
8040
     * @tc.desc    Function test
8041
     * @tc.level   3
J
jiyong 已提交
8042
     */
Y
yang-qibo 已提交
8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08500", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08500: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 'ades';
                var result = data.writeChar(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08500:run writeCharis is " + result);
                expect(result == false).assertTrue()

            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08500:error = " + error);
                expect(error != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08500---------------------------");
        });
J
jiyong 已提交
8062

Y
yang-qibo 已提交
8063
        /*
Z
zhangpa2021 已提交
8064
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08600
Y
yang-qibo 已提交
8065 8066
     * @tc.name    Call the writestring interface to write the data to the messageparcel instance,
     *             and call readstring() to read the data
J
jiyong 已提交
8067 8068 8069
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08600: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = '';
                for(var i = 0; i < (40*K - 1); i++){
                    token += 'a';
                };
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08600:run writeStringis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08600: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08600: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08600: run readString is " + replyReadResult.length);
                    expect(replyReadResult == token).assertTrue();
                });
J
jiyong 已提交
8094

Y
yang-qibo 已提交
8095 8096 8097 8098 8099 8100 8101 8102
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08600:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08600---------------------------");
        });
J
jiyong 已提交
8103

Y
yang-qibo 已提交
8104
        /*
Z
zhangpa2021 已提交
8105
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08700
Y
yang-qibo 已提交
8106 8107
     * @tc.name    Call the writestring interface to write the data to the messageparcel instance,
     *             and call readstring() to read the data
J
jiyong 已提交
8108
     * @tc.desc    Function test
8109
     * @tc.level   3
J
jiyong 已提交
8110
     */
Y
yang-qibo 已提交
8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08700: create object successfully.");
                var token = '';
                for(var i = 0; i < 40*K; i++){
                    token += 'a';
                };
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08700:run writeStringis is " + result);
                expect(result == false).assertTrue();
J
jiyong 已提交
8123

Y
yang-qibo 已提交
8124 8125 8126 8127 8128 8129 8130
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08700:error = " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08700---------------------------");
        });
J
jiyong 已提交
8131

Y
yang-qibo 已提交
8132
        /*
Z
zhangpa2021 已提交
8133
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08800
Y
yang-qibo 已提交
8134
     * @tc.name    Writestring interface, illegal value verification
J
jiyong 已提交
8135
     * @tc.desc    Function test
8136
     * @tc.level   3
J
jiyong 已提交
8137
     */
Y
yang-qibo 已提交
8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08800: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 123;
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08800:run writeStringis is " + result);
                expect(result == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08800:error = " + error);
                expect(error != null).assertTrue();
            }
            data.reclaim();
            reply.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08800---------------------------");
        });
J
jiyong 已提交
8157

Y
yang-qibo 已提交
8158
        /*
Z
zhangpa2021 已提交
8159
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_08900
Y
yang-qibo 已提交
8160 8161
     * @tc.name    Call the writebyte interface to write data to the messageparcel instance,
     *             and call readbyte to read data
J
jiyong 已提交
8162 8163 8164
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_08900", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_08900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08900: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 2;
                var result = data.writeByte(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08900:run writeByteis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08900: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTE, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08900: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readByte();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08900: run readByte is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
Y
yang-qibo 已提交
8186

Y
yang-qibo 已提交
8187 8188 8189 8190 8191 8192 8193 8194
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_08900:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_08900---------------------------");
        });
J
jiyong 已提交
8195

Y
yang-qibo 已提交
8196
        /*
Z
zhangpa2021 已提交
8197
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09000
Y
yang-qibo 已提交
8198
     * @tc.name    Writebyte interface, boundary value verification
J
jiyong 已提交
8199
     * @tc.desc    Function test
8200
     * @tc.level   3
J
jiyong 已提交
8201
     */
Y
yang-qibo 已提交
8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09000", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09000: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();

                expect(data.writeByte(-128) == true).assertTrue();
                expect(data.writeByte(0) == true).assertTrue();
                expect(data.writeByte(1) == true).assertTrue();
                expect(data.writeByte(2) == true).assertTrue();
                expect(data.writeByte(127) == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09000: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTE_MULTI, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09000: sendRequestis is " + result.errCode);

                    expect(reply.readByte() == -128).assertTrue();
                    expect(reply.readByte() == 0).assertTrue();
                    expect(reply.readByte() == 1).assertTrue();
                    expect(reply.readByte() == 2).assertTrue();
                    expect(reply.readByte() == 127).assertTrue();
                });
Y
yang-qibo 已提交
8228

Y
yang-qibo 已提交
8229 8230 8231 8232 8233
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09000:error = " + error);
Y
yang-qibo 已提交
8234
            }
Y
yang-qibo 已提交
8235 8236
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09000---------------------------");
        });
8237

Y
yang-qibo 已提交
8238
        /*
Z
zhangpa2021 已提交
8239
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09100
Y
yang-qibo 已提交
8240
     * @tc.name    Writebyte interface, illegal value verification
J
jiyong 已提交
8241
     * @tc.desc    Function test
8242
     * @tc.level   3
J
jiyong 已提交
8243
     */
Y
yang-qibo 已提交
8244 8245 8246 8247 8248 8249 8250
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09100", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09100: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
8251

Y
yang-qibo 已提交
8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265
                expect(data.writeByte(-129) == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09100: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTE_MULTI, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09100: sendRequestis is " + result.errCode);
                    expect(reply.readByte() == 127).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09100:error = " + error);
Y
yang-qibo 已提交
8266
            }
Y
yang-qibo 已提交
8267 8268
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09100---------------------------");
        });
J
jiyong 已提交
8269

Y
yang-qibo 已提交
8270
        /*
Z
zhangpa2021 已提交
8271
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09200
Y
yang-qibo 已提交
8272
     * @tc.name    Writebyte interface, illegal value verification
J
jiyong 已提交
8273
     * @tc.desc    Function test
8274
     * @tc.level   3
J
jiyong 已提交
8275
     */
Y
yang-qibo 已提交
8276 8277 8278 8279 8280 8281 8282
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09200: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
8283

Y
yang-qibo 已提交
8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297
                expect(data.writeByte(128) == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09200: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_BYTE_MULTI, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09200: sendRequestis is " + result.errCode);
                    expect(reply.readByte() == -128).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09200:error = " + error);
Y
yang-qibo 已提交
8298
            }
Y
yang-qibo 已提交
8299 8300
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09200---------------------------");
        });
J
jiyong 已提交
8301

Y
yang-qibo 已提交
8302
        /*
Z
zhangpa2021 已提交
8303
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09300
Y
yang-qibo 已提交
8304
     * @tc.name    Writebyte interface, illegal value verification
J
jiyong 已提交
8305
     * @tc.desc    Function test
8306
     * @tc.level   3
J
jiyong 已提交
8307
     */
Y
yang-qibo 已提交
8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09300: create object successfully.");
                let writeby = data.writeByte("error");
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09300: writeByte is" + writeby);
                expect(writeby).assertEqual(false);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09300:error = " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09300---------------------------");
        });
J
jiyong 已提交
8323

Y
yang-qibo 已提交
8324
        /*
Z
zhangpa2021 已提交
8325
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09400
Y
yang-qibo 已提交
8326 8327
     * @tc.name    Call the writeint interface to write the data to the messageparcel instance,
     *             and call readint to read the data
J
jiyong 已提交
8328 8329 8330
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09400: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 2;
                var result = data.writeInt(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09400:run writeIntis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09400: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09400: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09400: run readInt is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
J
jiyong 已提交
8352

Y
yang-qibo 已提交
8353 8354 8355 8356 8357 8358
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09400:error = " + error);
            }
Y
yang-qibo 已提交
8359

Y
yang-qibo 已提交
8360 8361
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09400---------------------------");
        });
J
jiyong 已提交
8362

Y
yang-qibo 已提交
8363
        /*
Z
zhangpa2021 已提交
8364
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09500
Y
yang-qibo 已提交
8365
     * @tc.name    Writeint interface, boundary value verification
J
jiyong 已提交
8366
     * @tc.desc    Function test
8367
     * @tc.level   3
J
jiyong 已提交
8368
     */
Y
yang-qibo 已提交
8369 8370 8371 8372 8373 8374 8375
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09500", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09500: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
J
jiyong 已提交
8376

Y
yang-qibo 已提交
8377 8378 8379 8380 8381
                expect(data.writeInt(-2147483648) == true).assertTrue();
                expect(data.writeInt(0) == true).assertTrue();
                expect(data.writeInt(1) == true).assertTrue();
                expect(data.writeInt(2) == true).assertTrue();
                expect(data.writeInt(2147483647) == true).assertTrue();
J
jiyong 已提交
8382

Y
yang-qibo 已提交
8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09500: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT_MULTI, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09500: sendRequestis is " + result.errCode);
                    expect(result.reply.readInt() == -2147483648).assertTrue();
                    expect(result.reply.readInt() == 0).assertTrue();
                    expect(result.reply.readInt() == 1).assertTrue();
                    expect(result.reply.readInt() == 2).assertTrue();
                    expect(result.reply.readInt() == 2147483647).assertTrue();
                });
8395

Y
yang-qibo 已提交
8396 8397 8398 8399 8400 8401
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09500:error = " + error);
            }
Y
yang-qibo 已提交
8402

Y
yang-qibo 已提交
8403 8404
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09500---------------------------");
        });
J
jiyong 已提交
8405

Y
yang-qibo 已提交
8406
        /*
Z
zhangpa2021 已提交
8407
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09600
Y
yang-qibo 已提交
8408
     * @tc.name    Writeint interface, illegal value verification
J
jiyong 已提交
8409
     * @tc.desc    Function test
8410
     * @tc.level   3
8411
     */
Y
yang-qibo 已提交
8412 8413 8414 8415 8416 8417 8418 8419
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09600: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                expect(data.writeInt(2147483648) == true).assertTrue();
J
jiyong 已提交
8420

Y
yang-qibo 已提交
8421 8422 8423 8424 8425 8426 8427 8428
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09600: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT_MULTI, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09600: sendRequestis is " + result.errCode);
                    expect(result.reply.readInt() == -2147483648).assertTrue();
                });
8429

Y
yang-qibo 已提交
8430 8431 8432 8433 8434 8435
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09600:error = " + error);
            }
J
jiyong 已提交
8436

Y
yang-qibo 已提交
8437 8438
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09600---------------------------");
        });
J
jiyong 已提交
8439

Y
yang-qibo 已提交
8440
        /*
Z
zhangpa2021 已提交
8441
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09700
Y
yang-qibo 已提交
8442
     * @tc.name    Writeint interface, illegal value verification
J
jiyong 已提交
8443
     * @tc.desc    Function test
8444
     * @tc.level   3
J
jiyong 已提交
8445
     */
Y
yang-qibo 已提交
8446 8447 8448 8449 8450 8451 8452 8453
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09700", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09700: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                expect(data.writeInt(-2147483649) == true).assertTrue();
J
jiyong 已提交
8454

Y
yang-qibo 已提交
8455 8456 8457 8458 8459 8460 8461 8462
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09700: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT_MULTI, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09700: sendRequestis is " + result.errCode);
                    expect(result.reply.readInt() == 2147483647).assertTrue();
                });
8463

Y
yang-qibo 已提交
8464 8465 8466 8467 8468 8469
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09700:error = " + error);
            }
Y
yang-qibo 已提交
8470

Y
yang-qibo 已提交
8471 8472
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09700---------------------------");
        });
J
jiyong 已提交
8473

Y
yang-qibo 已提交
8474
        /*
Z
zhangpa2021 已提交
8475
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09800
Y
yang-qibo 已提交
8476 8477
     * @tc.name    Call the writefloat interface to write data to the messageparcel instance,
     *             and call readfloat to read data
J
jiyong 已提交
8478 8479 8480
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09800: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 2.2;
                var result = data.writeFloat(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09800:run writeDoubleis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09800: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09800: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readFloat();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09800: run readFloat is " + replyReadResult);
                    expect(replyReadResult == token).assertTrue();
                });
J
jiyong 已提交
8502

Y
yang-qibo 已提交
8503 8504 8505 8506 8507 8508 8509 8510
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09800:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09800---------------------------");
        });
J
jiyong 已提交
8511

Y
yang-qibo 已提交
8512
        /*
Z
zhangpa2021 已提交
8513
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_09900
Y
yang-qibo 已提交
8514
     * @tc.name    Writefloat interface, boundary value verification
J
jiyong 已提交
8515
     * @tc.desc    Function test
8516
     * @tc.level   3
J
jiyong 已提交
8517
     */
Y
yang-qibo 已提交
8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_09900", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_09900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09900: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 3.4E+38;
                var result = data.writeFloat(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09900:run writeFloatis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09900: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09900: sendRequestis is " + result.errCode);
                    var newReadResult = result.reply.readFloat();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09900: readFloat result is " + newReadResult);
                    expect(newReadResult == token).assertTrue();
                });
J
jiyong 已提交
8539

Y
yang-qibo 已提交
8540 8541 8542 8543 8544 8545
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_09900:error = " + error);
            }
J
jiyong 已提交
8546

Y
yang-qibo 已提交
8547 8548
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_09900---------------------------");
        });
J
jiyong 已提交
8549

Y
yang-qibo 已提交
8550
        /*
Z
zhangpa2021 已提交
8551
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10000
Y
yang-qibo 已提交
8552
     * @tc.name    Writefloat interface, boundary value verification
J
jiyong 已提交
8553
     * @tc.desc    Function test
8554
     * @tc.level   3
J
jiyong 已提交
8555
     */
Y
yang-qibo 已提交
8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10000", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10000: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 1.4E-45;
                var result = data.writeFloat(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10000:run writeFloatis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10000: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10000: sendRequestis is " + result.errCode);
                    var newReadResult = result.reply.readFloat();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10000: readFloat result is " + newReadResult);
                    expect(newReadResult == token).assertTrue();
                });
J
jiyong 已提交
8577

Y
yang-qibo 已提交
8578 8579 8580 8581 8582 8583
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10000:error = " + error);
            }
J
jiyong 已提交
8584

Y
yang-qibo 已提交
8585 8586
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10000---------------------------");
        });
J
jiyong 已提交
8587

Y
yang-qibo 已提交
8588
        /*
Z
zhangpa2021 已提交
8589
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10100
Y
yang-qibo 已提交
8590
     * @tc.name    Writefloat interface, boundary value verification
J
jiyong 已提交
8591
     * @tc.desc    Function test
8592
     * @tc.level   3
J
jiyong 已提交
8593
     */
Y
yang-qibo 已提交
8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10100", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10100: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var token = 4.4E+38;
                var result = data.writeFloat(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10100:run writeFloatis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10100: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_FLOAT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10100: sendRequestis is " + result.errCode);
                    var newReadResult = result.reply.readFloat();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10100: readFloat result is " + newReadResult);
                    expect(newReadResult == token).assertTrue();
                });
J
jiyong 已提交
8615

Y
yang-qibo 已提交
8616 8617 8618 8619 8620 8621
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10100:error = " + error);
            }
J
jiyong 已提交
8622

Y
yang-qibo 已提交
8623 8624
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10100---------------------------");
        });
J
jiyong 已提交
8625

Y
yang-qibo 已提交
8626
        /*
Z
zhangpa2021 已提交
8627
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10200
Y
yang-qibo 已提交
8628
     * @tc.name    Writefloat interface, illegal value validation
J
jiyong 已提交
8629
     * @tc.desc    Function test
8630
     * @tc.level   3
J
jiyong 已提交
8631
     */
Y
yang-qibo 已提交
8632 8633 8634 8635 8636
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10200", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10200: create object successfully.");
Y
yang-qibo 已提交
8637

Y
yang-qibo 已提交
8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648
                var token = 'a';
                var result = data.writeFloat(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10200:run writeFloatis is " + result);
                expect(result == false).assertTrue();
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10200:error = " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10200---------------------------");
        });
J
jiyong 已提交
8649

Y
yang-qibo 已提交
8650
        /*
Z
zhangpa2021 已提交
8651
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10300
Y
yang-qibo 已提交
8652
     * @tc.name    Test messageparcel to deliver rawdata data
J
jiyong 已提交
8653 8654 8655
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10300: create object successfully.");

                var Capacity = data.getRawDataCapacity()
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10300:run Capacity success, Capacity is " + Capacity);
                expect(Capacity).assertEqual(128*M);

                var rawdata = [1, 2, 3]
                var result = data.writeRawData(rawdata, rawdata.length);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10300:run writeRawDatais is " + result);
                expect(result == true).assertTrue();
                var newReadResult = data.readRawData(rawdata.length)
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10300:run readRawDatais is " + newReadResult);
                assertArrayElementEqual(newReadResult,rawdata);
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10300:error = " + error);
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10300---------------------------");
        });
8679

Y
yang-qibo 已提交
8680
        /*
Z
zhangpa2021 已提交
8681
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10400
Y
yang-qibo 已提交
8682
     * @tc.name    Illegal value passed in from writerawdata interface
J
jiyong 已提交
8683
     * @tc.desc    Function test
8684
     * @tc.level   3
J
jiyong 已提交
8685
     */
Y
yang-qibo 已提交
8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10400: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var Capacity = data.getRawDataCapacity()
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10400:run Capacityis is " + Capacity);
                expect(Capacity).assertEqual(128*M);
                var token = [2,1,4,3,129] ;
                var result = data.writeRawData(token, 149000000);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10400:run writeRawDatais is " + result);
                expect(result == false).assertTrue();
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10400:error = " + error);
            }
Y
yang-qibo 已提交
8706

Y
yang-qibo 已提交
8707 8708
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10400---------------------------");
        });
J
jiyong 已提交
8709

Y
yang-qibo 已提交
8710
        /*
Z
zhangpa2021 已提交
8711
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10500
Y
yang-qibo 已提交
8712
     * @tc.name    Illegal value passed in from writerawdata interface
J
jiyong 已提交
8713
     * @tc.desc    Function test
8714
     * @tc.level   3
J
jiyong 已提交
8715
     */
Y
yang-qibo 已提交
8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10500---------------------------");
            try{
                let parcel = new rpc.MessageParcel();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500: create object successfully.");
                let reply = new rpc.MessageParcel();
                let option = new rpc.MessageOption();
                let arr = [1, 2, 3, 4, 5];
                expect(parcel.writeInt(arr.length)).assertTrue();
                let isWriteSuccess = parcel.writeRawData(arr, arr.length);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500: parcel write raw data result is : " + isWriteSuccess);
                expect(isWriteSuccess).assertTrue();
                let Capacity = parcel.getRawDataCapacity()
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500:run Capacity success, Capacity is " + Capacity);
                expect(Capacity).assertEqual(128*M);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_RAWDATA, parcel, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let size = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500:run readIntis is " + size);
                    expect(size).assertEqual(arr.length);
                    let reCapacity = parcel.getRawDataCapacity()
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500:run Capacity is " + reCapacity);
                    expect(reCapacity).assertEqual(128*M);
                    let newReadResult = result.reply.readRawData(size);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500:run readRawDatais " + newReadResult);
                    assertArrayElementEqual(newReadResult,arr);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10500:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10500---------------------------");
        });
J
jiyong 已提交
8755

Y
yang-qibo 已提交
8756
        /*
Z
zhangpa2021 已提交
8757
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10600
Y
yang-qibo 已提交
8758 8759
    * @tc.name    Test messageParcel to deliver abnormal RawData data
    * @tc.desc    Function test
8760
    * @tc.level   3
Y
yang-qibo 已提交
8761
    */
Y
yang-qibo 已提交
8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10600---------------------------");
            try{
                let parcel = new rpc.MessageParcel();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600: create object successfully.");
                let reply = new rpc.MessageParcel();
                let option = new rpc.MessageOption();
                let arr = [1, 2, 3, 4, 5];
                expect(parcel.writeInt(arr.length + 1)).assertTrue();
                let isWriteSuccess = parcel.writeRawData(arr, (arr.length + 1));
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600: parcel write raw data result is : " + isWriteSuccess);
                expect(isWriteSuccess).assertTrue();
                let Capacity = parcel.getRawDataCapacity()
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600:run Capacity success, Capacity is " + Capacity);
                expect(Capacity).assertEqual(128*M);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_RAWDATA, parcel, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600: result is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let size = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600:run readIntis is " + size);
                    expect(size).assertEqual(arr.length + 1);
                    let reCapacity = parcel.getRawDataCapacity()
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600:run Capacity is " + reCapacity);
                    expect(reCapacity).assertEqual(128*M);
                    let newReadResult = result.reply.readRawData(size);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600:run readRawDatais " + newReadResult);
                    expect(arr[0]).assertEqual(newReadResult[0]);
                    expect(arr[1]).assertEqual(newReadResult[1]);
                    expect(arr[2]).assertEqual(newReadResult[2]);
                    expect(arr[3]).assertEqual(newReadResult[3]);
                    expect(arr[4]).assertEqual(newReadResult[4]);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10600:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10600---------------------------");
        });
J
jiyong 已提交
8805

Y
yang-qibo 已提交
8806
        /*
Z
zhangpa2021 已提交
8807
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10700
Y
yang-qibo 已提交
8808 8809
    * @tc.name    Test messageParcel to deliver abnormal RawData data
    * @tc.desc    Function test
8810
    * @tc.level   3
Y
yang-qibo 已提交
8811
    */
Y
yang-qibo 已提交
8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10700---------------------------");
            try{
                let parcel = new rpc.MessageParcel();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700: create object successfully.");
                let reply = new rpc.MessageParcel();
                let option = new rpc.MessageOption();
                let arr = [1, 2, 3, 4, 5];
                expect(parcel.writeInt(arr.length-1)).assertTrue();
                let isWriteSuccess = parcel.writeRawData(arr, (arr.length - 1));
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700: parcel write raw data result is : " + isWriteSuccess);
                expect(isWriteSuccess).assertTrue();
                let Capacity = parcel.getRawDataCapacity()
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700:run Capacity success, Capacity is " + Capacity);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_RAWDATA, parcel, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700: result is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let size = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700:run readIntis is " + size);
                    expect(size).assertEqual(arr.length - 1);
                    let reCapacity = parcel.getRawDataCapacity()
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700:run Capacity success, Capacity is " + reCapacity);
                    expect(reCapacity).assertEqual(128*M);
                    let newReadResult = result.reply.readRawData(size);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700:run readRawDatais is " + newReadResult);
                    expect(arr[0]).assertEqual(newReadResult[0]);
                    expect(arr[1]).assertEqual(newReadResult[1]);
                    expect(arr[2]).assertEqual(newReadResult[2]);
                    expect(arr[3]).assertEqual(newReadResult[3]);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10700:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10700---------------------------");
        });
J
jiyong 已提交
8853

Y
yang-qibo 已提交
8854
        /*
Z
zhangpa2021 已提交
8855
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10800
Y
yang-qibo 已提交
8856 8857
    * @tc.name    Test messageParcel to deliver out-of-bounds RawData data
    * @tc.desc    Function test
8858
    * @tc.level   3
Y
yang-qibo 已提交
8859
    */
Y
yang-qibo 已提交
8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10800---------------------------");
            try{
                let parcel = new rpc.MessageParcel();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800: create object successfully.");
                let reply = new rpc.MessageParcel();
                let option = new rpc.MessageOption();
                let arr = [-129, 2, 3, 4, 128];
                expect(parcel.writeInt(arr.length)).assertTrue();
                let isWriteSuccess = parcel.writeRawData(arr, arr.length);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800: parcel write raw data result is : " + isWriteSuccess);
                expect(isWriteSuccess).assertTrue();
                let Capacity = parcel.getRawDataCapacity()
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800:run Capacity success, Capacity is " + Capacity);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_RAWDATA, parcel, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800: result is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let size = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800:run readIntis is " + size);
                    expect(size).assertEqual(arr.length);
                    let reCapacity = parcel.getRawDataCapacity()
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800:run Capacity is " + reCapacity);
                    expect(reCapacity).assertEqual(128*M);
                    let newReadResult = result.reply.readRawData(size);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800:run readRawDatais is " + newReadResult);
                    assertArrayElementEqual(newReadResult,arr);
                });
                parcel.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10800:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10800---------------------------");
        });
Y
yang-qibo 已提交
8898

Y
yang-qibo 已提交
8899
        /*
Z
zhangpa2021 已提交
8900
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_10900
Y
yang-qibo 已提交
8901 8902
    * @tc.name    Test messageParcel to deliver illegal RawData data
    * @tc.desc    Function test
8903
    * @tc.level   3
Y
yang-qibo 已提交
8904
    */
Y
yang-qibo 已提交
8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_10900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_10900---------------------------");
            try{
                let parcel = new rpc.MessageParcel();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10900: create object successfully.");
                let reply = new rpc.MessageParcel();
                let option = new rpc.MessageOption();
                let arr = ["aaa", 1, 2, 3];
                expect(parcel.writeInt(arr.length)).assertTrue();
                let isWriteSuccess = parcel.writeRawData(arr, arr.length);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10900: parcel write raw data result is : " + isWriteSuccess);
                expect(isWriteSuccess).assertTrue();
                let reCapacity = parcel.getRawDataCapacity()
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10900:run Capacity success, Capacity is " + reCapacity);
                expect(reCapacity).assertEqual(128*M);
                parcel.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_10900:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_10900---------------------------");
        });
Y
yang-qibo 已提交
8927

Y
yang-qibo 已提交
8928
        /*
Z
zhangpa2021 已提交
8929
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11000
Y
yang-qibo 已提交
8930 8931 8932 8933
     * @tc.name    Call the writeremoteobject interface to serialize the remote object
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11000", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11000: create object successfully.");

                let testRemoteObject = new TestRemoteObject("testObject");
                var result = data.writeRemoteObject(testRemoteObject);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11000: result is " + result);
                expect(result == true).assertTrue();
                data.readRemoteObject()
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11000:error = " + error);
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11000---------------------------");
        });
8951

Y
yang-qibo 已提交
8952
        /*
Z
zhangpa2021 已提交
8953
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11100
Y
yang-qibo 已提交
8954 8955
     * @tc.name    Call the writeremoteobject interface to serialize the remote object and pass in the empty object
     * @tc.desc    Function test
8956
     * @tc.level   3
Y
yang-qibo 已提交
8957
     */
Y
yang-qibo 已提交
8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11100: create object successfully.");

                var token = {}
                var result = data.writeRemoteObject(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11100: result is " + result);
                expect(result == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11100:error = " + error);
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11100---------------------------");
        });
Y
yang-qibo 已提交
8974

Y
yang-qibo 已提交
8975
        /*
Z
zhangpa2021 已提交
8976
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11200
8977
     * @tc.name    Call the writeSequenceable interface to write the custom serialized
Y
yang-qibo 已提交
8978
     *             object to the messageparcel instance
J
jiyong 已提交
8979 8980 8981
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11200", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11200: create object successfully.");
                let sequenceable = new MySequenceable(1, "aaa");
                let result = data.writeSequenceable(sequenceable);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11200: writeSequenceable is " + result);
                expect(result == true).assertTrue();
                let ret = new MySequenceable(0, "");
                let result2 = data.readSequenceable(ret);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11200: readSequenceable is " + result2);
                expect(result2 == true).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11200:error = " + error);
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11200---------------------------");
        });
J
jiyong 已提交
9001

Y
yang-qibo 已提交
9002
        /*
Z
zhangpa2021 已提交
9003
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11300
Y
yang-qibo 已提交
9004 9005
     * @tc.name    After the server finishes processing, write noexception first before writing the result,
     *             and the client calls readexception to judge whether the server is abnormal
J
jiyong 已提交
9006 9007 9008
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
9009 9010 9011 9012 9013 9014 9015 9016 9017 9018
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11300: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                data.writeNoException();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11300: run writeNoException success");
                expect(data.writeInt(6) == true).assertTrue();
Y
yang-qibo 已提交
9019

Y
yang-qibo 已提交
9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11300: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_NOEXCEPTION, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11300: sendRequestis is " + result.errCode);
                    result.reply.readException()
                    var replyData = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11300: readResult is " + replyData);
                    expect(replyData == 6).assertTrue();
                });
9031

Y
yang-qibo 已提交
9032 9033 9034 9035 9036 9037 9038 9039
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11300:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11300---------------------------");
        });
J
jiyong 已提交
9040

Y
yang-qibo 已提交
9041
        /*
Z
zhangpa2021 已提交
9042
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11400
Y
yang-qibo 已提交
9043 9044
     * @tc.name    If the data on the server is abnormal, the client calls readexception
     *             to judge whether the server is abnormal
J
jiyong 已提交
9045
     * @tc.desc    Function test
9046
     * @tc.level   3
J
jiyong 已提交
9047
     */
Y
yang-qibo 已提交
9048 9049 9050 9051 9052 9053 9054 9055 9056 9057
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11400---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11400: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                data.writeNoException();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11400: run writeNoException success");
                expect(data.writeInt(1232222223444) == true).assertTrue();
Z
zhangpa2021 已提交
9058

Y
yang-qibo 已提交
9059 9060 9061 9062 9063 9064 9065 9066 9067 9068
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11400: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_NOEXCEPTION, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11400: sendRequestis is " + result.errCode);
                    result.reply.readException()
                    var replyData = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11400: readResult is " + replyData);
                });
9069

Y
yang-qibo 已提交
9070 9071 9072 9073 9074 9075 9076 9077
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11400:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11400---------------------------");
        });
J
jiyong 已提交
9078

Y
yang-qibo 已提交
9079
        /*
Z
zhangpa2021 已提交
9080
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11500
Y
yang-qibo 已提交
9081
     * @tc.name    Serializable object marshaling and unmarshalling test
J
jiyong 已提交
9082
     * @tc.desc    Function test
9083
     * @tc.level   3
J
jiyong 已提交
9084
     */
Y
yang-qibo 已提交
9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11500: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var sequenceable = new MySequenceable(1, "aaa");
                var result = data.writeSequenceable(sequenceable);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11500: writeSequenceable is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11500: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_SEQUENCEABLE, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11500: sendRequestis is " + result.errCode);
                    var s = new MySequenceable(null,null)
                    var resultReply = result.reply.readSequenceable(s);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11500: run readSequenceable is " + resultReply);
                    expect(resultReply == true).assertTrue();
                    expect(s.str == sequenceable.str).assertTrue();
                    expect(s.num == sequenceable.num).assertTrue();
                });
Y
yang-qibo 已提交
9109

Y
yang-qibo 已提交
9110 9111 9112 9113 9114 9115
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11500:error = " + error);
            }
Z
zhangpa2021 已提交
9116

Y
yang-qibo 已提交
9117 9118
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11500---------------------------");
        });
Y
yang-qibo 已提交
9119

Y
yang-qibo 已提交
9120
        /*
Z
zhangpa2021 已提交
9121
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11600
Y
yang-qibo 已提交
9122 9123
     * @tc.name    Non serializable object marshaling test
     * @tc.desc    Function test
9124
     * @tc.level   3
Y
yang-qibo 已提交
9125
     */
Y
yang-qibo 已提交
9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11600: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var sequenceable = new MySequenceable(1, "aaa");
                var result = data.writeSequenceable(sequenceable);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11600: writeSequenceable is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11600: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_SEQUENCEABLE, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11600: sendRequestis is " + result.errCode);
                    var s = new MySequenceable(null,null)
                    var replyReadResult = reply.readSequenceable(s);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11600: run readSequenceable is " + replyReadResult);
                    expect(replyReadResult == true).assertTrue();
                    expect(s.str == sequenceable.str).assertTrue();
                    expect(s.num == sequenceable.num).assertTrue();
                });
Y
yang-qibo 已提交
9150

Y
yang-qibo 已提交
9151 9152 9153 9154 9155 9156 9157 9158
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11600:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11600---------------------------");
        });
Y
yang-qibo 已提交
9159

Y
yang-qibo 已提交
9160
        /*
Z
zhangpa2021 已提交
9161
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11700
Y
yang-qibo 已提交
9162 9163
     * @tc.name    The server did not send a serializable object, and the client was ungrouped
     * @tc.desc    Function test
9164
     * @tc.level   3
Y
yang-qibo 已提交
9165
     */
Y
yang-qibo 已提交
9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11700", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11700: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var sequenceable = 10;
                var result = data.writeInt(sequenceable);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11700 writeInt is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11700: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11700: sendRequestis is " + result.errCode);
                    var s = new MySequenceable(0,null)
                    var replyReadResult = result.reply.readSequenceable(s);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11700: run readSequenceable is" + replyReadResult);
                });
Y
yang-qibo 已提交
9187

Y
yang-qibo 已提交
9188 9189 9190 9191 9192 9193
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11700:error = " + error);
            }
Y
yang-qibo 已提交
9194

Y
yang-qibo 已提交
9195 9196
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11700---------------------------");
        });
Y
yang-qibo 已提交
9197

Y
yang-qibo 已提交
9198
        /*
Z
zhangpa2021 已提交
9199
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11800
9200 9201
     * @tc.name    Call the writeSequenceable interface to write the custom serialized object to the
     *             messageparcel instance, and call readSequenceable to read the data
Y
yang-qibo 已提交
9202
     * @tc.desc    Function test
9203
     * @tc.level   3
Y
yang-qibo 已提交
9204
     */
Y
yang-qibo 已提交
9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11800: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var sequenceable = new MySequenceable(2, "abc");
                var result = data.writeSequenceable(sequenceable);
                console.info("RpcClient: writeSequenceable is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11800: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_SEQUENCEABLE, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11800: sendRequestis is " + result.errCode);
                    var s = new MySequenceable(null,null)
                    var replyReadResult = result.reply.readSequenceable(s);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11800: run readSequenceable is" + replyReadResult);
                    expect(s.str == sequenceable.str).assertTrue();
                    expect(s.num == sequenceable.num).assertTrue();
                });
Y
yang-qibo 已提交
9228

Y
yang-qibo 已提交
9229 9230 9231 9232 9233 9234
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11800:error = " + error);
            }
Y
yang-qibo 已提交
9235

Y
yang-qibo 已提交
9236 9237
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11800---------------------------");
        });
Y
yang-qibo 已提交
9238

Y
yang-qibo 已提交
9239
        /*
Z
zhangpa2021 已提交
9240
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_11900
9241 9242
     * @tc.name    Call the writeSequenceablearray interface to write the custom serialized object to the
     *             messageparcel instance, and call readSequenceablearray to read the data
Y
yang-qibo 已提交
9243 9244 9245
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_11900", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11900---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11900: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var sequenceable = [new MySequenceable(1, "aaa"),
                    new MySequenceable(2, "bbb"), new MySequenceable(3, "ccc")];
                var result = data.writeSequenceableArray(sequenceable);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11900: writeSequenceableArray is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11900: gIRemoteObject is undefined");
Y
yang-qibo 已提交
9261
                }
Y
yang-qibo 已提交
9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272
                await gIRemoteObject.sendRequest(CODE_WRITE_SEQUENCEABLEARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11900: sendRequestis is " + result.errCode);
                    var s = [new MySequenceable(null, null), new MySequenceable(null, null),
                        new MySequenceable(null, null)];
                    result.reply.readSequenceableArray(s);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11900: run readSequenceableArray is" + s);
                    for (let i = 0; i < s.length; i++) {
                        expect(s[i].str).assertEqual(sequenceable[i].str)
                        expect(s[i].num).assertEqual(sequenceable[i].num)
                    }
                });
Y
yang-qibo 已提交
9273

Y
yang-qibo 已提交
9274 9275 9276 9277 9278 9279
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_11900:error = " + error);
            }
Y
yang-qibo 已提交
9280

Y
yang-qibo 已提交
9281 9282
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_11900---------------------------");
        });
Y
yang-qibo 已提交
9283

Y
yang-qibo 已提交
9284
        /*
Z
zhangpa2021 已提交
9285
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12000
9286 9287
     * @tc.name    Call the writeSequenceablearray interface to write the custom serialized object to the
     *             messageparcel instance, and call readSequenceablearray to read the data
Y
yang-qibo 已提交
9288
     * @tc.desc    Function test
9289
     * @tc.level   3
Y
yang-qibo 已提交
9290
     */
Y
yang-qibo 已提交
9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12000", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12000---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12000: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                var sequenceable = [new MySequenceable(4, "abc"),
                    new MySequenceable(5, "bcd"), new MySequenceable(6, "cef")];
                var result = data.writeSequenceableArray(sequenceable);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12000: writeSequenceable is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12000: gIRemoteObject is undefined");
Y
yang-qibo 已提交
9306
                }
Y
yang-qibo 已提交
9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317
                await gIRemoteObject.sendRequest(CODE_WRITE_SEQUENCEABLEARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12000: sendRequestis is " + result.errCode);
                    var s = [new MySequenceable(null, null),
                        new MySequenceable(null, null), new MySequenceable(null, null)]
                    result.reply.readSequenceableArray(s);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12000: run readSequenceableArray is" +s);
                    for (let i = 0; i < s.length; i++) {
                        expect(s[i].str).assertEqual(sequenceable[i].str)
                        expect(s[i].num).assertEqual(sequenceable[i].num)
                    }
                });
Y
yang-qibo 已提交
9318

Y
yang-qibo 已提交
9319 9320 9321 9322 9323 9324
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12000:error = " + error);
            }
Y
yang-qibo 已提交
9325

Y
yang-qibo 已提交
9326 9327
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12000---------------------------");
        });
Y
yang-qibo 已提交
9328

Y
yang-qibo 已提交
9329
        /*
Z
zhangpa2021 已提交
9330
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12100
9331
     * @tc.name    Call the writeSequenceablearray interface to write the custom
Y
yang-qibo 已提交
9332 9333
     *             serialized object to the messageparcel instance
     * @tc.desc    Function test
9334
     * @tc.level   3
Y
yang-qibo 已提交
9335
     */
Y
yang-qibo 已提交
9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12100---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12100: create object successfully.");
                var sequenceable = 1;
                var result = data.writeSequenceableArray(sequenceable);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12100: writeSequenceable is " + result);
                expect(result == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12100:error = " + error);
                expect(error != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12100---------------------------");
        });
Y
yang-qibo 已提交
9352

Y
yang-qibo 已提交
9353
        /*
Z
zhangpa2021 已提交
9354
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12200
Y
yang-qibo 已提交
9355 9356 9357 9358 9359
     * @tc.name    Call the writeremoteobjectarray interface to write the object array to the messageparcel
     *             instance, and call readremoteobjectarray to read the data
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
9360 9361 9362 9363 9364
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12200---------------------------");
            try{
                let count = 0
                function checkResult(num, str) {
9365 9366
                    expect(num).assertEqual(123);
                    expect(str).assertEqual("rpcListenerTest");
Y
yang-qibo 已提交
9367
                    count++;
9368
                    console.info("check result done, count: " + count);
Y
yang-qibo 已提交
9369
                    if (count == 3) {
9370
                        done();
Y
yang-qibo 已提交
9371
                    }
9372
                }
Y
yang-qibo 已提交
9373 9374 9375 9376 9377
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();

9378
                expect(data.writeInterfaceToken("rpcTestAbility")).assertTrue();
Y
yang-qibo 已提交
9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395
                var listeners = [new TestListener("rpcListener", checkResult),
                    new TestListener("rpcListener2", checkResult),
                    new TestListener("rpcListener3", checkResult)];
                var result = data.writeRemoteObjectArray(listeners);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200: writeRemoteObjectArray is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200: sendRequestis is " + result.errCode);
                    expect(result.errCode).assertEqual(0);
                    expect(result.code).assertEqual(CODE_WRITE_REMOTEOBJECTARRAY);
                    expect(result.data).assertEqual(data);
                    expect(result.reply).assertEqual(reply);
                });
9396

Y
yang-qibo 已提交
9397 9398 9399 9400 9401 9402
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12200:error = " + error);
            }
9403

Y
yang-qibo 已提交
9404 9405
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12200---------------------------");
        });
Y
yang-qibo 已提交
9406

Y
yang-qibo 已提交
9407
        /*
Z
zhangpa2021 已提交
9408
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12300
Y
yang-qibo 已提交
9409 9410 9411
     * @tc.name    Call the writeremoteobjectarray interface to write the object array to the messageparcel instance,
     *             and call readremoteobjectarray (objects: iremoteobject []) to read the data
     * @tc.desc    Function test
9412
     * @tc.level   3
Y
yang-qibo 已提交
9413
     */
Y
yang-qibo 已提交
9414 9415 9416
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12300---------------------------");
            try{
9417
                let count = 0;
Y
yang-qibo 已提交
9418
                function checkResult(num, str) {
9419 9420
                    expect(num).assertEqual(123);
                    expect(str).assertEqual("rpcListenerTest");
Y
yang-qibo 已提交
9421
                    count++;
9422
                    console.info("check result done, count: " + count);
Y
yang-qibo 已提交
9423
                    if (count == 3) {
9424
                        done();
Y
yang-qibo 已提交
9425
                    }
9426
                }
Y
yang-qibo 已提交
9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12300: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                expect(data.writeInterfaceToken("rpcTestAbility")).assertTrue()
                var listeners = [new TestListener("rpcListener", checkResult),
                    new TestListener("rpcListener2", checkResult),
                    new TestListener("rpcListener3", checkResult)];
                var result = data.writeRemoteObjectArray(listeners);
                console.info("RpcClient: writeRemoteObjectArray is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12300: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12300: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                });
9446

Y
yang-qibo 已提交
9447 9448 9449 9450 9451 9452 9453 9454
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12300:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12300---------------------------");
        });
Y
yang-qibo 已提交
9455

Y
yang-qibo 已提交
9456
        /*
Z
zhangpa2021 已提交
9457
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12400
Y
yang-qibo 已提交
9458 9459 9460 9461
     * @tc.name    Test messageparcel delivery file descriptor object
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
9462 9463
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12400", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12400---------------------------");
9464
            let context = FA.getContext();
Y
yang-qibo 已提交
9465 9466
            await context.getFilesDir()
                .then(async function(path) {
9467
                    expect(path != null).assertTrue();
Y
yang-qibo 已提交
9468 9469 9470
                    let basePath = path;
                    let filePath = basePath + "/test1.txt";
                    let fd = fileio.openSync(filePath, 0o2| 0o100 | 0o2000, 0o666);
9471 9472
                    expect(fd >= 0).assertTrue();
                    let str = "HELLO RPC";
Y
yang-qibo 已提交
9473
                    let bytesWr = fileio.writeSync(fd, str);
9474 9475 9476 9477 9478 9479
                    let option = new rpc.MessageOption();
                    let data = rpc.MessageParcel.create();
                    let reply = rpc.MessageParcel.create();
                    let result = data.containFileDescriptors();
                    let writeInt = data.writeInt(bytesWr);
                    expect(writeInt == true).assertTrue();
Y
yang-qibo 已提交
9480
                    let writeFileDescriptor = data.writeFileDescriptor(fd)
9481 9482 9483
                    expect(writeFileDescriptor == true).assertTrue();
                    let result1 = data.containFileDescriptors();
                    expect(data.containFileDescriptors()).assertTrue();
Y
yang-qibo 已提交
9484 9485
                    await gIRemoteObject.sendRequest(CODE_FILESDIR, data, reply, option)
                        .then(function(result) {
9486
                            expect(result.errCode).assertEqual(0);
Y
yang-qibo 已提交
9487 9488
                            let buf = new ArrayBuffer(str.length * 2);
                            let bytesRd = fileio.readSync(fd, buf, {position:0,});
9489
                            let fdResult = reply.readFileDescriptor();
Y
yang-qibo 已提交
9490
                            let content = String.fromCharCode.apply(null, new Uint8Array(buf));
9491
                            expect(content).assertEqual(str + str);
Y
yang-qibo 已提交
9492 9493 9494 9495 9496
                            let dupFd = rpc.MessageParcel.dupFileDescriptor(fd);
                            let buf2 = new ArrayBuffer(str.length * 2);
                            let byteRd2 = fileio.readSync(dupFd, buf2, {position:0,});
                            let content2 = String.fromCharCode.apply(null, new Uint8Array(buf2));
                            console.info("dupFd bytes read: " + byteRd2 + ", content2: " + content2);
9497
                            expect(content2).assertEqual(str + str);
Y
yang-qibo 已提交
9498 9499 9500 9501
                            rpc.MessageParcel.closeFileDescriptor(fd);
                            rpc.MessageParcel.closeFileDescriptor(dupFd);
                        })
                    try {
9502 9503 9504
                        console.info("after close fd, write again");
                        fileio.writeSync(fd, str);
                        expect(0).assertEqual(1);
Y
yang-qibo 已提交
9505
                    } catch(e) {
9506
                        console.error("got exception: " + e);
Y
yang-qibo 已提交
9507 9508 9509 9510 9511
                    }
                })
            done()
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12400---------------------------");
        });
Y
yang-qibo 已提交
9512

Y
yang-qibo 已提交
9513
        /*
Z
zhangpa2021 已提交
9514
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12500
Y
yang-qibo 已提交
9515 9516
     * @tc.name    Test messageparcel to deliver the reply message received in promise across processes
     * @tc.desc    Function test
9517
     * @tc.level   3
Y
yang-qibo 已提交
9518
     */
Y
yang-qibo 已提交
9519 9520 9521 9522 9523 9524 9525
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12500", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12500: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
9526 9527 9528 9529 9530 9531 9532 9533 9534 9535
                expect(data.writeByte(2)).assertTrue();
                expect(data.writeShort(3)).assertTrue();
                expect(data.writeInt(4)).assertTrue();
                expect(data.writeLong(5)).assertTrue();
                expect(data.writeFloat(1.2)).assertTrue();
                expect(data.writeDouble(10.2)).assertTrue();
                expect(data.writeBoolean(true)).assertTrue();
                expect(data.writeChar(5)).assertTrue();
                expect(data.writeString("HelloWorld")).assertTrue();
                expect(data.writeSequenceable(new MySequenceable(1, "aaa"))).assertTrue();
Y
yang-qibo 已提交
9536 9537

                await gIRemoteObject.sendRequest(CODE_ALL_TYPE, data, reply, option).then((result) => {
9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552
                    console.info("sendRequest done, error code: " + result.errCode);
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readByte()).assertEqual(2);
                    expect(result.reply.readShort()).assertEqual(3);
                    expect(result.reply.readInt()).assertEqual(4);
                    expect(result.reply.readLong()).assertEqual(5);
                    expect(result.reply.readFloat()).assertEqual(1.2);
                    expect(result.reply.readDouble()).assertEqual(10.2);
                    expect(result.reply.readBoolean()).assertTrue();
                    expect(result.reply.readChar()).assertEqual(5);
                    expect(result.reply.readString()).assertEqual("HelloWorld");
                    let s = new MySequenceable(null, null);
                    expect(result.reply.readSequenceable(s)).assertTrue();
                    expect(s.num).assertEqual(1);
                    expect(s.str).assertEqual("aaa");
Y
yang-qibo 已提交
9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12500:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12500---------------------------");
        });

        /*
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12600
     * @tc.name    Test the cross process delivery of messageparcel and receive the reply message
     *             in the callback function
     * @tc.desc    Function test
9568
     * @tc.level   3
Y
yang-qibo 已提交
9569 9570 9571 9572 9573 9574 9575 9576 9577
     */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12600---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12600: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();

9578 9579 9580 9581 9582 9583 9584 9585 9586 9587
                expect(data.writeByte(2)).assertTrue();
                expect(data.writeShort(3)).assertTrue();
                expect(data.writeInt(4)).assertTrue();
                expect(data.writeLong(5)).assertTrue();
                expect(data.writeFloat(1.2)).assertTrue();
                expect(data.writeDouble(10.2)).assertTrue();
                expect(data.writeBoolean(true)).assertTrue();
                expect(data.writeChar(5)).assertTrue();
                expect(data.writeString("HelloWorld")).assertTrue();
                expect(data.writeSequenceable(new MySequenceable(1, "aaa"))).assertTrue();
Y
yang-qibo 已提交
9588 9589 9590

                function sendRequestCallback(result) {
                    try{
9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606
                        console.info("sendRequest Callback");
                        console.info("sendRequest done, error code: " + result.errCode);
                        expect(result.errCode).assertEqual(0);
                        expect(result.reply.readByte()).assertEqual(2);
                        expect(result.reply.readShort()).assertEqual(3);
                        expect(result.reply.readInt()).assertEqual(4);
                        expect(result.reply.readLong()).assertEqual(5);
                        expect(result.reply.readFloat()).assertEqual(1.2);
                        expect(result.reply.readDouble()).assertEqual(10.2);
                        expect(result.reply.readBoolean()).assertTrue();
                        expect(result.reply.readChar()).assertEqual(5);
                        expect(result.reply.readString()).assertEqual("HelloWorld");
                        let s = new MySequenceable(null, null);
                        expect(result.reply.readSequenceable(s)).assertTrue();
                        expect(s.num).assertEqual(1);
                        expect(s.str).assertEqual("aaa");
Y
yang-qibo 已提交
9607 9608 9609
                    } finally {
                        result.data.reclaim();
                        result.reply.reclaim();
9610 9611
                        console.info("test done");
                        done();
Y
yang-qibo 已提交
9612
                    }
Z
zhangpa2021 已提交
9613 9614
                }

9615 9616
                console.info("start send request");
                await gIRemoteObject.sendRequest(CODE_ALL_TYPE, data, reply, option, sendRequestCallback);
Y
yang-qibo 已提交
9617 9618 9619 9620 9621 9622

            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12600:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12600---------------------------");
        });
Y
yang-qibo 已提交
9623

Y
yang-qibo 已提交
9624
        /*
Z
zhangpa2021 已提交
9625
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12700
Y
yang-qibo 已提交
9626 9627 9628
     * @tc.name    Test the cross process transmission of messageparcel.
     *             After receiving the reply message in promise, read various types of arrays in order
     * @tc.desc    Function test
9629
     * @tc.level   3
Y
yang-qibo 已提交
9630
     */
Y
yang-qibo 已提交
9631 9632 9633 9634 9635 9636 9637 9638
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12700", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12700: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                expect(data.writeByteArray([1, 2, 3])).assertTrue();
9639 9640 9641 9642 9643 9644 9645 9646
                expect(data.writeShortArray([4, 5, 6])).assertTrue();
                expect(data.writeIntArray([7, 8, 9])).assertTrue();
                expect(data.writeLongArray([10, 11, 12])).assertTrue();
                expect(data.writeFloatArray([1.1, 1.2, 1.3])).assertTrue();
                expect(data.writeDoubleArray([2.1, 2.2, 2.3])).assertTrue();
                expect(data.writeBooleanArray([true, true, false])).assertTrue();
                expect(data.writeCharArray([10, 20, 30])).assertTrue();
                expect(data.writeStringArray(['abc', 'seggg'])).assertTrue();
Y
yang-qibo 已提交
9647
                let a = [new MySequenceable(1, "aaa"), new MySequenceable(2, "bbb"),
9648 9649
                    new MySequenceable(3, "ccc")];
                expect(data.writeSequenceableArray(a)).assertTrue();
Y
yang-qibo 已提交
9650
                gIRemoteObject.sendRequest(CODE_ALL_ARRAY_TYPE, data, reply, option,(err, result) => {
9651 9652 9653 9654 9655 9656 9657 9658 9659 9660
                    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']);
Y
yang-qibo 已提交
9661
                    let b = [new MySequenceable(null, null), new MySequenceable(null, null),
9662 9663
                        new MySequenceable(null, null)];
                    result.reply.readSequenceableArray(b);
Y
yang-qibo 已提交
9664
                    for (let i = 0; i < b.length; i++) {
9665 9666
                        expect(b[i].str).assertEqual(a[i].str);
                        expect(b[i].num).assertEqual(a[i].num);
Y
yang-qibo 已提交
9667 9668 9669 9670 9671 9672 9673 9674
                    }
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12700:error = " + error);
            }
9675
            sleep(2000);
Y
yang-qibo 已提交
9676 9677
            data.reclaim();
            reply.reclaim();
Y
yang-qibo 已提交
9678 9679
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12700---------------------------");
        });
Y
yang-qibo 已提交
9680

Y
yang-qibo 已提交
9681
        /*
Z
zhangpa2021 已提交
9682
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12800
Y
yang-qibo 已提交
9683 9684 9685 9686
     * @tc.name    Test messageparcel cross process delivery. After receiving the reply message in promise,
     *             the client constructs an empty array in sequence and reads the data from the reply message
     *             into the corresponding array
     * @tc.desc    Function test
9687
     * @tc.level   3
Y
yang-qibo 已提交
9688
     */
Y
yang-qibo 已提交
9689 9690 9691 9692 9693 9694 9695 9696
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12800---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12800: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                expect(data.writeByteArray([1, 2, 3])).assertTrue();
9697 9698 9699 9700 9701 9702 9703 9704
                expect(data.writeShortArray([4, 5, 6])).assertTrue();
                expect(data.writeIntArray([7, 8, 9])).assertTrue();
                expect(data.writeLongArray([10, 11, 12])).assertTrue();
                expect(data.writeFloatArray([1.1, 1.2, 1.3])).assertTrue();
                expect(data.writeDoubleArray([2.1, 2.2, 2.3])).assertTrue();
                expect(data.writeBooleanArray([true, true, false])).assertTrue();
                expect(data.writeCharArray([10, 20, 30])).assertTrue();
                expect(data.writeStringArray(['abc', 'seggg'])).assertTrue();
Y
yang-qibo 已提交
9705
                let a = [new MySequenceable(1, "aaa"), new MySequenceable(2, "bbb"),
9706 9707
                    new MySequenceable(3, "ccc")];
                expect(data.writeSequenceableArray(a)).assertTrue();
Y
yang-qibo 已提交
9708
                gIRemoteObject.sendRequest(CODE_ALL_ARRAY_TYPE, data, reply, option).then((result) => {
9709 9710 9711 9712 9713 9714 9715 9716 9717 9718
                    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']);
Y
yang-qibo 已提交
9719
                    let b = [new MySequenceable(null, null), new MySequenceable(null, null),
9720 9721
                        new MySequenceable(null, null)];
                    result.reply.readSequenceableArray(b);
Y
yang-qibo 已提交
9722
                    for (let i = 0; i < b.length; i++) {
9723 9724 9725
                        expect(b[i].str).assertEqual(a[i].str);
                        expect(b[i].num).assertEqual(a[i].num);
                    };
Y
yang-qibo 已提交
9726 9727 9728 9729 9730 9731 9732
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12800:error = " + error);
            }
9733
            sleep(2000);
Y
yang-qibo 已提交
9734 9735
            data.reclaim();
            reply.reclaim();
Y
yang-qibo 已提交
9736 9737
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12800---------------------------");
        });
Y
yang-qibo 已提交
9738

Y
yang-qibo 已提交
9739
        /*
Z
zhangpa2021 已提交
9740
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_12900
Y
yang-qibo 已提交
9741 9742
     * @tc.name    Test messageparcel to pass an object of type iremoteobject across processes
     * @tc.desc    Function test
9743
     * @tc.level   3
Y
yang-qibo 已提交
9744
     */
Y
yang-qibo 已提交
9745 9746 9747
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_12900", 0, async function(done) {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_12900---------------------------");
            function checkResult(num, str) {
9748 9749 9750
                expect(num).assertEqual(123);
                expect(str).assertEqual("rpcListenerTest");
                done();
Y
yang-qibo 已提交
9751 9752
            }
            try{
9753 9754 9755
                let option = new rpc.MessageOption();
                let data = rpc.MessageParcel.create();
                let reply = rpc.MessageParcel.create();
Y
yang-qibo 已提交
9756

9757 9758 9759 9760 9761 9762
                let listener = new TestListener("rpcListener", checkResult);
                let result = data.writeRemoteObject(listener);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12900 result is:" + result);
                expect(result == true).assertTrue();
                expect(data.writeInt(123)).assertTrue();
                expect(data.writeString("rpcListenerTest")).assertTrue();
Y
yang-qibo 已提交
9763 9764
                await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECT, data, reply, option)
                    .then((result)=> {
9765 9766 9767
                        console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12900 sendRequest done, error code: " + result.errCode);
                        expect(result.errCode).assertEqual(0);
                        result.reply.readException();
Y
yang-qibo 已提交
9768
                    })
9769 9770 9771
                data.reclaim();
                reply.reclaim();
                console.info("test done");
Y
yang-qibo 已提交
9772 9773 9774
            } catch(error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_12900: error = " + error);
            }
Z
zhangpa2021 已提交
9775
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_12900---------------------------");
Y
yang-qibo 已提交
9776
        })
Y
yang-qibo 已提交
9777 9778


Y
yang-qibo 已提交
9779
        /*
Z
zhangpa2021 已提交
9780
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13000
Y
yang-qibo 已提交
9781 9782
     * @tc.name    Test messageparcel to pass an array of iremoteobject objects across processes
     * @tc.desc    Function test
9783
     * @tc.level   3
Y
yang-qibo 已提交
9784
     */
Y
yang-qibo 已提交
9785 9786
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13000", 0, async function(done) {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13000---------------------------");
Y
yang-qibo 已提交
9787

Y
yang-qibo 已提交
9788 9789
            let count = 0;
            function checkResult(num, str) {
9790 9791 9792 9793
                expect(num).assertEqual(123);
                expect(str).assertEqual("rpcListenerTest");
                count++;
                console.info("check result done, count: " + count);
Y
yang-qibo 已提交
9794
                if (count == 3) {
9795
                    done();
Y
yang-qibo 已提交
9796
                }
Y
yang-qibo 已提交
9797
            }
Y
yang-qibo 已提交
9798
            try{
9799 9800 9801
                let option = new rpc.MessageOption();
                let data = rpc.MessageParcel.create();
                let reply = rpc.MessageParcel.create();
Y
yang-qibo 已提交
9802 9803
                let listeners = [new TestListener("rpcListener", checkResult),
                    new TestListener("rpcListener2", checkResult),
9804 9805 9806 9807 9808 9809
                    new TestListener("rpcListener3", checkResult)];
                let result = data.writeRemoteObjectArray(listeners);
                expect(result == true).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13000 result is:" + result);
                expect(data.writeInt(123)).assertTrue();
                expect(data.writeString("rpcListenerTest")).assertTrue();
Y
yang-qibo 已提交
9810 9811
                await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY_1, data, reply, option)
                    .then((result)=> {
9812 9813 9814
                        console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13000 sendRequest done, error code: " + result.errCode);
                        expect(result.errCode).assertEqual(0);
                        result.reply.readException();
Y
yang-qibo 已提交
9815
                    })
Y
yang-qibo 已提交
9816

9817 9818
                data.reclaim();
                reply.reclaim();
9819
                done();
Y
yang-qibo 已提交
9820 9821
            } catch(error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13000: error = " + error);
Y
yang-qibo 已提交
9822
            }
Y
yang-qibo 已提交
9823 9824
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13000---------------------------");
        })
Y
yang-qibo 已提交
9825

Y
yang-qibo 已提交
9826
        /*
Z
zhangpa2021 已提交
9827
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13100
Y
yang-qibo 已提交
9828 9829 9830
     * @tc.name    Test messageparcel to pass the array of iremoteobject objects across processes. The server
     *             constructs an empty array in onremoterequest and reads it from messageparcel
     * @tc.desc    Function test
9831
     * @tc.level   3
Y
yang-qibo 已提交
9832
     */
Y
yang-qibo 已提交
9833 9834 9835 9836
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13100", 0, async function(done) {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13100---------------------------");
            let count = 0;
            function checkResult(num, str) {
9837 9838 9839 9840
                expect(num).assertEqual(123);
                expect(str).assertEqual("rpcListenerTest");
                count++;
                console.info("check result done, count: " + count);
Y
yang-qibo 已提交
9841
                if (count == 3) {
9842
                    done();
Y
yang-qibo 已提交
9843
                }
Y
yang-qibo 已提交
9844
            }
Y
yang-qibo 已提交
9845
            try{
9846 9847 9848
                let option = new rpc.MessageOption();
                let data = rpc.MessageParcel.create();
                let reply = rpc.MessageParcel.create();
Y
yang-qibo 已提交
9849 9850
                let listeners = [new TestListener("rpcListener", checkResult),
                    new TestListener("rpcListener2", checkResult),
9851 9852 9853 9854 9855 9856 9857
                    new TestListener("rpcListener3", checkResult)];
                let result = data.writeRemoteObjectArray(listeners);
                expect(result == true).assertTrue();
                data.readRemoteObjectArray();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13100 result is:" + result);
                expect(data.writeInt(123)).assertTrue();
                expect(data.writeString("rpcListenerTest")).assertTrue();
Y
yang-qibo 已提交
9858 9859
                await gIRemoteObject.sendRequest(CODE_WRITE_REMOTEOBJECTARRAY_2, data, reply, option)
                    .then((result)=> {
9860 9861 9862
                        console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13100 error code: " + result.errCode);
                        expect(result.errCode).assertEqual(0);
                        result.reply.readException();
Y
yang-qibo 已提交
9863
                    })
9864 9865 9866
                data.reclaim();
                reply.reclaim();
                console.info("test done");
Y
yang-qibo 已提交
9867 9868
            } catch(error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13100: error = " + error);
Y
yang-qibo 已提交
9869
            }
9870
            done();
Y
yang-qibo 已提交
9871 9872
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13100---------------------------");
        })
Y
yang-qibo 已提交
9873

Y
yang-qibo 已提交
9874
        /*
9875 9876 9877 9878 9879
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13200
        * @tc.name    Invoke the rewindRead interface, write the POS, and read the offset value
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13200---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13200: create object successfully");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                data.writeInt(12);
                data.writeString("parcel");
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13200: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13200: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let number1 = result.reply.readInt();
                    expect(number1).assertEqual(12);
                    expect(result.reply.rewindRead(0)).assertTrue();
                    let number2 = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13200:run readIntis is " + number1 + ";" + number2);
                    expect(number2).assertEqual(12);

                    let reString = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13200:run readStringis is " + reString);
                    expect(reString).assertEqual("");
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13200:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13200---------------------------");
        });
Y
yang-qibo 已提交
9914

Y
yang-qibo 已提交
9915
        /*
Z
zhangpa2021 已提交
9916
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13300
Y
yang-qibo 已提交
9917 9918
     * @tc.name    Invoke the rewindRead interface, write the POS, and read the offset value
     * @tc.desc    Function test
9919
     * @tc.level   3
Y
yang-qibo 已提交
9920
     */
Y
yang-qibo 已提交
9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13300", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13300---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13300: create object successfully");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                data.writeInt(12);
                data.writeString("parcel");
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13300: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13300: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let number1 = result.reply.readInt();
                    expect(result.reply.rewindRead(1)).assertTrue();
                    let number2 = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13300:run readIntis is " + number1 + ";" + number2);
                    expect(number1).assertEqual(12);
                    expect(number2).assertEqual(0);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13300:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13300---------------------------");
        });
Y
yang-qibo 已提交
9951

Y
yang-qibo 已提交
9952
        /*
Z
zhangpa2021 已提交
9953
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13400
Y
yang-qibo 已提交
9954 9955
     * @tc.name    Invoke the rewindWrite interface, write the POS, and read the offset value
     * @tc.desc    Function test
9956
     * @tc.level   3
Y
yang-qibo 已提交
9957
     */
Y
yang-qibo 已提交
9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_11800---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13400: create object successfully");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                data.writeInt(4);
                data.rewindWrite(0);
                data.writeInt(5);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13400: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13400: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let number = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13400:run readIntis is " + number);
                    expect(number).assertEqual(5);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13400:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13400---------------------------");
        });
Y
yang-qibo 已提交
9986

Y
yang-qibo 已提交
9987
        /*
Z
zhangpa2021 已提交
9988
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13500
Y
yang-qibo 已提交
9989 9990
     * @tc.name    Invoke the rewindWrite interface, write the POS, and read the offset value
     * @tc.desc    Function test
9991
     * @tc.level   3
Y
yang-qibo 已提交
9992
     */
Y
yang-qibo 已提交
9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13500---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13500: create object successfully");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                data.writeInt(4);
                data.rewindWrite(1);
                data.writeInt(5);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13500: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13500: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let number = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13500:run readIntis is " + number);
                    expect(number != 5).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13500:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13500---------------------------");
        });
Y
yang-qibo 已提交
10021

Y
yang-qibo 已提交
10022
        /*
Z
zhangpa2021 已提交
10023
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13600
Y
yang-qibo 已提交
10024 10025 10026
     * @tc.name    setCapacity Sets the storage capacity of the MessageParcel instance. The getCapacity
                   obtains the current MessageParcel capacity
     * @tc.desc    Function test
10027
     * @tc.level   3
Y
yang-qibo 已提交
10028
     */
Y
yang-qibo 已提交
10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13600---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13600: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                expect(data.getCapacity()).assertEqual(0);
                let setMePaCapacity = data.setCapacity(100);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13600:run setCapacityis is " + setMePaCapacity);
                expect(setMePaCapacity).assertTrue();
                expect(data.writeString("constant")).assertTrue();
                expect(data.getCapacity()).assertEqual(100);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13600: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13600: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let getMePaCapacity = result.reply.getCapacity();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13600:run getCapacityis is " + getMePaCapacity);
10050
                    expect(getMePaCapacity).assertEqual("constant".length * 8);
Y
yang-qibo 已提交
10051 10052 10053 10054 10055 10056 10057 10058 10059 10060
                    expect(result.reply.readString()).assertEqual("constant");
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13600:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13600---------------------------");
        });
Y
yang-qibo 已提交
10061

Y
yang-qibo 已提交
10062
        /*
Z
zhangpa2021 已提交
10063
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13700
Y
yang-qibo 已提交
10064 10065 10066
     * @tc.name    setCapacity Sets the storage capacity of the MessageParcel instance. The getCapacity
                   obtains the current MessageParcel capacity
     * @tc.desc    Function test
10067
     * @tc.level   3
Y
yang-qibo 已提交
10068
     */
Y
yang-qibo 已提交
10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13700---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13700: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                expect(data.writeString("constant")).assertTrue();
                expect(data.setCapacity(100)).assertTrue();
                expect(data.getCapacity()).assertEqual(100);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13700: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13700: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    expect(result.reply.readString()).assertEqual("constant");
                    let getMeCa = result.reply.getCapacity();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13700:run getCapacityis is " + getMeCa);
10089
                    expect(getMeCa).assertEqual("constant".length * 8);
Y
yang-qibo 已提交
10090 10091 10092 10093 10094 10095 10096 10097 10098
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13700:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13700---------------------------");
        });
Y
yang-qibo 已提交
10099

Y
yang-qibo 已提交
10100
        /*
Z
zhangpa2021 已提交
10101
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13800
Y
yang-qibo 已提交
10102 10103
     * @tc.name    SetCapacity Tests the storage capacity threshold of the MessageParcel instance
     * @tc.desc    Function test
10104
     * @tc.level   3
Y
yang-qibo 已提交
10105
     */
Y
yang-qibo 已提交
10106 10107 10108 10109 10110
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13800", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13800---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800: create object successfully.");
Y
yang-qibo 已提交
10111

Y
yang-qibo 已提交
10112 10113
                let getCapacitydata0 = data.getCapacity();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800:run getCapacityis is " + getCapacitydata0);
Y
yang-qibo 已提交
10114

Y
yang-qibo 已提交
10115 10116 10117 10118 10119
                expect(data.writeString("constant")).assertTrue();
                let getSizedata = data.getSize();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800:run getSizeis is " + getSizedata);
                let getCapacitydata = data.getCapacity();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800:run getCapacityis is " + getCapacitydata);
Y
yang-qibo 已提交
10120

Y
yang-qibo 已提交
10121 10122 10123 10124 10125
                let setCapacitydata1 = data.setCapacity(getSizedata + 1);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800:run setCapacityis is " + setCapacitydata1);
                expect(setCapacitydata1).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800:run getCapacityis is " + data.getCapacity());
                expect(data.getCapacity()).assertEqual((getSizedata + 1));
Y
yang-qibo 已提交
10126

Y
yang-qibo 已提交
10127 10128 10129 10130 10131
                let setCapacitydata2 = data.setCapacity(getSizedata);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800:run setCapacityis is " + setCapacitydata2);
                expect(setCapacitydata2).assertEqual(false);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800:run getCapacityis is " + data.getCapacity());
                expect(data.getCapacity()).assertEqual((getSizedata + 1));
Y
yang-qibo 已提交
10132

Y
yang-qibo 已提交
10133 10134 10135 10136 10137 10138
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13800:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13800---------------------------");
        });
Y
yang-qibo 已提交
10139

Y
yang-qibo 已提交
10140
        /*
Z
zhangpa2021 已提交
10141
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_13900
Y
yang-qibo 已提交
10142 10143
    * @tc.name    SetCapacity Tests the storage capacity threshold of the MessageParcel instance
    * @tc.desc    Function test
10144
    * @tc.level   3
Y
yang-qibo 已提交
10145
    */
Y
yang-qibo 已提交
10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_13900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_13900---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                expect(data.writeString("constant")).assertTrue();
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13900: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13900: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let getSizeresult = result.reply.getSize();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13900:run getSizeis is " + getSizeresult);
                    let setCapacityresult = result.reply.getCapacity();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13900:run getCapacityis is " + setCapacityresult);
10163
                    expect(setCapacityresult).assertEqual("constant".length * 8);
Y
yang-qibo 已提交
10164 10165 10166 10167 10168 10169 10170 10171 10172
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_13900:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_13900---------------------------");
        });
Y
yang-qibo 已提交
10173

Y
yang-qibo 已提交
10174
        /*
Z
zhangpa2021 已提交
10175
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14000
Y
yang-qibo 已提交
10176 10177
    * @tc.name    SetCapacity Tests the storage capacity threshold of the MessageParcel instance
    * @tc.desc    Function test
10178
    * @tc.level   3
Y
yang-qibo 已提交
10179
    */
Y
yang-qibo 已提交
10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14000", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14000---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14000: create object successfully.");
                let getSizedata = data.getSize();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14000:run setCapacityis is " + getSizedata);
                expect(getSizedata).assertEqual(0);

                let setMeCapacity = data.setCapacity(M);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14000:run setCapacityis is " + setMeCapacity);
                expect(setMeCapacity).assertTrue();
                let getCapacitydata = data.getCapacity();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14000:run getCapacityis is " + getCapacitydata);
                expect(getCapacitydata).assertEqual(M);

                let setMeCapacity1 = data.setCapacity(4*G);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14000:run setCapacityis is " + setMeCapacity1);
                expect(setMeCapacity1).assertEqual(false);
                let getCapacitydata1 = data.getCapacity();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14000:run getCapacityis is " + getCapacitydata1);
Y
yang-qibo 已提交
10201

Y
yang-qibo 已提交
10202 10203 10204 10205 10206 10207
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14000:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14000---------------------------");
        });
Y
yang-qibo 已提交
10208

Y
yang-qibo 已提交
10209
        /*
Z
zhangpa2021 已提交
10210
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14100
Y
yang-qibo 已提交
10211 10212 10213
     * @tc.name    setCapacity Sets the storage capacity of the MessageParcel instance to decrease by one.
                   The getCapacity obtains the current MessageParcel capacity
     * @tc.desc    Function test
10214
     * @tc.level   3
Y
yang-qibo 已提交
10215
     */
Y
yang-qibo 已提交
10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14100---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14100: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                expect(data.getSize()).assertEqual(0);
                let setSizedata = data.setSize(0);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14100:run setSizeis is " + setSizedata);
                expect(setSizedata).assertTrue();
                expect(data.writeString("constant")).assertTrue();
                let getSizedata = data.getSize();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14100:run getSizeis is " + getSizedata);
                expect(getSizedata).assertEqual(("constant".length * 2) + 8);

                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14100: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14100: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    let getSizeresult = result.reply.getSize();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14100:run getSizeis is " + getSizeresult);
                    expect(getSizeresult).assertEqual(("constant".length * 2) + 8);

                    expect(result.reply.readString()).assertEqual("constant");
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14100:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14100---------------------------");
        });
Y
yang-qibo 已提交
10253

Y
yang-qibo 已提交
10254
        /*
Z
zhangpa2021 已提交
10255
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14200
Y
yang-qibo 已提交
10256 10257 10258
     * @tc.name    setSize Sets the size of the data contained in the MessageParcel instance. The getSize command
                    reads the data
     * @tc.desc    Function test
10259
     * @tc.level   3
Y
yang-qibo 已提交
10260
     */
Y
yang-qibo 已提交
10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14200", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14200---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14200: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                expect(data.writeString("constant")).assertTrue();
                expect(data.getSize()).assertEqual(("constant".length * 2) + 8);
                expect(data.setSize(0)).assertTrue();

                let getSizedata = data.getSize();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14200:run setSizeis is " + getSizedata);
                expect(getSizedata).assertEqual(0);

                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14200: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14200: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();

                    let getSizeresult = result.reply.getSize();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14200:run getSizeis is " + getSizeresult);
                    expect(getSizeresult).assertEqual( 8);
                    let writeresult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14200:run readStringis is " + writeresult);
                    expect(writeresult).assertEqual("");
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14200:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14200---------------------------");
        });
Y
yang-qibo 已提交
10298

Y
yang-qibo 已提交
10299
        /*
Z
zhangpa2021 已提交
10300
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14300
Y
yang-qibo 已提交
10301 10302 10303 10304 10305
     * @tc.name    SetSize: Increases the value of the data contained in the MessageParcel instance by 1,
                    Write setSize
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
10306 10307 10308 10309 10310 10311 10312 10313
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14300", 0, async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14300---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14300: create object successfully.");
                expect(data.getSize()).assertEqual(0);
                expect(data.writeString("constant")).assertTrue();
                expect(data.getSize()).assertEqual(("constant".length * 2) + 8);
Y
yang-qibo 已提交
10314

Y
yang-qibo 已提交
10315 10316
                let getCapacitydata = data.getCapacity();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14300:run getCapacityis is " + getCapacitydata);
Y
yang-qibo 已提交
10317

Y
yang-qibo 已提交
10318 10319 10320
                let setSizedata1 = data.setSize(getCapacitydata);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14300:run setSizeis is " + setSizedata1);
                expect(setSizedata1).assertTrue();
Y
yang-qibo 已提交
10321

Y
yang-qibo 已提交
10322
                expect(data.getSize()).assertEqual(getCapacitydata);
Y
yang-qibo 已提交
10323

Y
yang-qibo 已提交
10324 10325 10326
                let setSizedata2 = data.setSize(getCapacitydata + 1);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14300:run setSizeis is " + setSizedata2);
                expect(setSizedata2).assertEqual(false);
Y
yang-qibo 已提交
10327

Y
yang-qibo 已提交
10328 10329 10330 10331 10332 10333
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14300:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14300---------------------------");
        });
Y
yang-qibo 已提交
10334

Y
yang-qibo 已提交
10335
        /*
Z
zhangpa2021 已提交
10336
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14400
Y
yang-qibo 已提交
10337 10338 10339
     * @tc.name    SetSize: Increases the value of the data contained in the MessageParcel instance by 1,
                    Write the setSize boundary value
     * @tc.desc    Function test
10340
     * @tc.level   3
Y
yang-qibo 已提交
10341
     */
Y
yang-qibo 已提交
10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14400---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14400: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                expect(data.writeString("constant")).assertTrue();
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14400: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14400: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
Y
yang-qibo 已提交
10356

Y
yang-qibo 已提交
10357 10358
                    expect(result.reply.readString()).assertEqual("constant");
                    expect(result.reply.getSize()).assertEqual(("constant".length * 2) + 8);
Y
yang-qibo 已提交
10359

Y
yang-qibo 已提交
10360 10361
                    let getCapacityresult = result.reply.getCapacity();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14400:run getCapacityis is " + getCapacityresult);
Y
yang-qibo 已提交
10362

Y
yang-qibo 已提交
10363 10364 10365 10366
                    let setSizeresult1 = result.reply.setSize(getCapacityresult);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14400:run setSizeis is " + setSizeresult1);
                    expect(setSizeresult1).assertTrue();
                    expect(result.reply.getSize()).assertEqual(getCapacityresult);
Y
yang-qibo 已提交
10367

Y
yang-qibo 已提交
10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379
                    let setSizeresult2 = result.reply.setSize(getCapacityresult + 1);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14400:run setSizeis is " + setSizeresult2);
                    expect(setSizeresult2).assertEqual(false);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14400:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14400---------------------------");
        });
Y
yang-qibo 已提交
10380

Y
yang-qibo 已提交
10381
        /*
Z
zhangpa2021 已提交
10382
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14500
Y
yang-qibo 已提交
10383 10384
     * @tc.name    Validate the setSize boundary value in the MessageParcel instance
     * @tc.desc    Function test
10385
     * @tc.level   3
Y
yang-qibo 已提交
10386
     */
Y
yang-qibo 已提交
10387 10388 10389 10390 10391
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14500---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14500: create object successfully.");
Y
yang-qibo 已提交
10392

Y
yang-qibo 已提交
10393 10394 10395
                let getCapacitydata = data.getCapacity();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14500:run getCapacityis is " + getCapacitydata);
                expect(getCapacitydata).assertEqual(0);
Y
yang-qibo 已提交
10396

Y
yang-qibo 已提交
10397 10398 10399 10400 10401 10402
                let setSizedata1 = data.setSize(4*G);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14500:run setSizeis is " + setSizedata1);
                expect(setSizedata1).assertTrue();
                let getSizedata1 = data.getSize();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14500:run getCapacityis is " + getSizedata1);
                expect(getSizedata1).assertEqual(0);
Y
yang-qibo 已提交
10403

Y
yang-qibo 已提交
10404 10405 10406 10407 10408 10409 10410 10411 10412 10413
                let setSizedata = data.setSize(4*G - 1);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14500:run setSizeis is " + setSizedata);
                expect(setSizedata).assertEqual(false);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14500:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14500---------------------------");
        });
Y
yang-qibo 已提交
10414

Y
yang-qibo 已提交
10415
        /*
Z
zhangpa2021 已提交
10416
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14600
Y
yang-qibo 已提交
10417 10418
     * @tc.name    Verify that setSize is out of bounds in a MessageParcel instance
     * @tc.desc    Function test
10419
     * @tc.level   3
Y
yang-qibo 已提交
10420
     */
Y
yang-qibo 已提交
10421 10422 10423 10424 10425
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14600---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14600: create object successfully.");
Y
yang-qibo 已提交
10426

Y
yang-qibo 已提交
10427 10428 10429 10430
                let setSizedata = data.setSize(0);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14600:run setCapacityis is " + setSizedata);
                expect(setSizedata).assertTrue();
                expect(data.getSize()).assertEqual(0);
Y
yang-qibo 已提交
10431

Y
yang-qibo 已提交
10432 10433 10434 10435
                let setSizedata1 = data.setSize(2*4*G);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14600:run setCapacityis is " + setSizedata1);
                expect(setSizedata1).assertTrue();
                expect(data.getSize()).assertEqual(0);
Y
yang-qibo 已提交
10436

Y
yang-qibo 已提交
10437 10438 10439 10440 10441 10442 10443 10444 10445 10446
                let setSizedata2 = data.setSize(2*G);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14600:run setCapacityis is " + setSizedata2);
                expect(setSizedata2).assertEqual(false);
                data.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14600:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14600---------------------------");
        });
Y
yang-qibo 已提交
10447

Y
yang-qibo 已提交
10448
        /*
Z
zhangpa2021 已提交
10449
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14700
Y
yang-qibo 已提交
10450 10451
     * @tc.name    Obtaining the Writable and Readable Byte Spaces of MessageParcel
     * @tc.desc    Function test
10452 10453
     * @tc.level   0
     */
Y
yang-qibo 已提交
10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14700---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14700: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                let getwbyte1 = data.getWritableBytes();
                data.writeInt(10);
                let getwbyte2 = data.getWritableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14700:result getWritePosition is getWritableBytes is "
                    + getwbyte1 + ";" + getwbyte2);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14700: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14700: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let getrbyte1 = result.reply.getReadableBytes();
                    let readint = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14700:result readInt is " + readint);
                    let getrbyte2 = result.reply.getReadableBytes();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14700:result getReadPosition is getReadableBytes is"
                        + getrbyte1 + ";" + getrbyte2);
                    expect(readint).assertEqual(10);
                    expect(getrbyte2).assertEqual(0);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14700:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14700---------------------------");
        });
Y
yang-qibo 已提交
10489

Y
yang-qibo 已提交
10490
        /*
Z
zhangpa2021 已提交
10491
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14800
Y
yang-qibo 已提交
10492 10493
     * @tc.name    Obtains the writeable and readable byte space and read position of the MessageParcel
     * @tc.desc    Function test
10494
     * @tc.level   3
Y
yang-qibo 已提交
10495
     */
Y
yang-qibo 已提交
10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14800---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14800: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                data.writeInt(10);
                let getwPos = data.getWritePosition();
                let getwbyte = data.getWritableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14800:result getWritePosition is "
                    + getwPos + "getWritableBytes is " + getwbyte);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14800: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14800: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let getrbyte = result.reply.getReadableBytes();
                    let readint = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14800:result readInt is " + readint);
                    let getrPos = result.reply.getReadPosition();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14800:result getReadPosition is "
                        + getrPos + "getReadableBytes is" + getrbyte);
                    expect(readint).assertEqual(10);
                    expect(getrPos).assertEqual(getwPos);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14800:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14800---------------------------");
        });
Y
yang-qibo 已提交
10531

Y
yang-qibo 已提交
10532
        /*
Z
zhangpa2021 已提交
10533
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_14900
Y
yang-qibo 已提交
10534 10535
    * @tc.name    Obtains the writeable and readable byte space and read position of the MessageParcel
    * @tc.desc    Function test
10536
    * @tc.level   3
Y
yang-qibo 已提交
10537
    */
Y
yang-qibo 已提交
10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_14900", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_14900---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14900: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                data.writeInt(10);
                let getwPos = data.getWritePosition();
                let getwbyte = data.getWritableBytes();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14900:result getWritePosition is "
                    + getwPos + "getWritableBytes is " + getwbyte);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14900: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14900: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let readint = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14900:result readInt is " + readint);
                    let getrPos = result.reply.getReadPosition();
                    let getrbyte = result.reply.getReadableBytes();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14900:result getReadPosition is "
                        + getrPos + "getReadableBytes is" + getrbyte);
                    expect(readint).assertEqual(10);

                    let getrPos1 = result.reply.getReadPosition();
                    expect(getrPos1).assertEqual(getwPos);
                    let getrbyte1 = result.reply.getReadableBytes();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14900:result getReadPosition is "
                        + getrPos1 + "getReadableBytes is" + getrbyte1);
                    expect(getrbyte1).assertEqual(0);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_14900:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_14900---------------------------");
        });
Y
yang-qibo 已提交
10579

Y
yang-qibo 已提交
10580
        /*
Z
zhangpa2021 已提交
10581
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15000
Y
yang-qibo 已提交
10582 10583
     * @tc.name    Test fixed MessageParcel space size to pass rawData data
     * @tc.desc    Function test
10584
     * @tc.level   3
Y
yang-qibo 已提交
10585
     */
Y
yang-qibo 已提交
10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15000", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15000---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                let rawdata = [1, 2, 3];
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                expect(data.writeInt(rawdata.length)).assertTrue();
                let result = data.writeRawData(rawdata, rawdata.length);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15000:run writeRawDatais is " + result);
                expect(result).assertTrue();
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15000: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_RAWDATA, data, reply, option).then((result) => {
                    expect(result.errCode == 0).assertTrue();
                    let size = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15000:run readIntis is " + size);
                    var newReadResult = result.reply.readRawData(size)
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15000:run readRawDatais is "
                        + newReadResult.length);
                    expect(newReadResult != rawdata).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15000:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15000---------------------------");
        });
Y
yang-qibo 已提交
10617

Y
yang-qibo 已提交
10618
        /*
Z
zhangpa2021 已提交
10619
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15100
Y
yang-qibo 已提交
10620 10621
     * @tc.name    Obtains the write and read positions of the MessageParcel
     * @tc.desc    Function test
10622
     * @tc.level   3
Y
yang-qibo 已提交
10623
     */
Y
yang-qibo 已提交
10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15100", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15100---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15100: create object successfully.");
                let option = new rpc.MessageOption();
                let reply = rpc.MessageParcel.create();
                let getwPos1 = data.getWritePosition();
                expect(data.writeInt(10)).assertTrue();
                let getwPos2 = data.getWritePosition();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15100:result getWritePosition is "
                    + getwPos1 + ";" + getwPos2);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15100: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_INT, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15100: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let getrPos1 = result.reply.getReadPosition();
                    let readint = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15100:result readInt is " + readint);
                    let getrPos2 = result.reply.getReadPosition();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15100:result getReadPosition is "
                        + getrPos1 + ";" + getrPos2);
                    expect(getwPos1).assertEqual(getrPos1);
                    expect(getwPos2).assertEqual(getrPos2);
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15100:error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15100---------------------------");
        });
Y
yang-qibo 已提交
10659 10660


Y
yang-qibo 已提交
10661
        /*
Z
zhangpa2021 已提交
10662
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15200
Y
yang-qibo 已提交
10663 10664
     * @tc.name    Test messageparcel delivery file descriptor object
     * @tc.desc    Function test
10665
     * @tc.level   3
Y
yang-qibo 已提交
10666
     */
Y
yang-qibo 已提交
10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15200", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15200---------------------------");
            try{
                let testab = new TestProxy(gIRemoteObject).asObject();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15200: run TestProxy success" + testab);
                expect(testab != null).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15200:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15200---------------------------");
        });
Y
yang-qibo 已提交
10678

Y
yang-qibo 已提交
10679
        /*
Z
zhangpa2021 已提交
10680
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15300
Y
yang-qibo 已提交
10681 10682
     * @tc.name    Test messageparcel delivery file descriptor object
     * @tc.desc    Function test
10683
     * @tc.level   3
Y
yang-qibo 已提交
10684
     */
Y
yang-qibo 已提交
10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15300---------------------------");
            try{
                let testRemoteObject = new TestRemoteObject("testObject");
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15300: TestRemoteObject is" + testRemoteObject);
                let testab = testRemoteObject.asObject();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15300: asObject is" + testab);
                expect(testab != null).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15300:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15300---------------------------");
        });
Y
yang-qibo 已提交
10698

Y
yang-qibo 已提交
10699
        /*
Z
zhangpa2021 已提交
10700
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15400
Y
yang-qibo 已提交
10701 10702
     * @tc.name    MessageParcel sendMessageRequest API test
     * @tc.desc    Function test
10703
     * @tc.level   3
Y
yang-qibo 已提交
10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736
     */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15400", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15400---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let Capacity = data.getRawDataCapacity()
                let rawdata = [1, 2, 3];
                let option = new rpc.MessageOption();
                let reply = rpc.MessageSequence.create();
                data.writeInt(rawdata.length);
                data.writeRawData(rawdata, rawdata.length);
                if (gIRemoteObject == undefined){
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15400: gIRemoteObject undefined");
                }
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_RAWDATA, data, reply, option).then((result) => {
                    expect(result.errCode == 0).assertTrue();
                    let size = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15400:run readInt is " + size);
                    var newReadResult = result.reply.readRawData(size)
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15400:run readRawData is "
                        + newReadResult.length);
                    expect(newReadResult != rawdata).assertTrue();
                });
                data.reclaim();
                reply.reclaim();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15400 : error = " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15400---------------------------");
        });

        /*
Z
zhangpa2021 已提交
10737
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15500
10738
    * @tc.name    Invoke the writestring interface to write data to the messageparcel instance SendRequest Asynchronous
10739
    *               Authentication onRemoteMessageRequest Server Processing
10740
    * @tc.desc    Function test
10741
    * @tc.level   3
10742
    */
Y
yang-qibo 已提交
10743 10744 10745 10746 10747 10748 10749
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15500", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15500---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
10750
                var token = 'onRemoteMessageRequest invoking';
Y
yang-qibo 已提交
10751 10752 10753 10754 10755 10756 10757
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500:run writeStringis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: gIRemoteObject is undefined");
                }
10758
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
Y
yang-qibo 已提交
10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500: run readString is " + replyReadResult);
                    expect(replyReadResult).assertEqual(token);
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15500:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15500---------------------------");
        });
10772

Y
yang-qibo 已提交
10773
        /*
Z
zhangpa2021 已提交
10774
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15600
Y
yang-qibo 已提交
10775
    * @tc.name    Invoke the writestring interface to write data to the messageparcel instance sendMessageRequest Asynchronous
10776
    *               Authentication onRemoteMessageRequest Server Processing
10777
    * @tc.desc    Function test
10778
    * @tc.level   3
10779
    */
Y
yang-qibo 已提交
10780 10781 10782 10783 10784 10785 10786
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15600", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15600---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: create object successfully.");
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
10787
                var token = 'onRemoteMessageRequest invoking';
10788 10789
                data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600:run writeStringis is success");
Y
yang-qibo 已提交
10790 10791 10792 10793
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: gIRemoteObject is undefined");
                }
10794
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
Y
yang-qibo 已提交
10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600: run readString is " + replyReadResult);
                    expect(replyReadResult).assertEqual(token);
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15600:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15600---------------------------");
        });
10808

Y
yang-qibo 已提交
10809
        /*
Z
zhangpa2021 已提交
10810
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15700
10811
    * @tc.name    Invoke the writestring interface to write data to the messageparcel instance. SendRequest asynchronously
10812
    *               verifies the priority processing levels of onRemoteMessageRequest and onRemoteRequest
10813
    * @tc.desc    Function test
10814
    * @tc.level   3
10815
    */
Y
yang-qibo 已提交
10816 10817 10818 10819 10820 10821 10822
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15700", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15700---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
10823
                var token = "onRemoteRequest or onRemoteMessageRequest invoking";
Y
yang-qibo 已提交
10824 10825 10826 10827 10828 10829 10830
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700:run writeStringis is " + result);
                expect(result == true).assertTrue();
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700: gIRemoteObject is undefined");
                }
10831
                await gIRemoteObject.sendRequest(CODE_ONREMOTEMESSAGE_OR_ONREMOTE, data, reply, option).then((result) => {
Y
yang-qibo 已提交
10832 10833 10834
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700: run readString is " + replyReadResult);
10835
                    expect(replyReadResult).assertEqual("onRemoteMessageRequest invoking");
Y
yang-qibo 已提交
10836 10837 10838 10839 10840 10841 10842 10843 10844
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15700:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15700---------------------------");
        });
10845

Y
yang-qibo 已提交
10846
        /*
Z
zhangpa2021 已提交
10847
    * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15800
Y
yang-qibo 已提交
10848
    * @tc.name   Invoke the writestring interface to write data to the messageparcel instance. sendMessageRequest asynchronously verifies
10849
    *               the priority processing levels of onRemoteMessageRequest and onRemoteRequest
10850
    * @tc.desc    Function test
10851
    * @tc.level   3
10852
    */
Y
yang-qibo 已提交
10853 10854 10855 10856 10857 10858 10859
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15800", 0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15800---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800: create object successfully.");
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
10860
                var token = 'onRemoteRequest or onRemoteMessageRequest invoking';
Y
yang-qibo 已提交
10861 10862 10863 10864 10865
                data.writeString(token);
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800: gIRemoteObject is undefined");
                }
10866
                await gIRemoteObject.sendMessageRequest(CODE_ONREMOTEMESSAGE_OR_ONREMOTE, data, reply, option).then((result) => {
Y
yang-qibo 已提交
10867 10868 10869
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800: run readString is " + replyReadResult);
10870
                    expect(replyReadResult).assertEqual("onRemoteMessageRequest invoking");
Y
yang-qibo 已提交
10871 10872 10873 10874 10875 10876 10877 10878 10879 10880
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15800:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15800---------------------------");
        });

Y
yang-qibo 已提交
10881 10882 10883 10884
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_15900
        * @tc.name    Call the 401 interface to set the writeString of MessageSequence
        * @tc.desc    Function test
10885
        * @tc.level   3
Y
yang-qibo 已提交
10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899
        */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_15900", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_15900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15900: create object successfully.");
                var token = '';
                for(var i = 0; i < 40*K; i++){
                    token += 'a';
                };
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15900:run writeStringis is " + result);
                data.reclaim();
            } catch (error) {
10900
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`
Y
yang-qibo 已提交
10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15900: errorCode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_15900: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_15900---------------------------");
        });
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_16000
        * @tc.name    Call the 1900011 interface, write the interface descriptor, and read interfacetoken
        * @tc.desc    Function test
10913
        * @tc.level   3
Y
yang-qibo 已提交
10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926
        */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_16000", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_16000---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: create object successfully");
                data.setSize(0);
                data.setCapacity(0);
                var token = "hello ruan zong xian";
                data.writeInterfaceToken(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000:run writeInterfaceToken result ");
                data.reclaim();
            } catch (error) {
10927
                let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`;
Y
yang-qibo 已提交
10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: errorCode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_16000---------------------------");
        }); 
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_16100
        * @tc.name    Call the 1900009 interface, write the interface descriptor, and read interfacetoken
        * @tc.desc    Function test
10940
        * @tc.level   3
Y
yang-qibo 已提交
10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954
        */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_16100", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_16100---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16100: create object successfully.");
                data.setSize(true);
                data.setCapacity(true);
                var token = "hello ruan zong xian";
                data.writeInterfaceToken(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16100:run writeInterfaceToken result is ");
            
                data.reclaim();
            } catch (error) {
10955
                let errCode = `${rpc.ErrorCode.WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR}`;
Y
yang-qibo 已提交
10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16100: errorCode " + error.code);
                expect(error.code != errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16100: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_16100---------------------------");
        });          
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_16200
        * @tc.name    Call the setcapacity interface to set the capacity of messageparcel
        * @tc.desc    Function test
10968
        * @tc.level   3
Y
yang-qibo 已提交
10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981
        */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_16200", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_16200---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16200: create object successfully.");
                let sequenceable = new MySequenceable(1, "aaa");
                data.writeParcelable(sequenceable);
                let ret = new MySequenceable(0, "");
                data.setCapacity(0);
                data.readParcelable(ret);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16200: readParcelable is." + ret);
            } catch (error) {
10982
                let errCode = `${rpc.ErrorCode.PARCEL_MEMORY_ALLOC_ERROR}`;
Y
yang-qibo 已提交
10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: errorCode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16000: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_16200---------------------------");
        });      
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_16300
        * @tc.name    Call the 1900008 interface to serialize the remote object and pass in the empty object
        * @tc.desc    Function test
10995
        * @tc.level   3   
Y
yang-qibo 已提交
10996 10997 10998 10999 11000 11001 11002 11003 11004
        */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_16300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_16300---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16300: create object successfully.");
                var token = {}
                var result = data.writeRemoteObject(token);
            } catch (error) {
11005
                let errCode = `${rpc.ErrorCode.PROXY_OR_REMOTE_OBJECT_INVALID_ERROR}`;
Y
yang-qibo 已提交
11006 11007 11008 11009 11010 11011 11012 11013
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16300: errorCode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16300: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_16300---------------------------");
        });
Z
zhangpa2021 已提交
11014

Y
yang-qibo 已提交
11015
        /*
Y
yang-qibo 已提交
11016 11017 11018 11019
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_16400
        * @tc.name    Call the writeparcelable 1900012 interface to write the custom serialized
        *             object to the MessageSequence instance
        * @tc.desc    Function test
11020
        * @tc.level   3
Y
yang-qibo 已提交
11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035
        */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_16400", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_16400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16400: create object successfully.");
                let sequenceable = new MySequenceableCode(1, "aaa");
                data.writeParcelable(sequenceable);
                data.setCapacity(0);
                data.setSize(0);
                let ret = new MySequenceable(1, "");
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16400 : setCapacity and setSize");
                data.readParcelable(ret);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16100: readParcelable is." + ret);
            } catch (error) {
11036
                let errCode = `${rpc.ErrorCode.CALL_JS_METHOD_ERROR}`;
Y
yang-qibo 已提交
11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16400:error = " + error.message);
                expect(error.message != null).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16400:error = " + error.code);
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_16400---------------------------");
        });
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_16500
        * @tc.name    Call the writeinterfacetoken interface, write the interface descriptor, and read interfacetoken
        * @tc.desc    Function test
11049
        * @tc.level   3
Y
yang-qibo 已提交
11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063
        */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_16500", 0, function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_16500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var token = "hello ruan zong xian";
                data.writeInterfaceToken(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16500:run writeInterfaceToken result is success");
                data.setCapacity(0);
                data.setSize(0);
                var resultToken = data.readInterfaceToken();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16500:run readInterfaceToken result is " + resultToken);
                data.reclaim();
            } catch (error) {
11064
                let errCode = `${rpc.ErrorCode.READ_DATA_FROM_MESSAGE_SEQUENCE_ERROR}`;
Y
yang-qibo 已提交
11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16500:error = " + error.message);
                expect(error.message != null).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16500:error = " + error.code);
                expect(error.code != errCode).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_16500---------------------------");
        });
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageParcel_16600
        * @tc.name    Test 1900013 messageparcel delivery file descriptor object
        * @tc.desc    Function test
11077
        * @tc.level   3
Y
yang-qibo 已提交
11078 11079 11080 11081 11082 11083 11084 11085 11086
        */
        it("SUB_Softbus_IPC_Compatibility_MessageParcel_16600", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageParcel_16600---------------------------");
            try {
                let filePath = "path/to/file";
                let fd = fileio.openSync(filePath, null);
                let newFd = rpc.MessageSequence.dupFileDescriptor(fd);
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16600: newFd " +newFd);
            } catch(error) {
11087
                let errCode = `${rpc.ErrorCode.OS_DUP_ERROR}`;
Y
yang-qibo 已提交
11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16600: errorCode " + error.code);
                expect(error.code != errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_MessageParcel_16600: errorMessage" + error.message);
                expect(error.message != null).assertTrue();
            }
            done()
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageParcel_16600---------------------------");
        });        

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00100
        * @tc.name    Basic method of testing messageoption
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00100",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00100---------------------------");
            try{
                let option = new rpc.MessageOption();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00100: create object successfully.");
                let time = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00100: run getWaitTime success, time is " + time);
                expect(time).assertEqual(rpc.MessageOption.TF_WAIT_TIME);
                option.setWaitTime(16);
                let time2 = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00100: run getWaitTime success, time is " + time2);
                expect(time2).assertEqual(16);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00100: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00100---------------------------");
        })
Y
yang-qibo 已提交
11120

Y
yang-qibo 已提交
11121
        /*
Z
zhangpa2021 已提交
11122
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00200
Y
yang-qibo 已提交
11123 11124
     * @tc.name    Basic method of testing messageoption
     * @tc.desc    Function test
11125
     * @tc.level   3
Y
yang-qibo 已提交
11126
     */
Y
yang-qibo 已提交
11127 11128 11129 11130 11131 11132 11133 11134
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00200",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00200---------------------------");
            try{
                let option = new rpc.MessageOption();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00200: create object successfully.");
                let time = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00200: run getWaitTime success, time is " + time);
                expect(time).assertEqual(rpc.MessageOption.TF_WAIT_TIME);
Y
yang-qibo 已提交
11135

Y
yang-qibo 已提交
11136 11137 11138 11139
                option.setWaitTime(0);
                let time2 = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00200: run getWaitTime success, time is " + time2);
                expect(time2).assertEqual(rpc.MessageOption.TF_WAIT_TIME);
Y
yang-qibo 已提交
11140

Y
yang-qibo 已提交
11141 11142 11143 11144
                option.setWaitTime(60);
                let time3 = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00200: run getWaitTime success, time is " + time3);
                expect(time3).assertEqual(60);
Y
yang-qibo 已提交
11145

Y
yang-qibo 已提交
11146 11147 11148 11149 11150
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00200: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00200---------------------------");
        })
Y
yang-qibo 已提交
11151

Y
yang-qibo 已提交
11152
        /*
Z
zhangpa2021 已提交
11153
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00300
Y
yang-qibo 已提交
11154 11155
     * @tc.name    Basic method of testing messageoption
     * @tc.desc    Function test
11156
     * @tc.level   3
Y
yang-qibo 已提交
11157
     */
Y
yang-qibo 已提交
11158 11159 11160 11161 11162 11163 11164 11165
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00300",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00300---------------------------");
            try{
                let option = new rpc.MessageOption();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00300: create object successfully.");
                let time = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00300: run getWaitTime success, time is " + time);
                expect(time).assertEqual(rpc.MessageOption.TF_WAIT_TIME);
Y
yang-qibo 已提交
11166

Y
yang-qibo 已提交
11167 11168 11169 11170 11171 11172 11173 11174 11175
                option.setWaitTime(-1);
                let time2 = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00300: run getWaitTime success, time is " + time2);
                expect(time2).assertEqual(rpc.MessageOption.TF_WAIT_TIME);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00300: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00300---------------------------");
        })
Y
yang-qibo 已提交
11176

Y
yang-qibo 已提交
11177
        /*
Z
zhangpa2021 已提交
11178
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00400
Y
yang-qibo 已提交
11179 11180
     * @tc.name    Basic method of testing messageoption
     * @tc.desc    Function test
11181
     * @tc.level   3
Y
yang-qibo 已提交
11182
     */
Y
yang-qibo 已提交
11183 11184 11185 11186 11187 11188 11189 11190
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00400",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00400---------------------------");
            try{
                let option = new rpc.MessageOption();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00400: create object successfully.");
                let time = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00400: run getWaitTime success, time is " + time);
                expect(time).assertEqual(rpc.MessageOption.TF_WAIT_TIME);
Y
yang-qibo 已提交
11191

Y
yang-qibo 已提交
11192 11193 11194 11195 11196 11197 11198 11199 11200
                option.setWaitTime(61);
                let time2 = option.getWaitTime();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00400: run getWaitTime success, time is " + time2);
                expect(time2).assertEqual(61);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00400: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00400---------------------------");
        })
Y
yang-qibo 已提交
11201

Y
yang-qibo 已提交
11202
        /*
Z
zhangpa2021 已提交
11203
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00500
Y
yang-qibo 已提交
11204 11205 11206 11207
     * @tc.name    Basic method of testing messageoption
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11208 11209 11210 11211 11212 11213 11214 11215
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00500",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00500---------------------------");
            try{
                let option = new rpc.MessageOption();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00500: create object successfully.");
                let flog = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00500: run getFlags success, flog is " + flog);
                expect(flog).assertEqual(rpc.MessageOption.TF_SYNC);
Y
yang-qibo 已提交
11216

Y
yang-qibo 已提交
11217 11218 11219 11220 11221 11222 11223 11224 11225 11226
                option.setFlags(1)
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00500: run setFlags success");
                let flog2 = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00500: run getFlags success, flog2 is " + flog2);
                expect(flog2).assertEqual(rpc.MessageOption.TF_ASYNC);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00500: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00500---------------------------");
        })
Y
yang-qibo 已提交
11227

Y
yang-qibo 已提交
11228
        /*
Z
zhangpa2021 已提交
11229
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00600
Y
yang-qibo 已提交
11230 11231
     * @tc.name    Basic method of testing messageoption
     * @tc.desc    Function test
11232
     * @tc.level   3
Y
yang-qibo 已提交
11233
     */
Y
yang-qibo 已提交
11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00600",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00600---------------------------");
            try{
                let option = new rpc.MessageOption();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00600: create object successfully.");
                let flog = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00600: run getFlags success, flog is " + flog);
                expect(flog).assertEqual(rpc.MessageOption.TF_SYNC);

                option.setFlags(1);
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00600: run setFlags success");
                let flog2 = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00600: run getFlags success, flog2 is " + flog2);
                expect(flog2).assertEqual(rpc.MessageOption.TF_ASYNC);

11249
                option.setFlags(0);
Y
yang-qibo 已提交
11250 11251 11252 11253 11254 11255 11256 11257 11258
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00600: run setFlags success");
                let flog3 = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00600: run getFlags success, flog2 is " + flog3);
                expect(flog2).assertEqual(rpc.MessageOption.TF_ASYNC);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00600: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00600---------------------------");
        })
J
jiyong 已提交
11259

Y
yang-qibo 已提交
11260
        /*
Z
zhangpa2021 已提交
11261
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00700
Y
yang-qibo 已提交
11262
     * @tc.name    Basic method of testing messageoption
J
jiyong 已提交
11263
     * @tc.desc    Function test
11264
     * @tc.level   3
J
jiyong 已提交
11265
     */
Y
yang-qibo 已提交
11266 11267 11268 11269 11270 11271 11272 11273
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00700",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00700---------------------------");
            try{
                let option = new rpc.MessageOption();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00700: create object successfully.");
                let flog = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00700: run getFlags success, flog is " + flog);
                expect(flog).assertEqual(rpc.MessageOption.TF_SYNC);
Z
zhangpa2021 已提交
11274

Y
yang-qibo 已提交
11275 11276 11277 11278 11279 11280 11281 11282 11283
                option.setFlags(-1);
                let flog2 = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00700: run getFlags success, flog2 is " + flog2);
                expect(flog2).assertEqual(-1);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00700: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00700---------------------------");
        })
J
jiyong 已提交
11284

Y
yang-qibo 已提交
11285
        /*
Z
zhangpa2021 已提交
11286
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00800
J
jiyong 已提交
11287 11288
     * @tc.name    Basic method of testing messageoption
     * @tc.desc    Function test
11289
     * @tc.level   3
J
jiyong 已提交
11290
     */
Y
yang-qibo 已提交
11291 11292 11293 11294 11295 11296 11297 11298
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00800",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00800---------------------------");
            try{
                let option = new rpc.MessageOption();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00800: create object successfully.");
                let flog = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00800: run getFlags success, flog is " + flog);
                expect(flog).assertEqual(rpc.MessageOption.TF_SYNC);
J
jiyong 已提交
11299

Y
yang-qibo 已提交
11300 11301 11302 11303 11304 11305 11306 11307 11308
                option.setFlags(3);
                let flog2 = option.getFlags();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00800: run getFlags success, flog2 is " + flog2);
                expect(flog2).assertEqual(3);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00800: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00800---------------------------");
        })
J
jiyong 已提交
11309

Y
yang-qibo 已提交
11310
        /*
Z
zhangpa2021 已提交
11311
     * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_00900
Y
yang-qibo 已提交
11312 11313 11314 11315
     * @tc.name    Basic method of testing messageoption
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11316 11317 11318 11319
        it("SUB_Softbus_IPC_Compatibility_MessageOption_00900",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_00900---------------------------");
            try{
                expect(rpc.MessageOption.TF_SYNC).assertEqual(0);
J
jiyong 已提交
11320

Y
yang-qibo 已提交
11321
                expect(rpc.MessageOption.TF_ASYNC).assertEqual(1);
Y
yang-qibo 已提交
11322

Y
yang-qibo 已提交
11323
                expect(rpc.MessageOption.TF_WAIT_TIME).assertEqual(4);
Y
yang-qibo 已提交
11324

Y
yang-qibo 已提交
11325 11326 11327 11328 11329 11330
                expect(rpc.MessageOption.TF_ACCEPT_FDS).assertEqual(0x10);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_00900: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_00900---------------------------");
        })
J
jiyong 已提交
11331

Y
yang-qibo 已提交
11332
        /*
Y
yang-qibo 已提交
11333 11334 11335
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_01000
        * @tc.name    Basic method of testing messageoption
        * @tc.desc    Function test
11336
        * @tc.level   3
Y
yang-qibo 已提交
11337
        */
Y
yang-qibo 已提交
11338 11339 11340
        it("SUB_Softbus_IPC_Compatibility_MessageOption_01000",0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_01000---------------------------");
            try{
11341

Y
yang-qibo 已提交
11342 11343 11344 11345 11346 11347 11348 11349 11350 11351
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01000: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                option.setWaitTime(20);
                option.setFlags(0);
                var token = "option";
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01000:run writeStringis is " + result);
                expect(result).assertTrue();
11352 11353
                expect(option.getFlags()).assertEqual(0);
                expect(option.getWaitTime()).assertEqual(20);
11354

Y
yang-qibo 已提交
11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01000: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01000: sendRequestis is " + result.errCode);

                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01000: run readString is " + replyReadResult);
                    expect(replyReadResult).assertEqual(token);
                    expect(option.getFlags()).assertEqual(0);
                    expect(option.getWaitTime()).assertEqual(20);

                });
                data.reclaim();
                reply.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01000: error " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_01000---------------------------");
        })
J
jiyong 已提交
11377

Y
yang-qibo 已提交
11378
        /*
Y
yang-qibo 已提交
11379 11380 11381
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_01100
        * @tc.name    Basic method of testing messageoption
        * @tc.desc    Function test
11382
        * @tc.level   3
Y
yang-qibo 已提交
11383
        */
Y
yang-qibo 已提交
11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396
        it("SUB_Softbus_IPC_Compatibility_MessageOption_01100",0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_01100---------------------------");
            try{

                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01100: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                option.setFlags(1);
                var token = "option";
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01100:run writeStringis is " + result);
                expect(result).assertTrue();
Y
yang-qibo 已提交
11397
                expect(option.getFlags()).assertEqual(1);
Y
yang-qibo 已提交
11398 11399 11400 11401 11402 11403 11404 11405
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01100: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01100: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01100: run readString is " + replyReadResult);
11406
                    expect(replyReadResult).assertEqual("option");
Y
yang-qibo 已提交
11407
                    expect(option.getFlags()).assertEqual(1);
Z
zhangpa2021 已提交
11408

Y
yang-qibo 已提交
11409 11410 11411 11412 11413 11414 11415 11416 11417
                });
                data.reclaim();
                reply.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01100: error " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_01100---------------------------");
        })
Z
zhangpa2021 已提交
11418

Y
yang-qibo 已提交
11419
        /*
Y
yang-qibo 已提交
11420 11421 11422
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_01200
        * @tc.name    Basic method of testing messageoption
        * @tc.desc    Function test
11423
        * @tc.level   3
Y
yang-qibo 已提交
11424
        */
Y
yang-qibo 已提交
11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437
        it("SUB_Softbus_IPC_Compatibility_MessageOption_01200",0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_01200---------------------------");
            try{

                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01200: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
                option.setFlags(3);
                var token = "option";
                var result = data.writeString(token);
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01200:run writeStringis is " + result);
                expect(result).assertTrue();
Y
yang-qibo 已提交
11438
                expect(option.getFlags()).assertEqual(3);
Y
yang-qibo 已提交
11439 11440 11441 11442 11443 11444 11445 11446
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01200: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01200: sendRequestis is " + result.errCode);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01200: run readString is " + replyReadResult);
11447
                    expect(replyReadResult).assertEqual("option");
Y
yang-qibo 已提交
11448 11449 11450 11451 11452 11453 11454 11455 11456 11457
                    expect(option.getFlags()).assertEqual(3);
                });
                data.reclaim();
                reply.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01200: error " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_01200---------------------------");
        })
Z
zhangpa2021 已提交
11458

Y
yang-qibo 已提交
11459
        /*
Y
yang-qibo 已提交
11460 11461 11462
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_01300
        * @tc.name    MessageOption sendMessageRequest test
        * @tc.desc    Function test
11463
        * @tc.level   3
Y
yang-qibo 已提交
11464
        */
Y
yang-qibo 已提交
11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475
        it("SUB_Softbus_IPC_Compatibility_MessageOption_01300",0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_01300---------------------------");
            try{

                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01300: create object successfully.");
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                option.setFlags(1);
                var token = "option";
                data.writeString(token);
Z
zhangpa2021 已提交
11476
                expect(option.getFlags()).assertEqual(1);
Y
yang-qibo 已提交
11477 11478 11479 11480 11481 11482 11483 11484
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01300: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01300: sendMessageRequest is " + result.errCode);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01300: run readString is " + replyReadResult);
11485
                    expect(replyReadResult).assertEqual("option");
Y
yang-qibo 已提交
11486
                    expect(option.getFlags()).assertEqual(1);
Z
zhangpa2021 已提交
11487

Y
yang-qibo 已提交
11488 11489 11490 11491 11492 11493 11494 11495 11496
                });
                data.reclaim();
                reply.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01300: error " + error);
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_01300---------------------------");
        })
Z
zhangpa2021 已提交
11497

Y
yang-qibo 已提交
11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543
       /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_01400
        * @tc.name    MessageOption sendMessageRequest test
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_MessageOption_01400",0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_01400---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01400: create object successfully.");
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                var token = "option";
                data.writeString(token);
                let isAsyncData0 = option.isAsync();
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01400: run isAsync is " + isAsyncData0);
                expect(isAsyncData0).assertEqual(false);
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01400: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01400: sendMessageRequest is " + result.errCode);
                    let isAsyncData = option.isAsync();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01400: run isAsync is " + isAsyncData);
                    expect(isAsyncData).assertEqual(false);
                    var replyReadResult = result.reply.readString();
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01400: run readString is " + replyReadResult);
                    expect(replyReadResult).assertEqual(token);
                });
                data.reclaim();
                reply.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01400: error " + error);
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_01400---------------------------");
        }) 
        
       /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_01500
        * @tc.name    MessageOption setAsync is true test
        * @tc.desc    Function test
11544
        * @tc.level   3
Y
yang-qibo 已提交
11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563
        */
        it("SUB_Softbus_IPC_Compatibility_MessageOption_01500",0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_01500---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                option.setAsync(true);
                var token = "option";
                data.writeString(token);
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01500: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let isAsyncData = option.isAsync();
                    expect(isAsyncData).assertTrue();
                    var replyReadResult = result.reply.readString();
11564
                    expect(replyReadResult).assertEqual("option");
Y
yang-qibo 已提交
11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576
                });
                data.reclaim();
                reply.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01500: error " + error);
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_01500---------------------------");
        })
        

Y
yang-qibo 已提交
11577
        /*
Y
yang-qibo 已提交
11578 11579 11580
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_01600
        * @tc.name    setAsync is false sendMessageRequest test
        * @tc.desc    Function test
11581
        * @tc.level   3
Y
yang-qibo 已提交
11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617
        */
        it("SUB_Softbus_IPC_Compatibility_MessageOption_01600",0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_01600---------------------------");
            try{

                var data = rpc.MessageSequence.create();
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                option.setAsync(false);
                var token = "option";
                data.writeString(token);
                if (gIRemoteObject == undefined)
                {
                    console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01600: gIRemoteObject is undefined");
                }
                await gIRemoteObject.sendMessageRequest(CODE_WRITE_STRING, data, reply, option).then((result) => {
                    expect(result.errCode).assertEqual(0);
                    let isAsyncData = option.isAsync();
                    expect(isAsyncData).assertEqual(false);
                    var replyReadResult = result.reply.readString();
                    expect(replyReadResult).assertEqual(token);
                });
                data.reclaim();
                reply.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01600: error " + error);
                expect(error == null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_01600---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_MessageOption_01700
        * @tc.name    setAsync sendMessageRequest test
        * @tc.desc    Function test
11618
        * @tc.level   3
Y
yang-qibo 已提交
11619 11620 11621 11622 11623 11624
        */
        it("SUB_Softbus_IPC_Compatibility_MessageOption_01700",0, async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_MessageOption_01700---------------------------");
            try{
                var option = new rpc.MessageOption();
                option.setAsync(3);
11625
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01700: setAsync is success");
Y
yang-qibo 已提交
11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_MessageOption_01700: error " + error);
                expect(error != null).assertTrue();
            }
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_MessageOption_01700---------------------------");
        })         

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00100
        * @tc.name    Exception parameter validation of the created anonymous shared memory object
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
11640 11641 11642
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00100",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00100---------------------------");
            try{
11643
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", -1);
Y
yang-qibo 已提交
11644
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00100: ashmem " + ashmem);
J
jiyong 已提交
11645

11646
                let ashmem2 = rpc.Ashmem.createAshmem(null, K);
Y
yang-qibo 已提交
11647 11648 11649 11650 11651 11652
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00100: ashmem2 " + ashmem2);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00100: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00100---------------------------");
        })
J
jiyong 已提交
11653

Y
yang-qibo 已提交
11654
        /*
Y
yang-qibo 已提交
11655 11656 11657 11658 11659
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00200
        * @tc.name    Call the getashmemsize interface to get the size of the shared memory object
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
11660 11661 11662 11663 11664 11665 11666 11667 11668
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00200",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00200---------------------------");
            try{
                var mapSize = 2*G - 1;
                var jsash = "";
                for (let i = 0;i < (256 - 1);i++){
                    jsash += "a";
                }
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00200: run  createAshmem success" + jsash.length);
11669
                let ashmem = rpc.Ashmem.createAshmem(jsash, mapSize);
Y
yang-qibo 已提交
11670 11671 11672 11673 11674
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00200: run  createAshmem success" + ashmem);
                expect(ashmem != null).assertTrue();
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00200: error " + error);
Y
yang-qibo 已提交
11675
            }
Y
yang-qibo 已提交
11676 11677
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00200---------------------------");
        })
J
jiyong 已提交
11678

Y
yang-qibo 已提交
11679
        /*
Z
zhangpa2021 已提交
11680
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00300
Y
yang-qibo 已提交
11681 11682
     * @tc.name    Call the getashmemsize interface to get the size of the shared memory object
     * @tc.desc    Function test
11683
     * @tc.level   3
Y
yang-qibo 已提交
11684
     */
Y
yang-qibo 已提交
11685 11686 11687 11688 11689 11690 11691 11692 11693
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00300",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00300---------------------------");
            try{
                let mapSize = 2*G - 1;
                let jsash = '';
                for (let i = 0;i < 256;i++){
                    jsash += 'a';
                }
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00300: run  createAshmem success" + jsash.length);
11694
                let ashmem = rpc.Ashmem.createAshmem(jsash, mapSize);
Y
yang-qibo 已提交
11695 11696 11697 11698 11699
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00300: run  createAshmem success" + ashmem);
                ashmem.closeAshmem();
            }catch(error){
                expect(error != null).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00300: error " + error);
Y
yang-qibo 已提交
11700
            }
Y
yang-qibo 已提交
11701 11702
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00300---------------------------");
        })
J
jiyong 已提交
11703

Y
yang-qibo 已提交
11704
        /*
Z
zhangpa2021 已提交
11705
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00400
J
jiyong 已提交
11706 11707 11708 11709
     * @tc.name    Call the getashmemsize interface to get the size of the shared memory object
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11710 11711 11712 11713
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00400",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00400---------------------------");
            try{
                let mapSize = 2*G - 1;
11714
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", mapSize);
Y
yang-qibo 已提交
11715
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00400: run  createAshmem success" + ashmem);
11716
                let size = ashmem.getAshmemSize();
Y
yang-qibo 已提交
11717 11718 11719 11720 11721 11722 11723 11724
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00400: run getAshmemSize success, size is " + size);
                expect(size).assertEqual(mapSize);
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00400: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00400---------------------------");
        })
J
jiyong 已提交
11725

Y
yang-qibo 已提交
11726
        /*
Z
zhangpa2021 已提交
11727
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00500
Y
yang-qibo 已提交
11728 11729 11730 11731
     * @tc.name    Call the getashmemsize interface to get the size of the shared memory object
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11732 11733 11734 11735
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00500",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00500---------------------------");
            try{
                let mapSize = 2*G;
11736
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest ", mapSize);
Y
yang-qibo 已提交
11737
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00500: run  createAshmem success " + ashmem);
11738
                let size = ashmem.getAshmemSize();
Y
yang-qibo 已提交
11739 11740 11741 11742 11743 11744 11745 11746 11747
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00500: run getAshmemSize success, size is " + size);
                expect(size).assertEqual(mapSize);
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00500: error " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00500---------------------------");
        })
J
jiyong 已提交
11748

Y
yang-qibo 已提交
11749
        /*
Z
zhangpa2021 已提交
11750
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00600
J
jiyong 已提交
11751 11752 11753 11754
     * @tc.name    Writeashmem exception validation
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11755 11756 11757
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00600",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00600---------------------------");
            try{
11758
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
Y
yang-qibo 已提交
11759
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00600: ashmem " + ashmem);
11760
                ashmem.closeAshmem();
Y
yang-qibo 已提交
11761 11762 11763 11764 11765 11766 11767 11768 11769 11770
                var data = rpc.MessageParcel.create();
                let writeAshmem = data.writeAshmem(ashmem);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00600: run writeAshmem success, writeAshmem is " + writeAshmem);
                expect(writeAshmem).assertEqual(false);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00600: error " + error);
            }
            data.reclaim();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00600---------------------------");
        })
J
jiyong 已提交
11771

Y
yang-qibo 已提交
11772
        /*
Z
zhangpa2021 已提交
11773
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00700
J
jiyong 已提交
11774 11775 11776 11777
     * @tc.name    Readfromashmem exception validation
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11778 11779 11780
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00700",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00700---------------------------");
            try{
11781
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
Y
yang-qibo 已提交
11782
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00700: ashmem " + ashmem);
11783
                ashmem.unmapAshmem();
Y
yang-qibo 已提交
11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00700: run unmapAshmem success");
                let bytes = [1, 2, 3, 4, 5];
                let ret = ashmem.readFromAshmem(bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00700: run readFromAshmem result is " + ret);
                expect(ret==null).assertTrue();
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00700: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00700---------------------------");
        })
J
jiyong 已提交
11795

Y
yang-qibo 已提交
11796
        /*
Z
zhangpa2021 已提交
11797
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00800
J
jiyong 已提交
11798 11799 11800 11801
     * @tc.name    Mapashmem interface creates shared file mappings
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11802 11803 11804
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00800",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00800---------------------------");
            try{
11805
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
Y
yang-qibo 已提交
11806 11807 11808 11809
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00800: ashmem " + ashmem);
                let result = ashmem.mapAshmem(rpc.Ashmem.PROT_READ);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00800: run mapAshmemis is " + result);
                expect(result).assertTrue();
11810
                ashmem.closeAshmem();
Y
yang-qibo 已提交
11811 11812 11813 11814 11815
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00800: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00800---------------------------");
        })
J
jiyong 已提交
11816

Y
yang-qibo 已提交
11817
        /*
Z
zhangpa2021 已提交
11818
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_00900
J
jiyong 已提交
11819 11820
     * @tc.name    Mapashmem exception validation
     * @tc.desc    Function test
11821
     * @tc.level   3
J
jiyong 已提交
11822
     */
Y
yang-qibo 已提交
11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837
        it("SUB_Softbus_IPC_Compatibility_Ashmem_00900",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_00900---------------------------");
            try{
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", (2*G - 1))
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00900: ashmem " + ashmem);
                let result = ashmem.mapAshmem(999);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00900: run mapAshmemis is " + result);
                expect(result).assertEqual(false);
                ashmem.closeAshmem()
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_00900: error " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_00900---------------------------");
        })
J
jiyong 已提交
11838

Y
yang-qibo 已提交
11839
        /*
Z
zhangpa2021 已提交
11840
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01000
J
jiyong 已提交
11841 11842 11843 11844
     * @tc.name    Mapreadandwriteashmem interface creates a shared file map with the protection level of read-write
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11845 11846 11847
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01000",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01000---------------------------");
            try{
11848
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", K);
Y
yang-qibo 已提交
11849 11850 11851
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01000: ashmem " + ashmem);
                let result = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01000: run mapAshmemis is " + result);
11852
                ashmem.closeAshmem();
Y
yang-qibo 已提交
11853 11854 11855 11856 11857
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01000: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01000---------------------------");
        })
J
jiyong 已提交
11858

Y
yang-qibo 已提交
11859
        /*
Z
zhangpa2021 已提交
11860
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01100
J
jiyong 已提交
11861 11862
     * @tc.name    Mapreadandwriteashmem exception validation
     * @tc.desc    Function test
11863
     * @tc.level   3
J
jiyong 已提交
11864
     */
Y
yang-qibo 已提交
11865 11866 11867
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01100",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01100---------------------------");
            try{
11868
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
Y
yang-qibo 已提交
11869 11870 11871 11872
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01100: ashmem " + ashmem);
                let result = ashmem.mapAshmem(rpc.Ashmem.PROT_READ);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01100: run mapAshmemis is " + result);
                expect(result).assertTrue();
J
jiyong 已提交
11873

Y
yang-qibo 已提交
11874 11875
                ashmem.unmapAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01100: run unmapAshmem success");
Z
zhangpa2021 已提交
11876

Y
yang-qibo 已提交
11877 11878 11879
                let result2 = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01100: run mapReadAndWriteAshmemis2 is " + result2);
                expect(result2).assertTrue();
11880
                ashmem.closeAshmem();
Y
yang-qibo 已提交
11881 11882 11883 11884 11885
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01100: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01100---------------------------");
        })
J
jiyong 已提交
11886

Y
yang-qibo 已提交
11887
        /*
Z
zhangpa2021 已提交
11888
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01200
J
jiyong 已提交
11889 11890 11891 11892
     * @tc.name    Mapreadonlyashmem interface creates a shared file map with the protection level of read-write
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
11893 11894 11895
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01200",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01200---------------------------");
            try{
11896
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
Y
yang-qibo 已提交
11897 11898 11899 11900 11901 11902 11903 11904 11905 11906
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01200: ashmem " + ashmem);
                let result = ashmem.mapReadOnlyAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01200: run mapReadAndWriteAshmemis is " + result);
                expect(result).assertTrue();
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01200: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01200---------------------------");
        })
J
jiyong 已提交
11907

Y
yang-qibo 已提交
11908
        /*
Z
zhangpa2021 已提交
11909
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01300
J
jiyong 已提交
11910 11911
     * @tc.name    Mapreadonlyashmem exception validation
     * @tc.desc    Function test
11912
     * @tc.level   3
J
jiyong 已提交
11913
     */
Y
yang-qibo 已提交
11914 11915 11916
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01300",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01300---------------------------");
            try{
11917
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", K);
Y
yang-qibo 已提交
11918
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01300: ashmem " + ashmem);
J
jiyong 已提交
11919

Y
yang-qibo 已提交
11920 11921 11922
                let result = ashmem.mapAshmem(rpc.Ashmem.PROT_WRITE);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01300: run mapAshmemis is " + result);
                expect(result).assertTrue();
J
jiyong 已提交
11923

Y
yang-qibo 已提交
11924 11925
                ashmem.unmapAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01300: run unmapAshmem success");
11926
                ashmem.closeAshmem();
Y
yang-qibo 已提交
11927 11928 11929 11930 11931 11932 11933 11934
                let result2 = ashmem.mapReadOnlyAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01300: run mapReadAndWriteAshmemis2 is " + result2);
                expect(result2).assertEqual(false);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01300: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01300---------------------------");
        })
J
jiyong 已提交
11935

Y
yang-qibo 已提交
11936
        /*
Z
zhangpa2021 已提交
11937
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01400
J
jiyong 已提交
11938 11939
     * @tc.name    Mapreadonlyashmem exception validation
     * @tc.desc    Function test
11940
     * @tc.level   3
J
jiyong 已提交
11941
     */
Y
yang-qibo 已提交
11942 11943 11944 11945
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01400",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01400---------------------------");
            try{
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", K);
11946
                let resultwrite = ashmem.setProtection(rpc.Ashmem.PROT_WRITE);
Y
yang-qibo 已提交
11947 11948
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01400: run setProtectioniswrite is " + resultwrite);
                expect(resultwrite).assertTrue();
11949
                let resultread = ashmem.setProtection(rpc.Ashmem.PROT_READ);
Y
yang-qibo 已提交
11950 11951 11952 11953 11954 11955 11956 11957
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01400: run setProtectionisread is " + resultread);
                expect(resultread).assertEqual(false);

                let resultreadAndwrite = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01400: run setProtection success, mapReadAndWriteAshmem is "
                    + resultreadAndwrite);
                expect(resultreadAndwrite ).assertEqual(false);

11958
                let resultnone = ashmem.setProtection(rpc.Ashmem.PROT_NONE);
Y
yang-qibo 已提交
11959 11960 11961
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01400: run setProtectionisnone is " + resultnone);
                expect(resultnone).assertTrue();

11962
                let resultread2 = ashmem.setProtection(rpc.Ashmem.PROT_READ);
Y
yang-qibo 已提交
11963 11964
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01400: run setProtectionisread2 is " + resultread2);
                expect(resultread2).assertEqual(false);
11965
                ashmem.closeAshmem();
Y
yang-qibo 已提交
11966 11967 11968 11969 11970
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01400: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01400---------------------------");
        })
J
jiyong 已提交
11971

Y
yang-qibo 已提交
11972
        /*
Z
zhangpa2021 已提交
11973
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01500
Y
yang-qibo 已提交
11974 11975
     * @tc.name    Setprotection exception input parameter verification
     * @tc.desc    Function test
11976
     * @tc.level   3
Y
yang-qibo 已提交
11977
     */
Y
yang-qibo 已提交
11978 11979 11980 11981 11982 11983 11984 11985
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01500",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01500---------------------------");
            try{
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", K);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01500: ashmem " + ashmem);
                let result = ashmem.setProtection(3);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01500: run setProtectionis is " + result);
                expect(result).assertTrue();
11986
                ashmem.closeAshmem();
Y
yang-qibo 已提交
11987 11988 11989 11990 11991
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01500: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01500---------------------------");
        })
Y
yang-qibo 已提交
11992

Y
yang-qibo 已提交
11993
        /*
Z
zhangpa2021 已提交
11994
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01600
Y
yang-qibo 已提交
11995 11996
     * @tc.name    The writetoashmem interface writes the shared file associated with the object
     * @tc.desc    Function test
11997
     * @tc.level   3
11998
     */
Y
yang-qibo 已提交
11999 12000 12001
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01600",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01600---------------------------");
            try{
12002 12003
                let mapSize = 4096;
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", mapSize);
Y
yang-qibo 已提交
12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01600: ashmem " + ashmem);

                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01600: run mapReadAndWriteAshmemis2 is "
                    + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [1, 2, 3, 4, 5];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01600: run writeToAshmemis is " + result);
                expect(result).assertTrue();
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01600: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01600---------------------------");
        })
Y
yang-qibo 已提交
12020

Y
yang-qibo 已提交
12021
        /*
Z
zhangpa2021 已提交
12022
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01700
Y
yang-qibo 已提交
12023 12024
     * @tc.name    The writetoashmem interface writes the shared file associated with the object
     * @tc.desc    Function test
12025
     * @tc.level   3
Y
yang-qibo 已提交
12026
     */
Y
yang-qibo 已提交
12027 12028 12029
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01700",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01700---------------------------");
            try{
12030 12031
                let mapSize = 4096;
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", mapSize);
Y
yang-qibo 已提交
12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01700: ashmem " + ashmem);

                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01700: run mapReadAndWriteAshmemis2 is "
                    + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [-2147483648,2147483647];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01700: run writeToAshmemis is " + result);
                expect(result).assertTrue();
                let reresult = ashmem.readFromAshmem(bytes.length,0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01700: run readFromAshmemis is " + reresult);
                assertArrayElementEqual(reresult,bytes);
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01700: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01700---------------------------");
        })
Y
yang-qibo 已提交
12051

Y
yang-qibo 已提交
12052
        /*
Z
zhangpa2021 已提交
12053
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01800
Y
yang-qibo 已提交
12054 12055
     * @tc.name    The writetoashmem interface writes the shared file associated with the object
     * @tc.desc    Function test
12056
     * @tc.level   3
Y
yang-qibo 已提交
12057
     */
Y
yang-qibo 已提交
12058 12059 12060
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01800",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01800---------------------------");
            try{
12061 12062
                let mapSize = 4096;
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", mapSize);
Y
yang-qibo 已提交
12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01800: ashmem " + ashmem);

                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01800: run mapReadAndWriteAshmemis2 is "
                    + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [-2147483649,2147483647];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01800: run writeToAshmemis is " + result);
                expect(result).assertTrue();
                let readresult = ashmem.readFromAshmem(bytes.length,0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01800: run readFromAshmemis is " + readresult);
                expect(readresult[0]).assertEqual(2147483647);
                expect(readresult[1]).assertEqual(bytes[1]);
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01800: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01800---------------------------");
        })
12083

Y
yang-qibo 已提交
12084
        /*
Z
zhangpa2021 已提交
12085
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_01900
Y
yang-qibo 已提交
12086 12087
     * @tc.name    The writetoashmem interface writes the shared file associated with the object
     * @tc.desc    Function test
12088
     * @tc.level   3
Y
yang-qibo 已提交
12089
     */
Y
yang-qibo 已提交
12090 12091 12092
        it("SUB_Softbus_IPC_Compatibility_Ashmem_01900",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_01900---------------------------");
            try{
12093 12094
                let mapSize = 4096;
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", mapSize);
Y
yang-qibo 已提交
12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01900: ashmem " + ashmem);

                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01900: run mapReadAndWriteAshmemis2 is "
                    + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [-2147483648,2147483648];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01900: run writeToAshmemis is " + result);
                expect(result).assertTrue();
                let reresult = ashmem.readFromAshmem(bytes.length,0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01900: run readFromAshmemis is " + reresult);
                expect(reresult[0]).assertEqual(bytes[0]);
                expect(reresult[1]).assertEqual(-2147483648);
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_01900: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_01900---------------------------");
        })
J
jiyong 已提交
12115

Y
yang-qibo 已提交
12116
        /*
Z
zhangpa2021 已提交
12117
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02000
Y
yang-qibo 已提交
12118
     * @tc.name    The writetoashmem interface writes the shared file associated with the object
J
jiyong 已提交
12119
     * @tc.desc    Function test
12120
     * @tc.level   3
J
jiyong 已提交
12121
     */
Y
yang-qibo 已提交
12122 12123 12124 12125
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02000",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02000---------------------------");
            try{
                let mapSize = 2*M;
12126
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", mapSize);
Y
yang-qibo 已提交
12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02000: ashmem " + ashmem);

                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02000: run mapReadAndWriteAshmemis2 is " + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [0,1];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 2147483647);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02000: run writeToAshmemis is " + result);
                expect(result).assertEqual(false);
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02000: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02000---------------------------");
        })
J
jiyong 已提交
12142

Y
yang-qibo 已提交
12143
        /*
Z
zhangpa2021 已提交
12144
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02100
J
jiyong 已提交
12145 12146 12147 12148
     * @tc.name    The writetoashmem interface writes the shared file associated with the object
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
12149 12150 12151 12152
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02100",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02100---------------------------");
            try{
                let mapSize = 2*M;
12153
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", mapSize);
Y
yang-qibo 已提交
12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02100: ashmem " + ashmem);

                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02100: run mapReadAndWriteAshmemis2 is " + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [0,1];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 2147483648);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02100: run writeToAshmemis is " + result);
                expect(result).assertTrue();
                let readresult1 = ashmem.readFromAshmem(bytes.length,0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02100: run readFromAshmemis is " + readresult1);
                assertArrayElementEqual(readresult1,bytes);
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02100: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02100---------------------------");
        })
J
jiyong 已提交
12171

Y
yang-qibo 已提交
12172
        /*
Z
zhangpa2021 已提交
12173
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02200
J
jiyong 已提交
12174 12175
     * @tc.name    The writetoashmem interface writes the shared file associated with the object
     * @tc.desc    Function test
12176
     * @tc.level   3
J
jiyong 已提交
12177
     */
Y
yang-qibo 已提交
12178 12179 12180
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02200",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02200---------------------------");
            try{
12181
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
Y
yang-qibo 已提交
12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02200: ashmem " + ashmem);

                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02200: run mapReadAndWriteAshmemis2 is "
                    + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [1, 2, 3, 4, 5];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02200: run writeToAshmemis is " +result);
                expect(result).assertTrue();
                let resultread = ashmem.setProtection(rpc.Ashmem.PROT_READ);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02200: run setProtectionisread is " + resultread);
12194
                expect(resultread).assertTrue();
Y
yang-qibo 已提交
12195 12196
                let result2 = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02200: run writeToAshmemis is2 " + result2);
12197
                expect(result2).assertEqual(false);
Y
yang-qibo 已提交
12198 12199 12200 12201 12202 12203
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02200: error " +error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02200---------------------------");
        })
J
jiyong 已提交
12204

Y
yang-qibo 已提交
12205
        /*
Z
zhangpa2021 已提交
12206
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02300
J
jiyong 已提交
12207 12208
     * @tc.name    Writetoashmem exception validation
     * @tc.desc    Function test
12209
     * @tc.level   3
J
jiyong 已提交
12210
     */
Y
yang-qibo 已提交
12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02300",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02300---------------------------");
            try{
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02300: ashmem " + ashmem);
                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02300: run mapReadAndWriteAshmemis2 is "
                    + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [1, 2, 3, 4, 5];
                let size = bytes.length + 10;
                let result = ashmem.writeToAshmem(bytes, 3, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02300: run writeToAshmemis is " + result);
                expect(result).assertTrue();
12225
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12226 12227 12228 12229 12230
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02300: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02300---------------------------");
        })
J
jiyong 已提交
12231

Y
yang-qibo 已提交
12232
        /*
Z
zhangpa2021 已提交
12233
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02400
J
jiyong 已提交
12234 12235
     * @tc.name    Read data from the shared file associated with readfromashmem
     * @tc.desc    Function test
12236
     * @tc.level   3
J
jiyong 已提交
12237
     */
Y
yang-qibo 已提交
12238 12239 12240
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02400",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02400---------------------------");
            try{
12241
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
Y
yang-qibo 已提交
12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02400: ashmem " + ashmem);

                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02400: run mapReadAndWriteAshmemis2 is "
                    + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [1, 2, 3, 4, 5];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02400: run writeToAshmemis is " + result);
                expect(result).assertTrue();
                var resultRead = ashmem.readFromAshmem(bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02400: run readFromAshmemis is " + resultRead);
                assertArrayElementEqual(resultRead,bytes);
12255
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12256 12257 12258 12259 12260
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02400: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02400---------------------------");
        })
J
jiyong 已提交
12261

Y
yang-qibo 已提交
12262
        /*
Z
zhangpa2021 已提交
12263
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02500
J
jiyong 已提交
12264 12265
     * @tc.name    Readfromashmem exception validation
     * @tc.desc    Function test
12266
     * @tc.level   3
J
jiyong 已提交
12267
     */
Y
yang-qibo 已提交
12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02500",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02500---------------------------");
            try{
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02500: ashmem " + ashmem);
                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02500: run mapReadAndWriteAshmemis2 is "
                    + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [1, 2, 3, 4, 5];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 1);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02500: run writeToAshmemis is " + result);
12280
                expect(result).assertTrue();
Y
yang-qibo 已提交
12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292

                let result2 = ashmem.readFromAshmem(bytes.length, 3);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02500: run readFromAshmemis2 is " + result2);
                expect(bytes[2]).assertEqual(result2[0]);
                expect(bytes[3]).assertEqual(result2[1]);
                expect(bytes[4]).assertEqual(result2[2]);
                ashmem.closeAshmem()
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02500: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02500---------------------------");
        })
J
jiyong 已提交
12293

Y
yang-qibo 已提交
12294
        /*
Z
zhangpa2021 已提交
12295
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02600
J
jiyong 已提交
12296 12297
     * @tc.name    Createashmemfromexisting copies the ashmem object description and creates a new object
     * @tc.desc    Function test
12298
     * @tc.level   3
J
jiyong 已提交
12299
     */
Y
yang-qibo 已提交
12300 12301 12302
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02600",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02600---------------------------");
            try{
12303
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", 4096);
Y
yang-qibo 已提交
12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02600: ashmem " + ashmem);
                let resultWriteAndRead = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02600:  run mapReadAndWriteAshmem result " + resultWriteAndRead);
                expect(resultWriteAndRead).assertTrue();
                let bytes = [1, 2, 3];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 1);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02600: run writeToAshmemis " + result);
                expect(result).assertTrue()
                let newashmem = rpc.Ashmem.createAshmemFromExisting(ashmem);
                let resultWriteAndRead2 = newashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02600:  run mapReadAndWriteAshmem result " + resultWriteAndRead2);
                expect(resultWriteAndRead2).assertTrue();

                let result2 = newashmem.readFromAshmem(bytes.length, 1);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02600: run readFromAshmemis2 is " + result2);
                expect(result).assertTrue();
                assertArrayElementEqual(result2,bytes);
                ashmem.closeAshmem();
                newashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02600: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02600---------------------------");
        })
J
jiyong 已提交
12328

Y
yang-qibo 已提交
12329
        /*
Z
zhangpa2021 已提交
12330
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02700
J
jiyong 已提交
12331 12332 12333
     * @tc.name    Create a shared memory object and call writeashmem to write the shared anonymous
      object into the messageparcel object
     * @tc.desc    Function test
12334
     * @tc.level   3
J
jiyong 已提交
12335
     */
Y
yang-qibo 已提交
12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02700",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02700---------------------------");
            try{
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", K);
                let data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02700: ashmem " + ashmem);
                let resultMapRAndW = ashmem.mapReadAndWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02700: run mapReadAndWriteAshmem result is " + resultMapRAndW);
                expect(resultMapRAndW).assertTrue();
                let bytes = [1, 2, 3];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 1);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02700: run writeToAshmemis is " + result);
                expect(result).assertTrue()
                let result2 = data.writeAshmem(ashmem)
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02700: run writeAshmemis is " + result2);
                expect(result2).assertTrue();
                let retReadAshmem = data.readAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02700: run readAshmem is " + retReadAshmem);
                let retBytes = retReadAshmem.readFromAshmem(bytes.length, 1);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02700: run readFromAshmem result is " + retBytes);

                ashmem.closeAshmem();
                data.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02700: error " +error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02700---------------------------");
        })
J
jiyong 已提交
12364

Y
yang-qibo 已提交
12365
        /*
Z
zhangpa2021 已提交
12366
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02800
J
jiyong 已提交
12367 12368 12369
     * @tc.name    Create a non shared memory object and call writeashmem to write the messageparcel object
      object into the messageparcel object
     * @tc.desc    Function test
12370
     * @tc.level   3
J
jiyong 已提交
12371
     */
Y
yang-qibo 已提交
12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02800",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02800---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                let data2 = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02800: create MessageParcel object success");
                let result = data.writeAshmem(data2);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02800: run writeAshmemis is " + result);
                data.reclaim();
                data2.reclaim();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02800: error " + error);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02800---------------------------");
        })
J
jiyong 已提交
12388

Y
yang-qibo 已提交
12389
        /*
Z
zhangpa2021 已提交
12390
     * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_02900
Y
yang-qibo 已提交
12391 12392
     * @tc.name    Create a non shared memory object and call writeashmem to write the messageparcel object
      object into the messageparcel object
Z
zhangpa2021 已提交
12393
     * @tc.desc    Function test
12394
     * @tc.level   3
Z
zhangpa2021 已提交
12395
     */
Y
yang-qibo 已提交
12396 12397 12398 12399
        it("SUB_Softbus_IPC_Compatibility_Ashmem_02900",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_02900---------------------------");
            try{
                let ashmem = rpc.Ashmem.createAshmem("JsAshmemTest", K);
Z
zhangpa2021 已提交
12400

12401
                let resultwrite = ashmem.setProtection(rpc.Ashmem.PROT_EXEC);
Y
yang-qibo 已提交
12402 12403
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02900: run setProtectioniswrite is " + resultwrite);
                expect(resultwrite).assertTrue();
Z
zhangpa2021 已提交
12404

12405
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12406 12407 12408 12409 12410
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_02900: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_02900---------------------------");
        })
Z
zhangpa2021 已提交
12411

Y
yang-qibo 已提交
12412
        /*
Y
yang-qibo 已提交
12413 12414 12415
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03000
        * @tc.name    mapTypedAshmem interface creates shared file mappings
        * @tc.desc    Function test
12416
        * @tc.level   3
Y
yang-qibo 已提交
12417 12418 12419
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03000",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03000---------------------------");
Y
yang-qibo 已提交
12420
            try{
Y
yang-qibo 已提交
12421 12422 12423 12424
                let ashmem = rpc.Ashmem.create("JsAshmemTest", 4*K)
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03000: ashmem " + ashmem);
                let result = ashmem.mapTypedAshmem(ashmem.PROT_READ | ashmem.PROT_WRITE);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03000: run mapTypedAshmem is success");
12425
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03000: error " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03000---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03100
        * @tc.name    mapTypedAshmem exception validation
        * @tc.desc    Function test
12437
        * @tc.level   3
Y
yang-qibo 已提交
12438 12439 12440 12441 12442 12443 12444 12445
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03100",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03100---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("JsAshmemTest", (2*G - 1))
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03100: ashmem " + ashmem);
                let result = ashmem.mapTypedAshmem(999);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03100: run mapTypedAshmem is success");
12446
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03100: errorCode " + error.code);
                expect(error.code == 401).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03100: errormessage" + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03100---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03200
        * @tc.name    mapTypedAshmem exception errorcode validation
        * @tc.desc    Function test
12460
        * @tc.level   3
Y
yang-qibo 已提交
12461 12462 12463 12464 12465 12466 12467 12468
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03200",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03200---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("JsAshmemTest", (2*G))
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03200: ashmem " + ashmem);
                let result = ashmem.mapTypedAshmem(ashmem.PROT_READ | ashmem.PROT_WRITE);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03200: run mapTypedAshmem is success");
12469
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03200: errorCode " + error.code);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03200: errormessage" + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03200---------------------------");
        })        

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03300
        * @tc.name    mapReadWriteAshmem interface creates a shared file map with the protection level of read-write
        * @tc.desc    Function test
12482
        * @tc.level   3
Y
yang-qibo 已提交
12483 12484 12485 12486
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03300",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03300---------------------------");
            try{
12487
                let ashmem = rpc.Ashmem.create("JsAshmemTest", K);
Y
yang-qibo 已提交
12488 12489 12490
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03300: ashmem " + ashmem);
                ashmem.mapReadWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03300: run mapReadWriteAshmem is success");
12491
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03300: error " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03300---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03400
        * @tc.name    mapReadWriteAshmem exception validation
        * @tc.desc    Function test
12503
        * @tc.level   3
Y
yang-qibo 已提交
12504 12505 12506 12507
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03400",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03400---------------------------");
            try{
12508
                let ashmem = rpc.Ashmem.create("JsAshmemTest", 4096);
Y
yang-qibo 已提交
12509 12510 12511 12512 12513 12514 12515
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03400: ashmem " + ashmem);
                ashmem.mapTypedAshmem(rpc.Ashmem.PROT_READ);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03400: run mapTypedAshmem is success");
                ashmem.unmapAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03400: run unmapAshmem success");
                ashmem.mapReadWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03400: run mapReadWriteAshmem is success");
12516
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03400: error " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03400---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03500
        * @tc.name    Mapreadonlyashmem interface creates a shared file map with the protection level of read-write
        * @tc.desc    Function test
12528
        * @tc.level   3
Y
yang-qibo 已提交
12529 12530 12531 12532
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03500",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03500---------------------------");
            try{
12533
                let ashmem = rpc.Ashmem.create("JsAshmemTest", 4096);
Y
yang-qibo 已提交
12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03500: ashmem " + ashmem);
                ashmem.mapReadonlyAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03500: run mapReadonlyAshmem is success");
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03500: error " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03500---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03600
        * @tc.name    mapReadWriteAshmem exception validation
        * @tc.desc    Function test
12549
        * @tc.level   3
Y
yang-qibo 已提交
12550 12551 12552 12553 12554
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03600",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03600---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("JsAshmemTest", K);
12555
                ashmem.setProtectionType(rpc.Ashmem.PROT_WRITE);
Y
yang-qibo 已提交
12556 12557
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03600: run setProtectionType is success");
                
12558
                ashmem.setProtectionType(rpc.Ashmem.PROT_READ);
Y
yang-qibo 已提交
12559 12560 12561 12562 12563
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03600: run setProtectionType is success");
                
                ashmem.mapReadWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03600: run mapReadWriteAshmem success");

12564
                ashmem.setProtectionType(rpc.Ashmem.PROT_NONE);
Y
yang-qibo 已提交
12565 12566
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03600: run setProtectionType is success");

12567
                ashmem.setProtectionType(rpc.Ashmem.PROT_READ);
Y
yang-qibo 已提交
12568
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03600: run setProtectionType is success");
12569
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03600: error " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03600---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03700
        * @tc.name    setProtectionType exception input parameter verification
        * @tc.desc    Function test
12581
        * @tc.level   3
Y
yang-qibo 已提交
12582 12583 12584 12585 12586 12587 12588 12589
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03700",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03700---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("JsAshmemTest", K);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03700: ashmem " + ashmem);
                ashmem.setProtectionType(3);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03700: run setProtectionType is success");
12590
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03700: error " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03700---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03800
        * @tc.name    The writetoashmem interface writes the shared file associated with the object
        * @tc.desc    Function test
12602
        * @tc.level   3
Y
yang-qibo 已提交
12603 12604 12605 12606
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03800",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03800---------------------------");
            try{
12607
                let ashmem = rpc.Ashmem.create("JsAshmemTest", 4096);
Y
yang-qibo 已提交
12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03800: ashmem " + ashmem);
                ashmem.mapReadWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03800: run mapReadWriteAshmem is success");
                let bytes = [1, 2, 3, 4, 5];
                let result = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03800: run writeToAshmemis is " +result);
                expect(result).assertTrue();
                ashmem.setProtectionType(rpc.Ashmem.PROT_READ);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03800: run setProtectionType is success");
                let result2 = ashmem.writeToAshmem(bytes, bytes.length, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03800: run writeToAshmemis is2 " + result2);
12619
                expect(result2).assertEqual(false);
Y
yang-qibo 已提交
12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632
                ashmem.closeAshmem();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03800: error " +error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03800---------------------------");
        })        

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_03900
        * @tc.name    Create a non shared memory object and call setProtectionType to write the messageparcel object
        *               object into the messageparcel object
        * @tc.desc    Function test
12633
        * @tc.level   3
Y
yang-qibo 已提交
12634 12635 12636 12637 12638
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_03900",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_03900---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("JsAshmemTest", K);
12639
                ashmem.setProtectionType(rpc.Ashmem.PROT_EXEC);
Y
yang-qibo 已提交
12640
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03900: run setProtectioniswrite is success");
12641
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_03900: error " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_03900---------------------------");
        }) 

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04000
        * @tc.name    Mapreadonlyashmem exception validation
        * @tc.desc    Function test
12653
        * @tc.level   3
Y
yang-qibo 已提交
12654 12655 12656 12657
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04000",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04000---------------------------");
            try{
12658
                let ashmem = rpc.Ashmem.create("JsAshmemTest", K);
Y
yang-qibo 已提交
12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04000: ashmem " + ashmem);

                ashmem.mapTypedAshmem(rpc.Ashmem.PROT_WRITE);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04000: run mapTypedAshmem is success");

                ashmem.unmapAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04000: run unmapAshmem success");
                ashmem.closeAshmem()

                ashmem.mapReadonlyAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04000: run mapReadonlyAshmem is success");
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04000: error " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04000---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04100
        * @tc.name    create is errorcode 401 exception validation
        * @tc.desc    Function test
12681
        * @tc.level   3
Y
yang-qibo 已提交
12682 12683 12684 12685 12686 12687 12688
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04100",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04100---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("ashmem", (2*G + 1));
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04100: ashmem " + ashmem);
            }catch(error){
12689
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`;
Y
yang-qibo 已提交
12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04100: errorCode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04100: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04100---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04200
        * @tc.name    mapReadWriteAshmem exception validation 1900001
        * @tc.desc    Function test
12702
        * @tc.level   3
Y
yang-qibo 已提交
12703 12704 12705 12706 12707 12708 12709 12710 12711
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04200",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04200---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("ashmem", (4*G - 1));
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04200: ashmem " + ashmem);
                ashmem.mapReadWriteAshmem();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04200: run mapReadWriteAshmem is success");
            }catch(error){
12712
                let errCode = `${rpc.ErrorCode.OS_MMAP_ERROR}`;
Y
yang-qibo 已提交
12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04200: error " + error.code);
                expect(error.code != errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04200: error " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04200---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04300
        * @tc.name    create 401  exception validation
        * @tc.desc    Function test
12725
        * @tc.level   3
Y
yang-qibo 已提交
12726 12727 12728 12729 12730 12731 12732
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04300",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04300---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("ashmem", 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04300: ashmem " + ashmem);
            }catch(error){
12733
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`;
Y
yang-qibo 已提交
12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04300: errorCode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04300: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04300---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04400
        * @tc.name    setProtectionType exception validation
        * @tc.desc    Function test
12746
        * @tc.level   3
Y
yang-qibo 已提交
12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04400",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04400---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("ashmem", 1024*1024);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04400: ashmem " + ashmem);
                ashmem.setProtectionType(0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04400: run setProtectionType is success");
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04400: error " + error);
                expect(error).assertEqual(null);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04400---------------------------");
        }) 

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04500
        * @tc.name    401 exception validation
        * @tc.desc    Function test
12766
        * @tc.level   3
Y
yang-qibo 已提交
12767 12768 12769 12770 12771 12772 12773 12774 12775
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04500",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04500---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("ashmem", 1024*1024);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04500: ashmem " + ashmem);
                ashmem.setProtectionType(rpc.Ashmem.PROT_WRITE, rpc.Ashmem.PROT_READ);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04500: run setProtectionType is success");
            }catch(error){
12776
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`;
Y
yang-qibo 已提交
12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04500: errorCode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04500: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04500---------------------------");
        })                 

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04600
        * @tc.name    setProtectionType is 1900002 exception validation
        * @tc.desc    Function test
12789
        * @tc.level   3
Y
yang-qibo 已提交
12790 12791 12792 12793 12794 12795 12796 12797 12798
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04600",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04600---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("ashmem", 1024*1024);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04600: ashmem " + ashmem);
                ashmem.setProtectionType(null);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04600: run setProtectionType is success");
            }catch(error){
12799
                let errCode = `${rpc.ErrorCode.OS_IOCTL_ERROR}`;
Y
yang-qibo 已提交
12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04600: errorCode " + error.code);
                expect(error.code != errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04600: errorMessage " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04600---------------------------");
        }) 
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04700
        * @tc.name    writeAshmem errCode 1900003 exception validation
        * @tc.desc    Function test
12812
        * @tc.level   3
Y
yang-qibo 已提交
12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824
        */       
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04700",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04700---------------------------");
            try{
                let data = rpc.MessageSequence.create();
                let data2 = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04700: create MessageSequence object success");
                data.writeAshmem(data2);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04700: run writeAshmemis is " );
                data.reclaim();
                data2.reclaim();
            }catch(error){
12825
                let errCode = `${rpc.ErrorCode.WRITE_TO_ASHMEM_ERROR}`;
Y
yang-qibo 已提交
12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04700: error " + error.code);
                expect(error.code != errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04700: error " + error.message);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04700---------------------------");
        })           
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04800
        * @tc.name    readAshmem exception validation
        * @tc.desc    Function test
12838
        * @tc.level   3
Y
yang-qibo 已提交
12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04800",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04800---------------------------");
            try{
                let ashmem = rpc.Ashmem.create("ashmem", 1024);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04800: ashmem " + ashmem);
                ashmem.mapReadWriteAshmem();
                var ByteArrayVar = [1, 2, 3, 4, 5];
                ashmem.writeAshmem(ByteArrayVar, 5, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04800: run writeAshmem is success");
                let readResult = ashmem.readAshmem(5, 0);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04800: readAshmem is  : " + readResult);
            }catch(error){
12852
                let errCode = `${rpc.ErrorCode.READ_FROM_ASHMEM_ERROR}`;
Y
yang-qibo 已提交
12853 12854 12855 12856 12857 12858 12859 12860 12861 12862
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04800: error " + error.code);
                expect(error.code != errCode).assertEqual(null);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04800---------------------------");
        })      

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_04900
        * @tc.name    Call the getashmemsize interface to get the size of the shared memory object
        * @tc.desc    Function test
12863
        * @tc.level   3 
Y
yang-qibo 已提交
12864 12865 12866 12867 12868
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_04900",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_04900---------------------------");
            try{
                let mapSize = 2*G;
12869
                let ashmem = rpc.Ashmem.create("JsAshmemTest ", mapSize);
Y
yang-qibo 已提交
12870
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04900: run  create success " + ashmem);
12871
                let size = ashmem.getAshmemSize();
Y
yang-qibo 已提交
12872 12873 12874 12875
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04900: run getAshmemSize success, size is " + size);
                expect(size).assertEqual(mapSize);
                ashmem.closeAshmem();
            }catch(error){
12876
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`;
Y
yang-qibo 已提交
12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04900: errorcode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_04900: errormessage " + error.message);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_04900---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_05000
        * @tc.name    mapTypedAshmem errorcode 401 exception validation
        * @tc.desc    Function test
12889
        * @tc.level   3
Y
yang-qibo 已提交
12890 12891 12892 12893
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_05000",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_05000---------------------------");
            try{
12894
                let ashmem = rpc.Ashmem.create("JsAshmemTest", (2*G - 1));
Y
yang-qibo 已提交
12895 12896 12897 12898 12899 12900
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05000: ashmem " + ashmem);
                let result = ashmem.mapTypedAshmem(999);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05000: run mapAshmemis is " + result);
                expect(result).assertEqual(false);
                ashmem.closeAshmem()
            }catch(error){
12901
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`;
Y
yang-qibo 已提交
12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05000: errorcode " + error.code);
                expect(error.code == errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05000: errormessage " + error.message);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_05000---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_05100
        * @tc.name    mapTypedAshmem exception validation
        * @tc.desc    Function test
12914
        * @tc.level   3 
Y
yang-qibo 已提交
12915 12916 12917 12918
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_05100",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_05100---------------------------");
            try{
12919
                let ashmem = rpc.Ashmem.create("JsAshmemTest", (2*G - 1));
Y
yang-qibo 已提交
12920 12921 12922
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05100: ashmem " + ashmem);
                let result = ashmem.mapTypedAshmem(999);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05100: run mapTypedAshmem is success");
12923
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12924
            }catch(error){
12925
                let errCode = `${rpc.ErrorCode.OS_MMAP_ERROR}`;
Y
yang-qibo 已提交
12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05100: error " + error.code);
                expect(error.code != errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05100: error " + error.message);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_05100---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_Ashmem_05200
        * @tc.name    mapTypedAshmem exception errorcode validation
        * @tc.desc    Function test
12938
        * @tc.level   3
Y
yang-qibo 已提交
12939 12940 12941 12942
        */
        it("SUB_Softbus_IPC_Compatibility_Ashmem_05200",0,function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_Ashmem_05200---------------------------");
            try{
12943
                let ashmem = rpc.Ashmem.create("JsAshmemTest", (2*G - 1));
Y
yang-qibo 已提交
12944 12945 12946
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05200: ashmem " + ashmem);
                let result = ashmem.mapTypedAshmem(ashmem.PROT_READ | ashmem.PROT_WRITE);
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05200: run mapTypedAshmem is success");
12947
                ashmem.closeAshmem();
Y
yang-qibo 已提交
12948
            }catch(error){
12949
                let errCode = `${rpc.ErrorCode.CHECK_PARAM_ERROR}`;
Y
yang-qibo 已提交
12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05200: error " + error.code);
                expect(error.code != errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_Ashmem_05200: error " + error.message);
                expect(error != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_Ashmem_05200---------------------------");
        })         

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00100
        * @tc.name    Call sendrequestresult interface to send data
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00100",0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00100---------------------------");
            try{
                let data = rpc.MessageParcel.create();
                let reply = rpc.MessageParcel.create();
                let option = new rpc.MessageOption();
                let sequenceable = new MySequenceable(1, "aaa");
                let result = data.writeSequenceable(sequenceable);
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00100: run writeSequenceableis is " + result);

                await gIRemoteObject.sendRequest(CODE_WRITESEQUENCEABLE, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00100: sendRequestis is " + result.errCode);
                    expect(result.errCode == 0).assertTrue();
                    let ret = new MySequenceable(0, "");
                    var shortArryDataReply = result.reply.readSequenceable(ret);
                    console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00100: run readSequenceable is "
                        + shortArryDataReply);
12981 12982 12983
                    expect(shortArryDataReply == true).assertTrue();
                    expect(ret.num).assertEqual(1);
                    expect(ret.str).assertEqual("aaa");
Y
yang-qibo 已提交
12984
                });
J
jiyong 已提交
12985

Y
yang-qibo 已提交
12986 12987 12988 12989 12990 12991 12992 12993
                data.reclaim();
                reply.reclaim();
                done();
            }catch(error){
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00100: error " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00100---------------------------");
        })
12994

Y
yang-qibo 已提交
12995
        /*
Z
zhangpa2021 已提交
12996
     * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00200
J
jiyong 已提交
12997 12998 12999
     * @tc.name    Test that messageparcel passes through the same process, and the client
     *             receives the reply message in promise
     * @tc.desc    Function test
13000
     * @tc.level   3
J
jiyong 已提交
13001
     */
Y
yang-qibo 已提交
13002 13003 13004 13005 13006 13007 13008
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00200---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00200: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
13009 13010 13011 13012 13013 13014 13015 13016 13017 13018
                expect(data.writeByte(1)).assertTrue();
                expect(data.writeShort(2)).assertTrue();
                expect(data.writeInt(3)).assertTrue();
                expect(data.writeLong(10000)).assertTrue();
                expect(data.writeFloat(1.2)).assertTrue();
                expect(data.writeDouble(10.2)).assertTrue();
                expect(data.writeBoolean(true)).assertTrue();
                expect(data.writeChar(5)).assertTrue();
                expect(data.writeString("HelloWorld")).assertTrue();
                expect(data.writeSequenceable(new MySequenceable(1, "aaa"))).assertTrue();
Y
yang-qibo 已提交
13019 13020 13021

                await gIRemoteObject.sendRequest(CODE_ALL_TYPE, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00200: sendRequest done, error code: " + result.errCode);
13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readByte()).assertEqual(1);
                    expect(result.reply.readShort()).assertEqual(2);
                    expect(result.reply.readInt()).assertEqual(3);
                    expect(result.reply.readLong()).assertEqual(10000);
                    expect(result.reply.readFloat()).assertEqual(1.2);
                    expect(result.reply.readDouble()).assertEqual(10.2);
                    expect(result.reply.readBoolean()).assertTrue();
                    expect(result.reply.readChar()).assertEqual(5);
                    expect(result.reply.readString()).assertEqual("HelloWorld");
                    let s = new MySequenceable(0, '');
                    expect(result.reply.readSequenceable(s)).assertTrue();
                    expect(s.num).assertEqual(1);
                    expect(s.str).assertEqual("aaa");
Y
yang-qibo 已提交
13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051
                });
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00200:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00200---------------------------");
            done();
        });

        /*
     * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00300
     * @tc.name    Test that messageparcel passes through the same process, and the client
     *             receives the reply message in the callback function
     * @tc.desc    Function test
13052
     * @tc.level   3
Y
yang-qibo 已提交
13053 13054 13055 13056 13057 13058 13059 13060 13061
     */
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00300---------------------------");
            try{
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00300: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();

13062 13063 13064 13065 13066 13067 13068 13069 13070 13071
                expect(data.writeByte(2)).assertTrue();
                expect(data.writeShort(3)).assertTrue();
                expect(data.writeInt(4)).assertTrue();
                expect(data.writeLong(5)).assertTrue();
                expect(data.writeFloat(1.2)).assertTrue();
                expect(data.writeDouble(10.2)).assertTrue();
                expect(data.writeBoolean(true)).assertTrue();
                expect(data.writeChar(5)).assertTrue();
                expect(data.writeString("HelloWorld")).assertTrue();
                expect(data.writeSequenceable(new MySequenceable(1, "aaa"))).assertTrue();
Y
yang-qibo 已提交
13072 13073 13074

                function sendRequestCallback(result) {
                    try{
13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090
                        console.info("sendRequest Callback");
                        console.info("sendRequest done, error code: " + result.errCode);
                        expect(result.errCode).assertEqual(0);
                        expect(result.reply.readByte()).assertEqual(2);
                        expect(result.reply.readShort()).assertEqual(3);
                        expect(result.reply.readInt()).assertEqual(4);
                        expect(result.reply.readLong()).assertEqual(5);
                        expect(result.reply.readFloat()).assertEqual(1.2);
                        expect(result.reply.readDouble()).assertEqual(10.2);
                        expect(result.reply.readBoolean()).assertTrue();
                        expect(result.reply.readChar()).assertEqual(5);
                        expect(result.reply.readString()).assertEqual("HelloWorld");
                        let s = new MySequenceable(null, null);
                        expect(result.reply.readSequenceable(s)).assertTrue();
                        expect(s.num).assertEqual(1);
                        expect(s.str).assertEqual("aaa");
Y
yang-qibo 已提交
13091 13092 13093
                    } finally {
                        result.data.reclaim();
                        result.reply.reclaim();
13094 13095
                        console.info("test done");
                        done();
Y
yang-qibo 已提交
13096
                    }
Z
zhangpa2021 已提交
13097 13098
                }

13099 13100
                console.info("start send request");
                await gIRemoteObject.sendRequest(CODE_ALL_TYPE, data, reply, option, sendRequestCallback);
Y
yang-qibo 已提交
13101 13102 13103 13104 13105 13106

            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00300:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00300---------------------------");
        });
13107

Y
yang-qibo 已提交
13108
        /*
Z
zhangpa2021 已提交
13109
     * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00400
J
jiyong 已提交
13110 13111 13112 13113
     * @tc.name    Iremoteobject, register death notification verification
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
13114 13115 13116
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00400", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00400---------------------------");
            try{
13117 13118
                let object = new TestAbilityStub("Test1");
                var resultAdd1 = object.addDeathRecipient(null, 0);
Y
yang-qibo 已提交
13119 13120
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00400:run addDeathRecipient first result is" + resultAdd1);
                expect(resultAdd1 == false).assertTrue();
J
jiyong 已提交
13121

13122
                var resultRemove1 = object.removeDeathRecipient(null, 0);
Y
yang-qibo 已提交
13123 13124
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00400:run removeDeathRecipient1 result is" + resultRemove1);
                expect(resultRemove1 == false).assertTrue();
J
jiyong 已提交
13125

13126
                let isDead = object.isObjectDead();
Y
yang-qibo 已提交
13127 13128 13129 13130 13131 13132 13133
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00400:run  isDead result is " + isDead);
                expect(isDead == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00400:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00400---------------------------");
        });
J
jiyong 已提交
13134

Y
yang-qibo 已提交
13135
        /*
Z
zhangpa2021 已提交
13136
     * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00500
J
jiyong 已提交
13137 13138 13139
     * @tc.name    Do not get the server agent, do not create a remoteobject instance, and directly getcallingpid,
     *             getcallingpid, getcallingdeviceid, getlocaldeviceid
     * @tc.desc    Function test
13140
     * @tc.level   3
J
jiyong 已提交
13141
     */
Y
yang-qibo 已提交
13142 13143 13144
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00500", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00500---------------------------");
            try{
13145
                let callingPid = rpc.IPCSkeleton.getCallingPid();
Y
yang-qibo 已提交
13146 13147
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00500: run getCallingPid success, callingPid " + callingPid);
                expect(callingPid != null).assertTrue();
J
jiyong 已提交
13148

13149
                let callingUid = rpc.IPCSkeleton.getCallingUid();
Y
yang-qibo 已提交
13150 13151
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00500: run getCallingPid success, callingPid " + callingUid);
                expect(callingUid != null).assertTrue();
J
jiyong 已提交
13152

13153
                let callingDeviceID = rpc.IPCSkeleton.getCallingDeviceID();
Y
yang-qibo 已提交
13154 13155 13156
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00500: run getCallingDeviceID success, callingDeviceID is "
                    + callingDeviceID);
                expect(callingDeviceID == "").assertTrue();
J
jiyong 已提交
13157

13158
                let localDeviceID = rpc.IPCSkeleton.getLocalDeviceID();
Y
yang-qibo 已提交
13159 13160 13161 13162 13163 13164 13165 13166
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00500: run getLocalDeviceID success, localDeviceID is "
                    + localDeviceID);
                expect(localDeviceID == "").assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00500:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00500---------------------------");
        });
J
jiyong 已提交
13167

Y
yang-qibo 已提交
13168
        /*
Z
zhangpa2021 已提交
13169
     * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00600
J
jiyong 已提交
13170 13171
     * @tc.name    Querylocalinterface searches for objects based on descriptors
     * @tc.desc    Function test
13172
     * @tc.level   3
J
jiyong 已提交
13173
     */
Y
yang-qibo 已提交
13174 13175 13176 13177 13178
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00600", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00600---------------------------");
            try{
                let object = new TestAbilityStub("Test1");
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00600: run TestAbilityStub success");
J
jiyong 已提交
13179

13180
                let result = object.isObjectDead();
Y
yang-qibo 已提交
13181
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00600: run isObjectDeadis is " + result);
13182
                expect(result == false).assertTrue();
J
jiyong 已提交
13183

13184
                let callingPid = object.getCallingPid();
Y
yang-qibo 已提交
13185
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00600: run getCallingPid success,callingPid " + callingPid);
J
jiyong 已提交
13186

13187
                let callingUid = object.getCallingUid();
Y
yang-qibo 已提交
13188
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00600: run getCallingPid success,callingPid " + callingUid);
J
jiyong 已提交
13189

13190
                object.attachLocalInterface(object, "Test1");
Y
yang-qibo 已提交
13191
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00600: run attachLocalInterface success");
J
jiyong 已提交
13192

13193
                let res = object.queryLocalInterface("Test1");
Y
yang-qibo 已提交
13194 13195 13196 13197 13198 13199
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00600: run queryLocalInterface success, res2 is " + res);
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00600:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00600---------------------------");
        });
J
jiyong 已提交
13200

Y
yang-qibo 已提交
13201
        /*
Z
zhangpa2021 已提交
13202
     * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00700
J
jiyong 已提交
13203 13204
     * @tc.name    Getinterfacedescriptor to get the interface description
     * @tc.desc    Function test
13205
     * @tc.level   3
J
jiyong 已提交
13206
     */
Y
yang-qibo 已提交
13207 13208 13209 13210
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00700---------------------------");
            try{
                let object = new TestAbilityStub("Test1223");
J
jiyong 已提交
13211

13212
                let result = object.isObjectDead();
Y
yang-qibo 已提交
13213
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00700: run isObjectDeadis is " + result);
13214
                expect(result == false).assertTrue();
J
jiyong 已提交
13215

13216
                let callingPid = object.getCallingPid();
Y
yang-qibo 已提交
13217
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00700: run getCallingPid success,callingPid " + callingPid);
J
jiyong 已提交
13218

13219
                let callingUid = object.getCallingUid();
Y
yang-qibo 已提交
13220
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00700: run getCallingPid success,callingPid " + callingUid);
J
jiyong 已提交
13221

13222
                object.attachLocalInterface(object, "test1");
Y
yang-qibo 已提交
13223
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00700: run attachLocalInterface success");
J
jiyong 已提交
13224

Y
yang-qibo 已提交
13225 13226 13227 13228
                let result2 = object.getInterfaceDescriptor();
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00700: run getInterfaceDescriptoris2 is "
                    + result2);
                expect(result2 != null).assertTrue();
J
jiyong 已提交
13229

Y
yang-qibo 已提交
13230 13231 13232 13233 13234
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00700:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00700---------------------------");
        });
J
jiyong 已提交
13235

Y
yang-qibo 已提交
13236
        /*
Z
zhangpa2021 已提交
13237
     * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00800
Z
zhangpa2021 已提交
13238 13239 13240
     * @tc.name    Test that messageparcel passes through the same process, and the client
     *             receives the reply message in the callback function
     * @tc.desc    Function test
13241
     * @tc.level   3
Z
zhangpa2021 已提交
13242
     */
Y
yang-qibo 已提交
13243 13244 13245
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00800---------------------------");
            try{
13246
                let object = new TestAbilityStub("TestAbilityStub");
Y
yang-qibo 已提交
13247 13248 13249 13250
                var data = rpc.MessageParcel.create();
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00800: create object successfully.");
                var reply = rpc.MessageParcel.create();
                var option = new rpc.MessageOption();
13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261
                expect(data.writeInterfaceToken("TestAbilityStub")).assertTrue();
                expect(data.writeByte(2)).assertTrue();
                expect(data.writeShort(3)).assertTrue();
                expect(data.writeInt(4)).assertTrue();
                expect(data.writeLong(5)).assertTrue();
                expect(data.writeFloat(1.2)).assertTrue();
                expect(data.writeDouble(10.2)).assertTrue();
                expect(data.writeBoolean(true)).assertTrue();
                expect(data.writeChar(5)).assertTrue();
                expect(data.writeString("HelloWorld")).assertTrue();
                expect(data.writeSequenceable(new MySequenceable(1, "aaa"))).assertTrue();
Y
yang-qibo 已提交
13262 13263 13264

                function sendRequestCallback(result) {
                    try{
13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281
                        console.info("sendRequest Callback");
                        console.info("sendRequest done, error code: " + result.errCode);
                        expect(result.errCode).assertEqual(0);
                        result.reply.readException();
                        expect(result.reply.readByte()).assertEqual(2);
                        expect(result.reply.readShort()).assertEqual(3);
                        expect(result.reply.readInt()).assertEqual(4);
                        expect(result.reply.readLong()).assertEqual(5);
                        expect(result.reply.readFloat()).assertEqual(1.2);
                        expect(result.reply.readDouble()).assertEqual(10.2);
                        expect(result.reply.readBoolean()).assertTrue();
                        expect(result.reply.readChar()).assertEqual(5);
                        expect(result.reply.readString()).assertEqual("HelloWorld");
                        let s = new MySequenceable(null, null);
                        expect(result.reply.readSequenceable(s)).assertTrue();
                        expect(s.num).assertEqual(1);
                        expect(s.str).assertEqual("aaa");
Y
yang-qibo 已提交
13282 13283 13284
                    } finally {
                        result.data.reclaim();
                        result.reply.reclaim();
13285 13286
                        console.info("test done");
                        done();
Y
yang-qibo 已提交
13287 13288 13289
                    }
                }

13290 13291
                console.info("start send request");
                object.sendRequest(CODE_SAME_PROCESS, data, reply, option, sendRequestCallback);
Y
yang-qibo 已提交
13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302

            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00800:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00800---------------------------");
        });

        /*
     * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_00900
     * @tc.name    IRemoteObject sendMessageRequest API Test
     * @tc.desc    Function test
13303
     * @tc.level   3
Y
yang-qibo 已提交
13304 13305 13306 13307 13308 13309 13310 13311
     */
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_00900", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_00900---------------------------");
            try{
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00900: create object successfully.");
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
13312 13313 13314 13315 13316 13317 13318 13319 13320 13321
                data.writeByte(1);
                data.writeShort(2);
                data.writeInt(3);
                data.writeLong(10000);
                data.writeFloat(1.2);
                data.writeDouble(10.2);
                data.writeBoolean(true);
                data.writeChar(96);
                data.writeString("HelloWorld");
                data.writeParcelable(new MySequenceable(1, "aaa"));
Y
yang-qibo 已提交
13322 13323

                await gIRemoteObject.sendMessageRequest(CODE_ALL_TYPE, data, reply, option, (err, result) => {
13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338
                    console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00900 errorcode: " + result.errCode);
                    expect(result.errCode).assertEqual(0);
                    expect(result.reply.readByte()).assertEqual(1);
                    expect(result.reply.readShort()).assertEqual(2);
                    expect(result.reply.readInt()).assertEqual(3);
                    expect(result.reply.readLong()).assertEqual(10000);
                    expect(result.reply.readFloat()).assertEqual(1.2);
                    expect(result.reply.readDouble()).assertEqual(10.2);
                    expect(result.reply.readBoolean()).assertTrue();
                    expect(result.reply.readChar()).assertEqual(96);
                    expect(result.reply.readString()).assertEqual("HelloWorld");
                    let s = new MySequenceable(0, '');
                    expect(result.reply.readParcelable(s)).assertTrue();
                    expect(s.num).assertEqual(1);
                    expect(s.str).assertEqual("aaa");
Y
yang-qibo 已提交
13339 13340 13341
                });
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_00900:error = " + error);
Z
zhangpa2021 已提交
13342
            }
Y
yang-qibo 已提交
13343 13344 13345 13346 13347
            data.reclaim();
            reply.reclaim();
            done();
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_00900---------------------------");
        });
Y
yang-qibo 已提交
13348 13349 13350 13351 13352
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_01100
        * @tc.name    getDescriptor to get the interface description
        * @tc.desc    Function test
13353
        * @tc.level   3
Y
yang-qibo 已提交
13354 13355 13356 13357 13358 13359 13360
        */
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_01100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_01100---------------------------");
            try{
                let object = new TestAbilityMessageStub("Test1223");

                let result = object.isObjectDead();
13361
                expect(result == false).assertTrue();
Z
zhangpa2021 已提交
13362

13363
                let callingPid = object.getCallingPid();
Y
yang-qibo 已提交
13364 13365 13366 13367 13368
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01100: run getCallingPid success,callingPid " + callingPid);
                expect(callingPid != null).assertTrue();
                let callingUid = object.getCallingUid()
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01100: run getCallingPid success,callingPid " + callingUid);
                expect(callingUid != null).assertTrue();
13369
                object.modifyLocalInterface(object, "test1");
Y
yang-qibo 已提交
13370
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01100: run modifyLocalInterface success");
Z
zhangpa2021 已提交
13371

Y
yang-qibo 已提交
13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382
                let result2 = object.getDescriptor();
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01100: run getDescriptor is " + result2);
                expect(result2 != null).assertTrue();

            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01100:error = " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_01100---------------------------");
        });  
        
Y
yang-qibo 已提交
13383
        /*
Y
yang-qibo 已提交
13384 13385 13386 13387
        * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_01200
        * @tc.name    Test that MessageSequence passes through the same process, and the client
        *             receives the reply message in the callback function
        * @tc.desc    Function test
13388
        * @tc.level   3
Y
yang-qibo 已提交
13389 13390 13391 13392
        */
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_01200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_01200---------------------------");
            try{
13393
                let object = new TestAbilityMessageStub("TestAbilityMessageStub");
Y
yang-qibo 已提交
13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412
                var data = rpc.MessageSequence.create();
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01200: create object successfully.");
                var reply = rpc.MessageSequence.create();
                var option = new rpc.MessageOption();
                data.writeInterfaceToken("TestAbilityMessageStub");
                data.writeByte(2);
                data.writeShort(3);
                data.writeInt(4);
                data.writeLong(5);
                data.writeFloat(1.2);
                data.writeDouble(10.2);
                data.writeBoolean(true);
                data.writeChar(5);
                data.writeString("HelloWorld");
                data.writeParcelable(new MySequenceable(1, "aaa"));
                console.info("data is success");

                function sendRequestCallback(result) {
                    try{
13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429
                        console.info("sendRequest Callback");
                        console.info("sendRequest done, error code: " + result.errCode);
                        expect(result.errCode).assertEqual(0);
                        result.reply.readException();
                        expect(result.reply.readByte()).assertEqual(2);
                        expect(result.reply.readShort()).assertEqual(3);
                        expect(result.reply.readInt()).assertEqual(4);
                        expect(result.reply.readLong()).assertEqual(5);
                        expect(result.reply.readFloat()).assertEqual(1.2);
                        expect(result.reply.readDouble()).assertEqual(10.2);
                        expect(result.reply.readBoolean()).assertTrue();
                        expect(result.reply.readChar()).assertEqual(5);
                        expect(result.reply.readString()).assertEqual("HelloWorld");
                        let s = new MySequenceable(null, null);
                        expect(result.reply.readParcelable(s)).assertTrue();
                        expect(s.num).assertEqual(1);
                        expect(s.str).assertEqual("aaa");
Y
yang-qibo 已提交
13430 13431 13432
                    } finally {
                        result.data.reclaim();
                        result.reply.reclaim();
13433 13434
                        console.info("test done");
                        done();
Y
yang-qibo 已提交
13435 13436 13437
                    }
                }

13438 13439
                console.info("start send request");
                object.sendMessageRequest(CODE_SAME_PROCESS, data, reply, option, sendRequestCallback);
Y
yang-qibo 已提交
13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461

            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01200:error = " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_01200---------------------------");
        });
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_01300
        * @tc.name    Iremoteobject, register death notification verification
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_01300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_01300---------------------------");
            try{
                let recipient = new MyregisterDeathRecipient(gIRemoteObject, null);
                gIRemoteObject.registerDeathRecipient(recipient, 0)
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01300:run registerDeathRecipient is done");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01300:error = " + error);
13462
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
13463 13464 13465 13466 13467 13468 13469 13470
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_01300---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IRemoteObject_01400
        * @tc.name    Iremoteobject, register death notification verification
        * @tc.desc    Function test
13471
        * @tc.level   3
Y
yang-qibo 已提交
13472 13473 13474 13475 13476
        */
        it("SUB_Softbus_IPC_Compatibility_IRemoteObject_01400", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IRemoteObject_01400---------------------------");
            try{
                let recipient = new MyregisterDeathRecipient(gIRemoteObject, null);
13477
                gIRemoteObject.registerDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13478
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01400:run registerDeathRecipient is done");
13479
                gIRemoteObject.unregisterDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13480 13481 13482
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01400:run unregisterDeathRecipient is done");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IRemoteObject_01400:error = " + error);
13483
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
13484 13485 13486 13487 13488 13489 13490 13491 13492 13493
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IRemoteObject_01400---------------------------");
        });               

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_00100
        * @tc.name    Call adddeathrecipient to register the death notification
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
13494 13495 13496
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_00100---------------------------");
            try{
13497 13498
                let recipient = new MyDeathRecipient(gIRemoteObject, null);
                var resultAdd1 = gIRemoteObject.addDeathRecipient(recipient, 0);
13499
                expect(resultAdd1 == false).assertTrue();
13500
                var resultAdd2 = gIRemoteObject.addDeathRecipient(recipient, 0);
13501
                expect(resultAdd2 == false).assertTrue();
13502
                var resultRemove1 = gIRemoteObject.removeDeathRecipient(recipient, 0);
13503
                expect(resultRemove1 == false).assertTrue();
J
jiyong 已提交
13504

13505
                var resultRemove2 = gIRemoteObject.removeDeathRecipient(recipient, 0);
13506
                expect(resultRemove2 == false).assertTrue();
J
jiyong 已提交
13507

13508
                var resultRemove3 = gIRemoteObject.removeDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13509 13510 13511 13512 13513 13514
                expect(resultRemove3 == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00100:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00100---------------------------");
        });
Y
yang-qibo 已提交
13515

Y
yang-qibo 已提交
13516
        /*
Y
yang-qibo 已提交
13517 13518 13519
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_00200
        * @tc.name    AddDeathRecipient Validates the interface flags input parameter boundary value
        * @tc.desc    Function test
13520
        * @tc.level   3
Y
yang-qibo 已提交
13521
        */
Y
yang-qibo 已提交
13522 13523 13524 13525 13526
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00200", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_00200---------------------------");
            try{
                let recipient = new MyDeathRecipient(gIRemoteObject, null);
                var resultAdd = gIRemoteObject.addDeathRecipient(recipient, -(2*G));
13527
                expect(resultAdd == false).assertTrue();
Y
yang-qibo 已提交
13528
                var resultRemove = gIRemoteObject.removeDeathRecipient(recipient, -(2*G));
13529
                expect(resultRemove == false).assertTrue();
Y
yang-qibo 已提交
13530 13531 13532 13533 13534
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00200:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00200---------------------------");
        });
Y
yang-qibo 已提交
13535

Y
yang-qibo 已提交
13536
        /*
Y
yang-qibo 已提交
13537 13538 13539
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_00300
        * @tc.name    AddDeathRecipient Validates the interface flags input parameter boundary value
        * @tc.desc    Function test
13540
        * @tc.level   3
Y
yang-qibo 已提交
13541
        */
Y
yang-qibo 已提交
13542 13543 13544 13545 13546
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_00300---------------------------");
            try{
                let recipient = new MyDeathRecipient(gIRemoteObject, null);
                var resultAdd = gIRemoteObject.addDeathRecipient(recipient, (2*G - 1));
13547
                expect(resultAdd == false).assertTrue();
Y
yang-qibo 已提交
13548
                var resultRemove = gIRemoteObject.removeDeathRecipient(recipient, (2*G - 1));
13549
                expect(resultRemove == false).assertTrue();
Y
yang-qibo 已提交
13550 13551 13552 13553 13554
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00300:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00300---------------------------");
        });
Y
yang-qibo 已提交
13555

Y
yang-qibo 已提交
13556
        /*
Y
yang-qibo 已提交
13557 13558 13559
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_00400
        * @tc.name    AddDeathRecipient Validates the interface flags input parameter boundary value
        * @tc.desc    Function test
13560
        * @tc.level   3
Y
yang-qibo 已提交
13561
        */
Y
yang-qibo 已提交
13562 13563 13564 13565 13566 13567
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00400", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_00400---------------------------");
            try{
                let recipient = new MyDeathRecipient(gIRemoteObject, null);
                var resultAdd = gIRemoteObject.addDeathRecipient(recipient, 2*G);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00400:run addDeathRecipient first is " + resultAdd);
13568
                expect(resultAdd == false).assertTrue();
Y
yang-qibo 已提交
13569 13570
                var resultRemove = gIRemoteObject.removeDeathRecipient(recipient, 2*G);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00400:run removeDeathRecipient1 is " + resultRemove);
13571
                expect(resultRemove == false).assertTrue();
Y
yang-qibo 已提交
13572 13573 13574 13575 13576
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00400:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00400---------------------------");
        });
Y
yang-qibo 已提交
13577

Y
yang-qibo 已提交
13578
        /*
Y
yang-qibo 已提交
13579 13580 13581
        * @tc.number  sendfile/trans_file_func_test.cppRemoteProxy_00500
        * @tc.name    AddDeathRecipient Validates the interface flags input parameter boundary value
        * @tc.desc    Function test
13582
        * @tc.level   3
Y
yang-qibo 已提交
13583
        */
Y
yang-qibo 已提交
13584 13585 13586 13587 13588 13589
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00500", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_00500---------------------------");
            try{
                let recipient = new MyDeathRecipient(gIRemoteObject, null);
                var resultAdd = gIRemoteObject.addDeathRecipient(recipient, -(2*G + 1));
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00500:run addDeathRecipient first is " + resultAdd);
13590
                expect(resultAdd == false).assertTrue();
Y
yang-qibo 已提交
13591 13592
                var resultRemove = gIRemoteObject.removeDeathRecipient(recipient, -(2*G + 1));
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00500:run removeDeathRecipient1 is " + resultRemove);
13593
                expect(resultRemove == false).assertTrue();
Y
yang-qibo 已提交
13594 13595 13596 13597 13598
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00500:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00500---------------------------");
        });
J
jiyong 已提交
13599

Y
yang-qibo 已提交
13600
        /*
Y
yang-qibo 已提交
13601 13602 13603
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_00600
        * @tc.name    Call isobjectdead to check whether the object is dead
        * @tc.desc    Function test
13604
        * @tc.level   3
Y
yang-qibo 已提交
13605
        */
Y
yang-qibo 已提交
13606 13607 13608
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_00600---------------------------");
            try{
13609
                let recipient = new MyDeathRecipient(gIRemoteObject, null);
Y
yang-qibo 已提交
13610 13611 13612
                var isDead = gIRemoteObject.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600: run isObjectDead result is " + isDead);
                expect(isDead == false).assertTrue();
Y
yang-qibo 已提交
13613

13614
                var resultAdd1 = gIRemoteObject.addDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13615
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run addDeathRecipient first result is " + resultAdd1);
13616
                expect(resultAdd1 == false).assertTrue();
J
jiyong 已提交
13617

Y
yang-qibo 已提交
13618 13619 13620
                var isDead1 = gIRemoteObject.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600: run isObjectDead result is " + isDead1);
                expect(isDead1 == false).assertTrue();
J
jiyong 已提交
13621

13622
                var resultRemove1 = gIRemoteObject.removeDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13623
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run removeDeathRecipient result is " + resultRemove1);
13624
                expect(resultRemove1 == false).assertTrue();
Y
yang-qibo 已提交
13625

13626
                var resultAdd2 = gIRemoteObject.addDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13627
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run addDeathRecipient second result is " + resultAdd2);
13628
                expect(resultAdd2 == false).assertTrue();
J
jiyong 已提交
13629

13630
                var resultRemove2 = gIRemoteObject.removeDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13631
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run removeDeathRecipient1 result is " + resultRemove2);
13632
                expect(resultRemove2 == false).assertTrue();
Y
yang-qibo 已提交
13633

13634
                var resultRemove3 = gIRemoteObject.removeDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13635 13636
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:run removeDeathRecipient3 result is " + resultRemove3);
                expect(resultRemove3 == false).assertTrue();
J
jiyong 已提交
13637

Y
yang-qibo 已提交
13638 13639 13640 13641 13642 13643 13644 13645
                var isDead2 = gIRemoteObject.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600: run isObjectDead2 result is " + isDead2);
                expect(isDead2 == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00600:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00600---------------------------");
        });
J
jiyong 已提交
13646

Y
yang-qibo 已提交
13647
        /*
Y
yang-qibo 已提交
13648 13649 13650 13651 13652
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_00700
        * @tc.name    Getinterfacedescriptor to get the object interface description
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
13653 13654 13655 13656
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_00700---------------------------");
            try{
                let object = new TestAbilityStub("Test0300");
J
jiyong 已提交
13657

13658
                let result = object.getInterfaceDescriptor();
Y
yang-qibo 已提交
13659 13660 13661 13662 13663 13664 13665
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00700: run getInterfaceDescriptor result is " + result);
                expect(result).assertEqual("Test0300");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00700:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00700---------------------------");
        });
J
jiyong 已提交
13666

Y
yang-qibo 已提交
13667
        /*
Y
yang-qibo 已提交
13668 13669 13670
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_00800
        * @tc.name    Querylocalinterface searches for objects based on descriptors
        * @tc.desc    Function test
13671
        * @tc.level   3
Y
yang-qibo 已提交
13672
        */
Y
yang-qibo 已提交
13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_00800---------------------------");
            try{
                let object = new TestAbilityStub("Test0400");

                let result = object.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00800: run getInterfaceDescriptor is " + result);
                expect(result).assertEqual(false);
                object.attachLocalInterface(object, "Test2");
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00800: run attachLocalInterface success");
                let res2 = object.queryLocalInterface('Test2');
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00800: run queryLocalInterface success, res2 is " + res2);
13685
                let resultDescrip = object.getInterfaceDescriptor();
Y
yang-qibo 已提交
13686 13687 13688 13689 13690 13691 13692 13693
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00800: run getInterfaceDescriptor success resultDescrip is "
                    + resultDescrip);
                expect(resultDescrip != null).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00800:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00800---------------------------");
        });
J
jiyong 已提交
13694

Y
yang-qibo 已提交
13695
        /*
Y
yang-qibo 已提交
13696 13697 13698 13699 13700
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_00900
        * @tc.name    Transaction constant validation
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_00900", 0, async function(){
            console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00900 is starting-------------")
            try {
                expect(rpc.RemoteProxy.PING_TRANSACTION).assertEqual(1599098439);
                expect(rpc.RemoteProxy.DUMP_TRANSACTION).assertEqual(1598311760);
                expect(rpc.RemoteProxy.INTERFACE_TRANSACTION).assertEqual(1598968902);
                expect(rpc.RemoteProxy.MIN_TRANSACTION_ID).assertEqual(0x1);
                expect(rpc.RemoteProxy.MAX_TRANSACTION_ID).assertEqual(0x00FFFFFF);
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_00900 error is" + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_00900---------------------------");
        })
Y
yang-qibo 已提交
13714

Y
yang-qibo 已提交
13715
        /*
Y
yang-qibo 已提交
13716 13717 13718
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01000
        * @tc.name    Call isobjectdead to check whether the object is dead
        * @tc.desc    Function test
13719
        * @tc.level   3
Y
yang-qibo 已提交
13720 13721 13722 13723
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01000---------------------------");
            try{
13724
                let recipient = new MyregisterDeathRecipient(gIRemoteObject, null);
Y
yang-qibo 已提交
13725 13726 13727 13728
                var isDead = gIRemoteObject.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000: run isObjectDead result is " + isDead);
                expect(isDead == false).assertTrue();

13729
                var resultAdd1 = gIRemoteObject.registerDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13730 13731 13732 13733 13734 13735
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000: registerDeathRecipient is success");

                var isDead1 = gIRemoteObject.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000: run isObjectDead result is " + isDead1);
                expect(isDead1 == false).assertTrue();

13736
                var resultRemove1 = gIRemoteObject.unregisterDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13737 13738
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000: unregisterDeathRecipient is success");

13739
                var resultAdd2 = gIRemoteObject.registerDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13740 13741
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000: registerDeathRecipient is success");

13742
                var resultRemove2 = gIRemoteObject.unregisterDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13743 13744
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000: unregisterDeathRecipient is success");

13745
                var resultRemove3 = gIRemoteObject.unregisterDeathRecipient(recipient, 0);
Y
yang-qibo 已提交
13746 13747 13748 13749 13750 13751 13752
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000: unregisterDeathRecipient is success");

                var isDead2 = gIRemoteObject.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000: run isObjectDead2 result is " + isDead2);
                expect(isDead2 == false).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01000:error = " + error);
13753
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01000---------------------------");
        });        
       
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01100
        * @tc.name    getDescriptor to get the object interface description
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01100---------------------------");
            try{
                let object = new TestAbilityStub("Test0300");
13768
                let result = object.getDescriptor();
Y
yang-qibo 已提交
13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01100: run getDescriptor result is " + result);
                expect(result).assertEqual("Test0300");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01100:error = " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01100---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01200
        * @tc.name    getLocalInterface searches for objects based on descriptors
        * @tc.desc    Function test
13782
        * @tc.level   3
Y
yang-qibo 已提交
13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01200", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01200---------------------------");
            try{
                let object = new TestAbilityStub("Test0400");

                let result = object.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01200: run getDescriptor is " + result);
                expect(result).assertEqual(false);
                object.modifyLocalInterface(object, "Test2");
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01200: run modifyLocalInterface success");
                let res2 = object.getLocalInterface('Test2');
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01200: run getLocalInterface success, res2 is " + res2);
                let resultDescrip = object.getDescriptor()
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01200: run getDescriptor success resultDescrip is " + resultDescrip);
                expect(resultDescrip != null).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01200:error = " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01200---------------------------");
        }); 
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01300
        * @tc.name    Call registerDeathRecipient to register the death notification
        * @tc.desc    Function test
13810
        * @tc.level   3
Y
yang-qibo 已提交
13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01300---------------------------");
            try{
                let recipient = new MyregisterDeathRecipient(gIRemoteObject, null);
                gIRemoteObject.registerDeathRecipient(recipient, 0);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300: registerDeathRecipient is success");
                gIRemoteObject.registerDeathRecipient(recipient, 0);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300: registerDeathRecipient is success");
                gIRemoteObject.unregisterDeathRecipient(recipient, 0);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300: unregisterDeathRecipient is success");
                gIRemoteObject.unregisterDeathRecipient(recipient, 0);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300: unregisterDeathRecipient is success");
                gIRemoteObject.unregisterDeathRecipient(recipient, 0);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300: unregisterDeathRecipient is success");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01300:error = " + error);
13828
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
13829 13830 13831 13832 13833 13834 13835 13836
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01300---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01400
        * @tc.name    registerDeathRecipient Validates the interface flags input parameter boundary value
        * @tc.desc    Function test
13837
        * @tc.level   3
Y
yang-qibo 已提交
13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01400", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01400---------------------------");
            try{
                let recipient = new MyregisterDeathRecipient(gIRemoteObject, null);
                gIRemoteObject.registerDeathRecipient(recipient, -(2*G));
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01400: registerDeathRecipient is success");
                gIRemoteObject.unregisterDeathRecipient(recipient, -(2*G));
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01400: unregisterDeathRecipient is success");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01400:error = " + error);
13849
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
13850 13851 13852 13853 13854 13855 13856 13857
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01400---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01500
        * @tc.name    registerDeathRecipient Validates the interface flags input parameter boundary value
        * @tc.desc    Function test
13858
        * @tc.level   3
Y
yang-qibo 已提交
13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01500", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01500---------------------------");
            try{
                let recipient = new MyregisterDeathRecipient(gIRemoteObject, null);
                gIRemoteObject.registerDeathRecipient(recipient, (2*G - 1));
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01500: registerDeathRecipient is success");
                gIRemoteObject.unregisterDeathRecipient(recipient, (2*G - 1));
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01500: unregisterDeathRecipient is success");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01500:error = " + error);
13870
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
13871 13872 13873 13874 13875 13876 13877 13878
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01500---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01600
        * @tc.name    registerDeathRecipient Validates the interface flags input parameter boundary value
        * @tc.desc    Function test
13879
        * @tc.level   3
Y
yang-qibo 已提交
13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01600", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01600---------------------------");
            try{
                let recipient = new MyregisterDeathRecipient(gIRemoteObject, null);
                var resultAdd = gIRemoteObject.registerDeathRecipient(recipient, 2*G);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01600: registerDeathRecipient is success");
                var resultRemove = gIRemoteObject.unregisterDeathRecipient(recipient, 2*G);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01600: unregisterDeathRecipient is success");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01600:error = " + error);
13891
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
13892 13893 13894 13895 13896 13897 13898 13899
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01600---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01700
        * @tc.name    registerDeathRecipient Validates the interface flags input parameter boundary value
        * @tc.desc    Function test
13900
        * @tc.level   3
Y
yang-qibo 已提交
13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01700", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01700---------------------------");
            try{
                let recipient = new MyregisterDeathRecipient(gIRemoteObject, null);
                var resultAdd = gIRemoteObject.registerDeathRecipient(recipient, -(2*G + 1));
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01700: registerDeathRecipient is success");
                var resultRemove = gIRemoteObject.unregisterDeathRecipient(recipient, -(2*G + 1));
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01700: unregisterDeathRecipient is success");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01700:error = " + error);
13912
                expect(error != null).assertTrue();
Y
yang-qibo 已提交
13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01700---------------------------");
        });
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_RemoteProxy_01800
        * @tc.name    getLocalInterface 1900005 searches for objects based on descriptors
        * @tc.desc    Function test
        * @tc.level   0
        */
        it("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_RemoteProxy_01800---------------------------");
            try{
                let object = new TestAbilityStub("Test0400");
                let result = object.isObjectDead();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800: run getDescriptor is " + result);
                expect(result).assertEqual(false);
                object.modifyLocalInterface(object, "Test2");
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800: run modifyLocalInterface success");
                let res2 = object.getLocalInterface(null);
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800: run getLocalInterface success, res2 is " + res2);
            } catch (error) {
13935
                let errCode = `${rpc.ErrorCode.ONLY_PROXY_OBJECT_PERMITTED_ERROR}`;
Y
yang-qibo 已提交
13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800:error = " + error.code);
                expect(error.code != errCode).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_RemoteProxy_01800:error = " + error.message);
                expect(error.message != null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_RemoteProxy_01800---------------------------");
        });         

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00100
        * @tc.name    Create an empty object and verify the function of the flushcommands interface
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
13950 13951 13952
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00100", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00100---------------------------");
            try {
13953
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00100");
Y
yang-qibo 已提交
13954 13955 13956 13957 13958 13959
                let remoteObject = new TestRemoteObject("aaa");
                let ret = rpc.IPCSkeleton.flushCommands(remoteObject);
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00100 RpcServer: flushCommands result: " + ret);
                expect(ret != null).assertTrue();
            }
            catch (error) {
13960
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00100 error is :" + error);
Y
yang-qibo 已提交
13961 13962 13963
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00100---------------------------");
        })
J
jiyong 已提交
13964

Y
yang-qibo 已提交
13965
        /*
Z
zhangpa2021 已提交
13966
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00200
J
jiyong 已提交
13967 13968
     * @tc.name    Create an empty object and verify the function of the flushcommands interface
     * @tc.desc    Function test
13969
     * @tc.level   3
J
jiyong 已提交
13970
     */
Y
yang-qibo 已提交
13971 13972 13973
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00200", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00200---------------------------");
            try {
13974
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00200 testcase");
Y
yang-qibo 已提交
13975 13976 13977 13978 13979 13980
                let remoteObject = {};
                let ret = rpc.IPCSkeleton.flushCommands(remoteObject);
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00200 RpcServer: flushCommands result: " + ret);
                expect(ret != null).assertTrue();
            }
            catch (error) {
13981
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00200 error is :" + error);
Y
yang-qibo 已提交
13982 13983 13984
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00200---------------------------");
        })
Y
yang-qibo 已提交
13985

Y
yang-qibo 已提交
13986
        /*
Z
zhangpa2021 已提交
13987
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300
Y
yang-qibo 已提交
13988 13989 13990 13991
     * @tc.name    Create an empty object and verify the function of the flushcommands interface
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
13992 13993 13994
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300---------------------------");
            try {
13995
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 testcase");
Y
yang-qibo 已提交
13996 13997 13998 13999 14000 14001 14002 14003
                let samgr = rpc.IPCSkeleton.getContextObject();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 getContextObject result: " + samgr);
                expect(samgr != null).assertTrue();
                let geinde = samgr.getInterfaceDescriptor();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 getInterfaceDescriptor result: " + geinde);
                expect(geinde).assertEqual("");
            }
            catch (error) {
14004
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300 error is :" + error);
Y
yang-qibo 已提交
14005 14006 14007
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00300---------------------------");
        })
Y
yang-qibo 已提交
14008

Y
yang-qibo 已提交
14009
        /*
Z
zhangpa2021 已提交
14010
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00400
Y
yang-qibo 已提交
14011 14012 14013 14014
     * @tc.name    Create an empty object and verify the function of the flushcommands interface
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
14015 14016 14017
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00400", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00400---------------------------");
            try {
14018
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00400 testcase");
Y
yang-qibo 已提交
14019 14020 14021 14022 14023 14024 14025 14026
                let getCallingPid = rpc.IPCSkeleton.getCallingPid();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00400 getCallingPid result: " + getCallingPid);
                expect(getCallingPid != null).assertTrue();
                let getCallingUid = rpc.IPCSkeleton.getCallingUid();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00400 getCallingUid result: " + getCallingUid);
                expect(getCallingUid != null).assertTrue();
            }
            catch (error) {
14027
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00400 error is :" + error);
Y
yang-qibo 已提交
14028 14029 14030
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00400---------------------------");
        })
Y
yang-qibo 已提交
14031

Y
yang-qibo 已提交
14032
        /*
Z
zhangpa2021 已提交
14033
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00500
Y
yang-qibo 已提交
14034 14035 14036 14037
     * @tc.name    Create an empty object and verify the function of the flushcommands interface
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
14038 14039 14040
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00500", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00500---------------------------");
            try {
14041
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00500 testcase");
Y
yang-qibo 已提交
14042 14043 14044 14045 14046 14047 14048 14049
                let getCallingPid = rpc.IPCSkeleton.getLocalDeviceID();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00500 getCallingPid result: " + getCallingPid);
                expect(getCallingPid != null).assertTrue();
                let getCallingUid = rpc.IPCSkeleton.getCallingDeviceID();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00500 getCallingUid result: " + getCallingUid);
                expect(getCallingUid != null).assertTrue();
            }
            catch (error) {
14050
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00500 error is :" + error);
Y
yang-qibo 已提交
14051 14052 14053
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00500---------------------------");
        })
J
jiyong 已提交
14054

Y
yang-qibo 已提交
14055
        /*
Z
zhangpa2021 已提交
14056
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600
J
jiyong 已提交
14057 14058 14059
     * @tc.name    Do not get the server agent, do not create a remoteobject instance, and directly getcallingpid,
     *             getcallingpid, getcallingdeviceid, getlocaldeviceid
     * @tc.desc    Function test
14060
     * @tc.level   3
J
jiyong 已提交
14061
     */
Y
yang-qibo 已提交
14062 14063 14064 14065 14066 14067
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600---------------------------");
            try{
                let getCallingPid = rpc.IPCSkeleton.getCallingPid();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600: run  getCallingPid result is :" + getCallingPid);
                expect(getCallingPid != null).assertTrue();
Z
zhangpa2021 已提交
14068

Y
yang-qibo 已提交
14069 14070 14071
                let getCallingUid = rpc.IPCSkeleton.getCallingUid();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600: run getCallingUid result is :" + getCallingUid);
                expect(getCallingUid != null).assertTrue();
Z
zhangpa2021 已提交
14072

Y
yang-qibo 已提交
14073 14074 14075
                let getCallingToKenId = rpc.IPCSkeleton.getCallingTokenId();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600: run getCallingToKenId result is :" + getCallingToKenId);
                expect(getCallingToKenId != null).assertTrue();
Z
zhangpa2021 已提交
14076

Y
yang-qibo 已提交
14077 14078 14079
                let getLocalDeviceID = rpc.IPCSkeleton.getLocalDeviceID();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600: run getLocalDeviceID result is :" + getLocalDeviceID);
                expect(getLocalDeviceID != null).assertTrue();
Z
zhangpa2021 已提交
14080

Y
yang-qibo 已提交
14081 14082 14083 14084 14085 14086 14087 14088
                let getCallingDeviceID = rpc.IPCSkeleton.getCallingDeviceID();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600: run getCallingDeviceID result is :" + getCallingDeviceID);
                expect(getCallingDeviceID != null).assertTrue();
            } catch (error){
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600: error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00600---------------------------");
        })
J
jiyong 已提交
14089

Y
yang-qibo 已提交
14090
        /*
Z
zhangpa2021 已提交
14091
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700
Y
yang-qibo 已提交
14092 14093
     * @tc.name    Basic method of testing ipcskeleton
     * @tc.desc    Function test
14094
     * @tc.level   3
Y
yang-qibo 已提交
14095
     */
Y
yang-qibo 已提交
14096 14097 14098 14099 14100 14101 14102 14103 14104 14105
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700---------------------------");
            try{
                expect(rpc.IPCSkeleton.getContextObject().getInterfaceDescriptor()).assertEqual("");
                let callingPid = rpc.IPCSkeleton.getCallingPid();
                let callingUid = rpc.IPCSkeleton.getCallingUid();
                let option = new rpc.MessageOption();
                let data = rpc.MessageParcel.create();
                let reply = rpc.MessageParcel.create();
                expect(data.writeInterfaceToken("rpcTestAbility")).assertTrue();
14106
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700: callingPid: " + callingPid
Y
yang-qibo 已提交
14107 14108 14109 14110
                    + ", callingUid: " + callingUid);
                expect(callingUid != null).assertTrue();
                expect(callingPid != null).assertTrue();
                await gIRemoteObject.sendRequest(CODE_IPCSKELETON, data, reply, option).then((result) => {
14111
                    console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700: sendRequest done, error code: " + result.errCode)
Y
yang-qibo 已提交
14112 14113 14114 14115
                    expect(result.errCode).assertEqual(0);
                    result.reply.readException();
                    let rescallingPid = result.reply.readInt();
                    let rescallingUid = result.reply.readInt();
14116
                    console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700:" + rescallingPid +" ;"+ rescallingUid);
Y
yang-qibo 已提交
14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127
                    expect(rescallingPid).assertEqual(callingPid);
                    expect(rescallingUid).assertEqual(callingUid);
                })
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00700---------------------------");
        });
Y
yang-qibo 已提交
14128

Y
yang-qibo 已提交
14129
        /*
Z
zhangpa2021 已提交
14130
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00800
Y
yang-qibo 已提交
14131 14132
     * @tc.name    Basic method of testing ipcskeleton
     * @tc.desc    Function test
14133
     * @tc.level   3
Y
yang-qibo 已提交
14134
     */
Y
yang-qibo 已提交
14135 14136 14137 14138 14139 14140 14141 14142 14143
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00800", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00800---------------------------");
            try{
                let callingPid = rpc.IPCSkeleton.getCallingPid();
                let callingUid = rpc.IPCSkeleton.getCallingUid();
                let option = new rpc.MessageOption();
                let data = rpc.MessageParcel.create();
                let reply = rpc.MessageParcel.create();
                expect(data.writeInterfaceToken("rpcTestAbility")).assertTrue();
14144
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00800: callingPid: " + callingPid
Y
yang-qibo 已提交
14145 14146
                    + ", callingUid: " + callingUid);
                await gIRemoteObject.sendRequest(CODE_IPCSKELETON_INT, data, reply, option).then((result) => {
14147
                    console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00800: sendRequest done, error code: " + result.errCode)
Y
yang-qibo 已提交
14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174
                    expect(result.errCode).assertEqual(0);
                    result.reply.readException();
                    let rescallingPid = result.reply.readInt();
                    let rescallingUid = result.reply.readInt();
                    let restcallingPid = result.reply.readInt();
                    let restcallingUid = result.reply.readInt();
                    let resicallingPid = result.reply.readInt();
                    let resicallingUid = result.reply.readInt();
                    let resflushCommands = result.reply.readInt();

                    console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00800:" + resicallingUid +" ;"+ resflushCommands);
                    expect(rescallingPid).assertEqual(callingPid);
                    expect(rescallingUid).assertEqual(callingUid);
                    expect(restcallingPid).assertEqual(callingPid);
                    expect(restcallingUid).assertEqual(callingUid);
                    expect(resicallingPid).assertEqual(callingPid);
                    expect(resicallingUid).assertEqual(callingUid);
                    expect(resflushCommands).assertEqual(101);
                })
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00800:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00800---------------------------");
        });
Y
yang-qibo 已提交
14175

Y
yang-qibo 已提交
14176
        /*
Z
zhangpa2021 已提交
14177
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_00900
Y
yang-qibo 已提交
14178 14179 14180 14181
     * @tc.name    SetCallingIdentity Interface flags input parameter boundary value verification
     * @tc.desc    Function test
     * @tc.level   0
     */
Y
yang-qibo 已提交
14182 14183 14184 14185 14186
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00900", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_00900---------------------------");
            try{
                let id = "";
                let ret = rpc.IPCSkeleton.setCallingIdentity(id);
14187
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00900: setCallingIdentity is: " + ret);
Y
yang-qibo 已提交
14188 14189 14190 14191 14192 14193
                expect(ret).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_00900:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_00900---------------------------");
        });
Y
yang-qibo 已提交
14194

Y
yang-qibo 已提交
14195
        /*
Z
zhangpa2021 已提交
14196
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01000
Y
yang-qibo 已提交
14197 14198
     * @tc.name    SetCallingIdentity Interface flags input parameter boundary value verification
     * @tc.desc    Function test
14199
     * @tc.level   3
Y
yang-qibo 已提交
14200
     */
Y
yang-qibo 已提交
14201 14202 14203 14204 14205
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01000", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01000---------------------------");
            try{
                let id = 0;
                let ret = rpc.IPCSkeleton.setCallingIdentity(id);
14206
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01000: setCallingIdentity is: " + ret);
Y
yang-qibo 已提交
14207 14208 14209 14210 14211 14212
                expect(ret).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01000:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01000---------------------------");
        });
Y
yang-qibo 已提交
14213

Y
yang-qibo 已提交
14214
        /*
Z
zhangpa2021 已提交
14215
     * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01100
Y
yang-qibo 已提交
14216 14217
     * @tc.name    SetCallingIdentity Interface flags input parameter boundary value verification
     * @tc.desc    Function test
14218
     * @tc.level   3
Y
yang-qibo 已提交
14219
     */
Y
yang-qibo 已提交
14220 14221 14222 14223 14224 14225 14226
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01100", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01100---------------------------");
            try{
                let id = "";
                for (let i = 0; i < (40*K - 1); i++){
                    id += "a";
                }
14227
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01100: id length is: " + id.length);
Y
yang-qibo 已提交
14228

Y
yang-qibo 已提交
14229
                let ret = rpc.IPCSkeleton.setCallingIdentity(id);
14230
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01100: setCallingIdentity is: " + ret);
Y
yang-qibo 已提交
14231 14232 14233 14234 14235 14236
                expect(ret).assertTrue();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01100:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01100---------------------------");
        });
14237

Y
yang-qibo 已提交
14238
        /*
Y
yang-qibo 已提交
14239 14240 14241 14242 14243
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200
        * @tc.name    Basic method of testing ipcskeleton
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
14244 14245 14246 14247 14248 14249 14250 14251 14252 14253
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200---------------------------");
            try{
                let object = rpc.IPCSkeleton.getContextObject();
                let callingPid = rpc.IPCSkeleton.getCallingPid();
                let callingUid = rpc.IPCSkeleton.getCallingUid();
                let callingDeviceID = rpc.IPCSkeleton.getCallingDeviceID();
                let localDeviceID = rpc.IPCSkeleton.getLocalDeviceID();
                let isLocalCalling = rpc.IPCSkeleton.isLocalCalling();
                let id = rpc.IPCSkeleton.resetCallingIdentity();
14254
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200:" + id);
Y
yang-qibo 已提交
14255 14256 14257 14258 14259 14260 14261
                let ret = rpc.IPCSkeleton.setCallingIdentity(id);
                expect(object.getInterfaceDescriptor()).assertEqual("");
                expect(callingDeviceID).assertEqual("");
                expect(localDeviceID).assertEqual("");
                expect(isLocalCalling).assertTrue();
                expect(id).assertEqual("");
                expect(ret).assertTrue();
14262
                expect(rpc.IPCSkeleton.flushCommands(gIRemoteObject)).assertEqual(101);
Y
yang-qibo 已提交
14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200: callingPid: " + callingPid
                    + ", callingUid: " + callingUid
                    + ", callingDeviceID: " + callingDeviceID + ", localDeviceID: " + localDeviceID
                    + ", isLocalCalling: " + isLocalCalling);
                let option = new rpc.MessageOption();
                let data = rpc.MessageParcel.create();
                let reply = rpc.MessageParcel.create();
                expect(data.writeInterfaceToken("rpcTestAbility")).assertTrue();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200: start send request");
                await gIRemoteObject.sendRequest(CODE_IPCSKELETON, data, reply, option).then(function(result) {
                    console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200: sendRequest done, error code: " + result.errCode)
                    expect(result.errCode).assertEqual(0);
                    result.reply.readException();
                    expect(result.reply.readInt()).assertEqual(callingPid);
                    expect(result.reply.readInt()).assertEqual(callingUid);
                    expect(result.reply.readString()).assertEqual("");
                    expect(result.reply.readString()).assertEqual("");
                    expect(result.reply.readBoolean()).assertTrue();
                    expect(result.reply.readInt()).assertEqual(callingPid);
                    expect(result.reply.readInt()).assertEqual(callingUid);
                    expect(result.reply.readInt()).assertEqual(callingPid);
                    expect(result.reply.readInt()).assertEqual(callingUid);
                    expect(result.reply.readInt()).assertEqual(101);
J
jiyong 已提交
14286
                })
Y
yang-qibo 已提交
14287 14288 14289 14290 14291 14292 14293 14294
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01200---------------------------");
        });
J
jiyong 已提交
14295

Y
yang-qibo 已提交
14296
        /*
Y
yang-qibo 已提交
14297 14298 14299 14300 14301
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300
        * @tc.name    IPCSkeleton sendMessageRequest API test
        * @tc.desc    Function test
        * @tc.level   0
        */
Y
yang-qibo 已提交
14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300", 0,async function(done){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300---------------------------");
            try{
                expect(rpc.IPCSkeleton.getContextObject().getInterfaceDescriptor()).assertEqual("");
                let callingPid = rpc.IPCSkeleton.getCallingPid();
                let callingUid = rpc.IPCSkeleton.getCallingUid();
                let option = new rpc.MessageOption();
                let data = rpc.MessageSequence.create();
                let reply = rpc.MessageSequence.create();
                data.writeInterfaceToken("rpcTestAbility")
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300 callingPid: " + callingPid
                    + ", callingUid: " + callingUid);
                expect(callingUid != null).assertTrue();
                expect(callingPid != null).assertTrue();
                await gIRemoteObject.sendMessageRequest(CODE_IPCSKELETON, data, reply, option).then((result) => {
                    console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300 sendRequest done, error code: " + result.errCode)
                    expect(result.errCode).assertEqual(0);
                    result.reply.readException();
                    let rescallingPid = result.reply.readInt();
                    let rescallingUid = result.reply.readInt();
                    console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300" + rescallingPid +" ;"+ rescallingUid);
                    expect(rescallingPid).assertEqual(callingPid);
                    expect(rescallingUid).assertEqual(callingUid);
                })
                data.reclaim();
                reply.reclaim();
                done();
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300:error = " + error);
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01300---------------------------");
        });
14334

Y
yang-qibo 已提交
14335 14336 14337 14338
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01400
        * @tc.name    Create an empty object and verify the function of the flushCmdBuffer interface
        * @tc.desc    Function test
14339
        * @tc.level   3
Y
yang-qibo 已提交
14340 14341 14342 14343 14344 14345 14346 14347 14348
        */
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01400", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01400---------------------------");
            try {
                let remoteObject = new TestRemoteObject("aaa");
                let ret = rpc.IPCSkeleton.flushCmdBuffer(remoteObject);
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01400 RpcServer: flushCmdBuffer is success");
            }
            catch (error) {
14349
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01400 error is :" + error);
Y
yang-qibo 已提交
14350 14351 14352 14353 14354 14355 14356 14357 14358
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01400---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01500
        * @tc.name    Create an empty object and verify the function of the flushCmdBuffer interface
        * @tc.desc    Function test
14359
        * @tc.level   3
Y
yang-qibo 已提交
14360 14361 14362 14363 14364 14365 14366 14367 14368
        */
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01500", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01500---------------------------");
            try {
                let remoteObject = {};
                let ret = rpc.IPCSkeleton.flushCmdBuffer(remoteObject);
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01500 RpcServer: flushCmdBuffer is success");
            }
            catch (error) {
14369
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01500 error is :" + error);
Y
yang-qibo 已提交
14370 14371 14372 14373 14374 14375 14376 14377 14378
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01500---------------------------");
        })

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600
        * @tc.name    Basic method of testing ipcskeleton 1900007
        * @tc.desc    Function test
14379
        * @tc.level   3
Y
yang-qibo 已提交
14380 14381 14382 14383 14384 14385 14386 14387
        */
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600---------------------------");
            try{
                let object = rpc.IPCSkeleton.getContextObject();
                object.getDescriptor();
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600: is success");
            } catch (error) {
14388
                let errCode = `${rpc.ErrorCode.COMMUNICATION_ERROR}`;
14389
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600 error is :" + error.message);
Y
yang-qibo 已提交
14390
                expect(error.message != null).assertTrue();
14391
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600 error is :" + error.code);
Y
yang-qibo 已提交
14392 14393 14394 14395 14396 14397 14398 14399 14400
                expect(error.code == errCode).assertTrue();           
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01600---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700
        * @tc.name    Create an empty object and verify the function of the flushCmdBuffer interface 1900006
        * @tc.desc    Function test
14401
        * @tc.level   3
Y
yang-qibo 已提交
14402 14403 14404 14405 14406 14407 14408 14409 14410
        */
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700", 0, async function() {
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700---------------------------");
            try {
                let remoteObject = null;
                rpc.IPCSkeleton.flushCmdBuffer(remoteObject);
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700 RpcServer: flushCmdBuffer is success");
            }
            catch (error) {
14411
                let errCode = `${rpc.ErrorCode.ONLY_REMOTE_OBJECT_PERMITTED_ERROR}`;
14412
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700 error is :" + error.message);
Y
yang-qibo 已提交
14413
                expect(error.message != null).assertTrue();
14414
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700 error is :" + error.code);
Y
yang-qibo 已提交
14415 14416 14417
                expect(error.code != errCode).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01700---------------------------");
14418 14419 14420 14421 14422 14423
        })
        
        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01800
        * @tc.name    restoreCallingIdentity Interface flags input parameter boundary value verification
        * @tc.desc    Function test
14424
        * @tc.level   3
14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442
        */
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01800", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01800---------------------------");
            try{
                let id = "";
                rpc.IPCSkeleton.restoreCallingIdentity(id);
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01800 restoreCallingIdentity is success");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01800:error = " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01800---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_01900
        * @tc.name    restoreCallingIdentity Interface flags input parameter 0 value verification
        * @tc.desc    Function test
14443
        * @tc.level   3
14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461
        */
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01900", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_01900---------------------------");
            try{
                let id = 0;
                rpc.IPCSkeleton.restoreCallingIdentity(id);
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01900 restoreCallingIdentity is success");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_01900:error = " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_01900---------------------------");
        });

        /*
        * @tc.number  SUB_Softbus_IPC_Compatibility_IPCSkeleton_02000
        * @tc.name    restoreCallingIdentity Interface flags input parameter null value verification
        * @tc.desc    Function test
14462
        * @tc.level   3
14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479
        */
        it("SUB_Softbus_IPC_Compatibility_IPCSkeleton_02000", 0,async function(){
            console.info("---------------------start SUB_Softbus_IPC_Compatibility_IPCSkeleton_02000---------------------------");
            try{
                let id = "";
                for (let i = 0; i < (40*K - 1); i++){
                    id += "a";
                }
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_02000 id length is: " + id.length);
                rpc.IPCSkeleton.restoreCallingIdentity(id);
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_02000 restoreCallingIdentity is success");
            } catch (error) {
                console.info("SUB_Softbus_IPC_Compatibility_IPCSkeleton_02000:error = " + error);
                expect(error == null).assertTrue();
            }
            console.info("---------------------end SUB_Softbus_IPC_Compatibility_IPCSkeleton_02000---------------------------");
        });        
Y
yang-qibo 已提交
14480 14481
        console.info("-----------------------SUB_Softbus_IPC_Compatibility_MessageParce_Test is end-----------------------");
    });
Z
zhangpa2021 已提交
14482
}