14514f5e3Sopenharmony_ci/*
24514f5e3Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
34514f5e3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
44514f5e3Sopenharmony_ci * you may not use this file except in compliance with the License.
54514f5e3Sopenharmony_ci * You may obtain a copy of the License at
64514f5e3Sopenharmony_ci *
74514f5e3Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
84514f5e3Sopenharmony_ci *
94514f5e3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
104514f5e3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
114514f5e3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
124514f5e3Sopenharmony_ci * See the License for the specific language governing permissions and
134514f5e3Sopenharmony_ci * limitations under the License.
144514f5e3Sopenharmony_ci */
154514f5e3Sopenharmony_ci
164514f5e3Sopenharmony_ci/*
174514f5e3Sopenharmony_ci * @tc.name:sharedarray
184514f5e3Sopenharmony_ci * @tc.desc:test sharedarray
194514f5e3Sopenharmony_ci * @tc.type: FUNC
204514f5e3Sopenharmony_ci * @tc.require: issueI8QUU0
214514f5e3Sopenharmony_ci */
224514f5e3Sopenharmony_ci
234514f5e3Sopenharmony_ci// @ts-nocheck
244514f5e3Sopenharmony_cideclare function print(str: any): string;
254514f5e3Sopenharmony_cideclare function isSendable(obj: lang.ISendable | Object): boolean;
264514f5e3Sopenharmony_ci
274514f5e3Sopenharmony_ciclass SendableClass {
284514f5e3Sopenharmony_ci    constructor() {
294514f5e3Sopenharmony_ci        "use sendable"
304514f5e3Sopenharmony_ci    }
314514f5e3Sopenharmony_ci}
324514f5e3Sopenharmony_ci
334514f5e3Sopenharmony_ciclass UnSendableClass {
344514f5e3Sopenharmony_ci    constructor() {
354514f5e3Sopenharmony_ci        "not sendable"
364514f5e3Sopenharmony_ci    }
374514f5e3Sopenharmony_ci}
384514f5e3Sopenharmony_ci
394514f5e3Sopenharmony_cisendCs = new SendableClass();
404514f5e3Sopenharmony_ciif (isSendable(sendCs)) {
414514f5e3Sopenharmony_ci    print("Sendable class is sendable");
424514f5e3Sopenharmony_ci} else {
434514f5e3Sopenharmony_ci    print("Sendable class is not sendable");
444514f5e3Sopenharmony_ci}
454514f5e3Sopenharmony_ci
464514f5e3Sopenharmony_cinoSendCs = new UnSendableClass();
474514f5e3Sopenharmony_ciif (isSendable(noSendCs)) {
484514f5e3Sopenharmony_ci    print("UnSendable class is sendable");
494514f5e3Sopenharmony_ci} else {
504514f5e3Sopenharmony_ci    print("UnSendable class is not sendable");
514514f5e3Sopenharmony_ci}
524514f5e3Sopenharmony_ci
534514f5e3Sopenharmony_cilet bool = true;
544514f5e3Sopenharmony_ciif (isSendable(bool)) {
554514f5e3Sopenharmony_ci    print("boolean is sendable");
564514f5e3Sopenharmony_ci} else {
574514f5e3Sopenharmony_ci    print("boolean is not sendable");
584514f5e3Sopenharmony_ci}
594514f5e3Sopenharmony_ci
604514f5e3Sopenharmony_ci
614514f5e3Sopenharmony_cilet str = "hello world";
624514f5e3Sopenharmony_ciif (isSendable(str)) {
634514f5e3Sopenharmony_ci    print("string is sendable");
644514f5e3Sopenharmony_ci} else {
654514f5e3Sopenharmony_ci    print("string is not sendable");
664514f5e3Sopenharmony_ci}
674514f5e3Sopenharmony_ci
684514f5e3Sopenharmony_cilet num = 0;
694514f5e3Sopenharmony_ciif (isSendable(num)) {
704514f5e3Sopenharmony_ci    print("number is sendable");
714514f5e3Sopenharmony_ci} else {
724514f5e3Sopenharmony_ci    print("number is not sendable");
734514f5e3Sopenharmony_ci}
744514f5e3Sopenharmony_ci
754514f5e3Sopenharmony_cilet bigInt = 124567890123456789012345678901234567890n;
764514f5e3Sopenharmony_ciif (isSendable(bigInt)) {
774514f5e3Sopenharmony_ci    print("bigInt is sendable");
784514f5e3Sopenharmony_ci} else {
794514f5e3Sopenharmony_ci    print("bigInt is not sendable");
804514f5e3Sopenharmony_ci}
814514f5e3Sopenharmony_ci
824514f5e3Sopenharmony_cifunction func()
834514f5e3Sopenharmony_ci{}
844514f5e3Sopenharmony_ciif (isSendable(func)) {
854514f5e3Sopenharmony_ci    print("function is sendable");
864514f5e3Sopenharmony_ci} else {
874514f5e3Sopenharmony_ci    print("function is not sendable");
884514f5e3Sopenharmony_ci}
894514f5e3Sopenharmony_ci
904514f5e3Sopenharmony_cifunction sendableFunc()
914514f5e3Sopenharmony_ci{
924514f5e3Sopenharmony_ci    "use sendable"
934514f5e3Sopenharmony_ci}
944514f5e3Sopenharmony_ciif (isSendable(func)) {
954514f5e3Sopenharmony_ci    print("sendableFunc is sendable");
964514f5e3Sopenharmony_ci} else {
974514f5e3Sopenharmony_ci    print("sendableFunc is not sendable");
984514f5e3Sopenharmony_ci}
994514f5e3Sopenharmony_ci
100