1/* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import {BusinessError} from "@ohos.base"; 16import * as test_primitives from "primitives_test"; 17import * as test_void_ns from "void_func"; 18 19loadLibrary("ani_primitives"); 20 21let primitivesTest: test_primitives.PrimitivesVoid = 22 test_primitives.get_interface(); 23let primitivesBoolTest: test_primitives.PrimitivesBoolean = 24 test_primitives.get_interface_bool(); 25let primitivesIntergerTest: test_primitives.PrimitivesInteger = 26 test_primitives.get_interface_interger(); 27 28function testMultiply() { 29 let res = test_primitives.Multiply(2, 4) 30 assertEQ(res, 8) 31} 32 33 34function testFunC1() { 35 let res = test_primitives.BaseCFunc(10) 36 assertEQ(res, true) 37} 38 39function testFunC2() { 40 let res = test_primitives.BaseCFunc(5) 41 assertEQ(res, false) 42} 43 44function testFunA1() { 45 test_primitives.BaseAFunc(true) 46} 47 48function testFunA2() { 49 test_primitives.BaseAFunc(false) 50} 51 52function testFunB1() { 53 let res = test_primitives.BaseBFunc(true) 54 assertEQ(res, false) 55} 56 57function testFunB2() { 58 let res = test_primitives.BaseBFunc(false) 59 assertEQ(res, true) 60} 61 62function testFunD1() { 63 let res = test_primitives.BaseDFunc("test123") 64 assertEQ(res, true) 65} 66 67function testFunD2() { 68 let res = test_primitives.BaseDFunc("test1231") 69 assertEQ(res, false) 70} 71 72function testFunE() { 73 const option: 74 test_primitives.Foo = {testNum: 2147483647, testStr: "path/to/source"}; 75 try { 76 let res = test_primitives.BaseEFunc(option) 77 assertEQ(res, "success") 78 } catch (error) { 79 console.error("Failed to parse res:", error); 80 } 81} 82 83function testFunH1() { 84 let res = test_primitives.BaseHFunc(2147483647, 9223372036854775807) 85 assertEQ(res, "-9223372034707292162") 86} 87 88function testFunH2() { 89 let res = test_primitives.BaseHFunc(-2147483648, -9223372036854775808) 90 assertEQ(res, "9223372034707292160") 91} 92 93function baseFunc1() { 94 let res = test_primitives.BaseFunc1(3.0 as float) 95 assertEQ(res, 4.0) 96} 97 98function baseFunc2() { 99 test_primitives.BaseFunc2(3.0 as float) 100} 101 102 103function baseFunc3() { 104 let res = test_primitives.BaseFunc3(3.0 as float, 3.14159265 as double) 105 console.log("tests baseFunc3" + res) 106} 107 108function baseFunc4() { 109 let res = test_primitives.BaseFunc4(3.0 as double) 110 console.log("tests baseFunc3" + res) 111} 112 113function baseFunc5() { 114 test_primitives.BaseFunc5(3.14159 as double) 115} 116 117function baseFunc6() { 118 test_primitives.BaseFunc6("testbaseFunc6") 119} 120 121function baseFunc6_1() { 122 test_primitives.BaseFunc6("testbaseFunc66") 123} 124 125function baseFunc7() { 126 let res = test_primitives.BaseFunc7("TestbaseFunc7") 127 assertEQ(res, "TestbaseFunc7") 128} 129 130function baseFunc7_1() { 131 let res = test_primitives.BaseFunc7("testbaseFunc77") 132 assertEQ(res, "testbaseFunc77false") 133} 134 135function baseFunc8() { 136 let res = test_primitives.BaseFunc8("TestBaseFunc8", 32) 137 assertEQ(res, "TestBaseFunc832") 138} 139 140function baseFunc8_1() { 141 let res = test_primitives.BaseFunc8("testbaseFunc88", 32) 142 assertEQ(res, "testbaseFunc88") 143} 144 145function baseFunc9() { 146 test_primitives.BaseFunc9( 147 "testbaseFunc9", 32, 9223372036854775807, true, 3.1 as float) 148} 149 150function testFunI1() { 151 let res = 152 test_primitives.BaseIFunc(3.1415926535897931 as double, 4.3 as float) 153 console.log("testFunI1 ", res) 154 assertEQ(res, "7.441593") 155} 156 157// function testFunI2(){ 158// let res = test_primitives.BaseIFunc(-1234567890.1234567 as double,-123.4 159// as float) console.log("testFunI2 ",res) 160// assertEQ(res,"-1234568013.523457") 161// } 162 163 164function baseFunc10() { 165 test_primitives.BaseFunc10() 166} 167 168function baseFunc11() { 169 test_primitives.BaseFunc11(32, true) 170} 171 172function baseFunc11_1() { 173 test_primitives.BaseFunc11(32, false) 174} 175 176function baseFunc12() { 177 test_primitives.BaseFunc12(32, 92233720368547758) 178} 179 180function baseFunc13() { 181 test_primitives.BaseFunc13(32, "testbaseFunc13") 182} 183 184function baseFunc14() { 185 test_primitives.BaseFunc14(92233720368547758, true) 186} 187 188 189function baseFunc14_1() { 190 test_primitives.BaseFunc14(92233720368547758, false) 191} 192 193function baseFunc15() { 194 test_primitives.BaseFunc15(32, 3.15 as float) 195} 196 197function baseFunc16() { 198 test_primitives.BaseFunc16(32, 3.141592653589793) 199} 200 201function baseFunc16_1() { 202 test_primitives.BaseFunc16(32, -3.141592653589793) 203} 204 205 206function baseFunc17() { 207 test_primitives.BaseFunc17(123.456 as float, true) 208} 209 210function baseFunc17_1() { 211 test_primitives.BaseFunc17(3.14159 as float, false) 212} 213 214function baseFunc18() { 215 test_primitives.BaseFunc18(123.456 as float, "testbaseFunc18") 216} 217 218function baseFunc18_1() { 219 test_primitives.BaseFunc18(3.14159 as float, "testbaseFunc18") 220} 221 222function baseFunc19() { 223 test_primitives.BaseFunc19(3.141592653589793, "testbaseFunc19") 224} 225 226function baseFunc20() { 227 test_primitives.BaseFunc20(3.141592653589793, true) 228} 229 230function baseFunc20_1() { 231 test_primitives.BaseFunc20(3.141592653589793, false) 232} 233 234function baseFunc21() { 235 test_primitives.BaseFunc21(32 as int, 65535 as long) 236} 237 238function baseFunc21_1() { 239 test_primitives.BaseFunc21(undefined, 65535 as long) 240} 241 242function baseFunc21_2() { 243 test_primitives.BaseFunc21(undefined, undefined) 244} 245 246function baseFunc21_3() { 247 test_primitives.BaseFunc21(32 as int, undefined) 248} 249 250function baseFunc22() { 251 test_primitives.BaseFunc22(3.14159 as float, 3.141592653589793) 252} 253 254function baseFunc22_1() { 255 test_primitives.BaseFunc22(undefined, 3.141592653589793) 256} 257 258function baseFunc22_2() { 259 test_primitives.BaseFunc22(undefined, undefined) 260} 261 262function baseFunc22_3() { 263 test_primitives.BaseFunc22(3.14159 as float, undefined) 264} 265 266function baseFunc23() { 267 test_primitives.BaseFunc23("testBaseFunc23", true) 268} 269 270function baseFunc23_1() { 271 test_primitives.BaseFunc23(undefined, false) 272} 273 274function baseFunc23_2() { 275 test_primitives.BaseFunc23(undefined, undefined) 276} 277 278function baseFunc23_3() { 279 test_primitives.BaseFunc23("testBaseFunc23", undefined) 280} 281 282function baseFunc24() { 283 test_primitives.BaseFunc24(32767 as short, 92233720368547758) 284} 285 286function baseFunc24_1() { 287 test_primitives.BaseFunc24(undefined, 92233720368547758) 288} 289 290function baseFunc24_2() { 291 test_primitives.BaseFunc24(undefined, undefined) 292} 293 294function baseFunc24_3() { 295 test_primitives.BaseFunc24(32767 as short, undefined) 296} 297 298function testCaseBaseFunc1() { 299 primitivesTest.TestBaseFunc1() 300} 301 302function testCaseBaseFunc2() { 303 primitivesTest.TestBaseFunc2(32, true) 304} 305 306function testCaseBaseFunc2_1() { 307 primitivesTest.TestBaseFunc2(32, false) 308} 309 310function testCaseBaseFunc3() { 311 primitivesTest.TestBaseFunc3(-2147483648, 92233720368547758) 312} 313 314function testCaseBaseFunc4() { 315 primitivesTest.TestBaseFunc4(2147483647, "testBaseFunc4") 316} 317 318function testCaseBaseFunc5() { 319 primitivesTest.TestBaseFunc5(-92233720368547758, true) 320} 321 322 323function testCaseBaseFunc5_1() { 324 primitivesTest.TestBaseFunc5(-92233720368547758, false) 325} 326 327function testCaseBaseFunc6() { 328 primitivesTest.TestBaseFunc6(32, 3.15 as float) 329} 330 331function testCaseBaseFunc7() { 332 primitivesTest.TestBaseFunc7(9223372036854775807, 3.141592653589793) 333} 334 335function testCaseBaseFunc7_1() { 336 primitivesTest.TestBaseFunc7(-9223372036854775808, -3.141592653589793) 337} 338 339 340function testCaseBaseFunc8() { 341 primitivesTest.TestBaseFunc8(123.456789 as float, true) 342} 343 344function testCaseBaseFunc8_1() { 345 primitivesTest.TestBaseFunc8(3.1415978 as float, false) 346} 347 348function testCaseBaseFunc9() { 349 primitivesTest.TestBaseFunc9(123.456789 as float, "testBaseFunc9") 350} 351 352function testCaseBaseFunc9_1() { 353 primitivesTest.TestBaseFunc9(3.1415978 as float, "testBaseFunc9") 354} 355 356function testCaseBaseFunc10() { 357 primitivesTest.TestBaseFunc10(-3.141592653589793, "testBaseFunc10") 358} 359 360function testCaseBaseFunc11() { 361 primitivesTest.TestBaseFunc11(-3.141592653589793, true) 362} 363 364function testCaseBaseFunc11_1() { 365 primitivesTest.TestBaseFunc11(-3.141592653589793, false) 366} 367 368function testCaseBaseFunc12() { 369 primitivesTest.TestBaseFunc12(256, 6553565536 as long) 370} 371 372function testCaseBaseFunc12_1() { 373 primitivesTest.TestBaseFunc12(undefined, 65535 as long) 374} 375 376function testCaseBaseFunc12_2() { 377 primitivesTest.TestBaseFunc12(undefined, undefined) 378} 379 380function testCaseBaseFunc12_3() { 381 primitivesTest.TestBaseFunc12(-65535, undefined) 382} 383 384function testCaseBaseFunc13() { 385 primitivesTest.TestBaseFunc13(-3.1415952 as float, 3.141592653589793) 386} 387 388function testCaseBaseFunc13_1() { 389 primitivesTest.TestBaseFunc13(undefined, 3.141592653589793) 390} 391 392function testCaseBaseFunc13_2() { 393 primitivesTest.TestBaseFunc13(undefined, undefined) 394} 395 396function testCaseBaseFunc13_3() { 397 primitivesTest.TestBaseFunc13(-3.1415952 as float, undefined) 398} 399 400function testCaseBaseFunc14() { 401 primitivesTest.TestBaseFunc14("testBaseFunc23", true) 402} 403 404function testCaseBaseFunc14_1() { 405 primitivesTest.TestBaseFunc14(undefined, false) 406} 407 408function testCaseBaseFunc14_2() { 409 primitivesTest.TestBaseFunc14(undefined, undefined) 410} 411 412function testCaseBaseFunc14_3() { 413 primitivesTest.TestBaseFunc14("testBaseFunc14", undefined) 414} 415 416function testCaseBaseFunc15() { 417 primitivesTest.TestBaseFunc15(32767 as short, 92233720368547758) 418} 419 420function testCaseBaseFunc15_1() { 421 primitivesTest.TestBaseFunc15(undefined, 92233720368547758) 422} 423 424function testCaseBaseFunc15_2() { 425 primitivesTest.TestBaseFunc15(undefined, undefined) 426} 427 428function testCaseBaseFunc15_3() { 429 primitivesTest.TestBaseFunc15(-32768 as short, undefined) 430} 431 432function testCaseBaseFunc16() { 433 primitivesTest.TestBaseFunc16(127 as byte, 32765 as short) 434} 435 436function testCaseBaseFunc16_1() { 437 primitivesTest.TestBaseFunc16(-128 as byte, -32765 as short) 438} 439 440 441function testCaseBaseFunc17() { 442 let intArray: int[] = [1, 2, 3, 4, 5]; 443 let byteArray: byte[] = [100, 101, 102]; 444 primitivesTest.TestBaseFunc17(intArray, byteArray) 445} 446 447function testCaseBaseFunc18() { 448 let shortArray: short[] = [32767, 32767, -32768, 4, 5]; 449 let longArray: long[] = 450 [10086, 10010, 10000, 9223372036854775807, -9223372036854775808]; 451 primitivesTest.TestBaseFunc18(shortArray, longArray) 452} 453 454function testCaseBaseFunc19() { 455 let floatArray: float[] = [3.14159f, 123.0f, -45678.5454f, 0.052f, 0.01f]; 456 let doubleArray: double[] = [ 457 10086.123456, -156.45678945, 3.141592345454545, 9223372036.854775807, 458 -922337203.6854775808 459 ]; 460 console.log("testCaseBaseFunc19 floatArray ", floatArray) 461 console.log("testCaseBaseFunc19 doubleArray ", doubleArray) 462 primitivesTest.TestBaseFunc19(floatArray, doubleArray) 463} 464 465function testCaseBaseFunc20() { 466 let booleanArray: boolean[] = [true, false, false, true, true]; 467 let strArray: string[] = 468 ["test1", "test111", "12345~!<>?|{}[]", "test333", "@#$$%^&&*123"]; 469 primitivesTest.TestBaseFunc20(booleanArray, strArray) 470} 471 472function testCaseBaseIntegerFunc1() { 473 try { 474 let temp = 255 as byte; 475 console.log("test error 1 ", temp) 476 let res = primitivesIntergerTest.TestBaseIntegerFunc1(temp) 477 } catch (e) { 478 assertEQ( 479 e.toString(), 480 "Error: out of range The i8 maximum value is 127 and minnum values is -128") 481 } 482} 483 484function testCaseBaseIntegerFunc1_1() { 485 let res = primitivesIntergerTest.TestBaseIntegerFunc1(100 as byte) 486 assertEQ(res, 101) 487} 488 489function testCaseBaseIntegerFunc2() { 490 try { 491 let temp = 255 as byte; 492 console.log("test error 2 ", temp) 493 let res = 494 primitivesIntergerTest.TestBaseIntegerFunc2(temp, 100 as short) 495 } catch (e) { 496 assertEQ( 497 e.toString(), 498 "Error: out of range The i8 maximum value is 127 and minnum values is -128") 499 } 500} 501 502function testCaseBaseIntegerFunc2_1() { 503 let res = 504 primitivesIntergerTest.TestBaseIntegerFunc2(100 as byte, 27 as short) 505 assertEQ(res, 127) 506} 507 508function testCaseBaseIntegerFunc2_2() { 509 try { 510 let temp = -1 as short; 511 console.log("test error 2_2 ", temp) 512 let res = primitivesIntergerTest.TestBaseIntegerFunc2(100 as byte, temp) 513 } catch (e) { 514 console.log("testCaseBaseIntegerFunc2_2 error ", e.toString()) 515 assertEQ( 516 e.toString(), 517 "Error: out of range The i16 maximum value is 32767 and minnum values is -32768") 518 } 519} 520 521 522function testCaseBaseIntegerFunc2_3() { 523 let res = 524 primitivesIntergerTest.TestBaseIntegerFunc2(100 as byte, 32667 as short) 525 assertEQ(res, -1) 526} 527 528function testCaseBaseIntegerFunc3() { 529 primitivesIntergerTest.TestBaseIntegerFunc3(100 as byte, 27 as short) 530} 531 532function testCaseBaseIntegerFunc4() { 533 let res = 534 primitivesIntergerTest.TestBaseIntegerFunc4(100 as byte, 32667 as short) 535 assertEQ(res, 32767) 536} 537 538function testCaseBaseIntegerFunc4_1() { 539 let res = primitivesIntergerTest.TestBaseIntegerFunc4( 540 127 as byte, -32768 as short) 541 assertEQ(res, -32641) 542} 543 544function testCaseBaseIntegerFunc4_2() { 545 let res = primitivesIntergerTest.TestBaseIntegerFunc4(0 as byte, 0 as short) 546 assertEQ(res, 0) 547} 548 549function testCaseBaseIntegerFunc5() { 550 let res = 551 primitivesIntergerTest.TestBaseIntegerFunc5(100 as byte, 2147483547) 552 assertEQ(res, -1) 553} 554 555function testCaseBaseIntegerFunc5_1() { 556 let res = 557 primitivesIntergerTest.TestBaseIntegerFunc5(-127 as byte, -2147483648) 558 assertEQ(res, -127) 559} 560 561function testCaseBaseIntegerFunc5_2() { 562 let res = primitivesIntergerTest.TestBaseIntegerFunc5(0 as byte, 100) 563 assertEQ(res, 100) 564} 565 566function testCaseBaseIntegerFunc6() { 567 let res = 568 primitivesIntergerTest.TestBaseIntegerFunc6(100 as byte, 2147483547) 569 assertEQ(res, 2147483647) 570} 571 572function testCaseBaseIntegerFunc6_1() { 573 let res = 574 primitivesIntergerTest.TestBaseIntegerFunc6(-127 as byte, -2147483648) 575 assertEQ(res, 2147483521) 576} 577 578function testCaseBaseIntegerFunc6_2() { 579 let res = primitivesIntergerTest.TestBaseIntegerFunc6(0 as byte, 0) 580 assertEQ(res, 0) 581} 582 583function testCaseBaseIntegerFunc7() { 584 primitivesIntergerTest.TestBaseIntegerFunc7(100 as byte, 2147483647) 585} 586 587function testCaseBaseIntegerFunc7_1() { 588 try { 589 primitivesIntergerTest.TestBaseIntegerFunc7(100 as byte, -1) 590 } catch (e) { 591 console.log("testCaseBaseIntegerFunc7_1 error ", e.toString()) 592 assertEQ( 593 e.toString(), 594 "Error: out of range The i32 maximum value is 2147483647 and minnum values is -2147483648") 595 } 596} 597 598function testCaseBaseIntegerFunc8() { 599 let res = primitivesIntergerTest.TestBaseIntegerFunc8( 600 100 as byte, 9223372036854775807) 601 assertEQ(res, 9223372036854775707) 602} 603 604function testCaseBaseIntegerFunc8_1() { 605 try { 606 primitivesIntergerTest.TestBaseIntegerFunc8(100 as byte, -1) 607 } catch (e) { 608 console.log("testCaseBaseIntegerFunc8_1 error ", e.toString()) 609 assertEQ( 610 e.toString(), 611 "Error: out of range The i64 maximum value is 9223372036854775807 and minnum values is -9223372036854775808") 612 } 613} 614 615function testCaseBaseIntegerFunc8_2() { 616 let res = primitivesIntergerTest.TestBaseIntegerFunc8( 617 100 as byte, -9223372036854775808) 618 assertEQ(res, 9223372036854775708) 619} 620 621function testCaseBaseIntegerFunc9() { 622 let res = primitivesIntergerTest.TestBaseIntegerFunc9(100 as byte, 227) 623 assertEQ(res, 127) 624} 625 626function testCaseBaseIntegerFunc9_1() { 627 let res = primitivesIntergerTest.TestBaseIntegerFunc9(-7 as byte, -120) 628 assertEQ(res, -113) 629} 630 631function testCaseBaseIntegerFunc10() { 632 let res = 633 primitivesIntergerTest.TestBaseIntegerFunc10(100 as byte, 3.14 as float) 634 assertEQ(res, 103.14 as float) 635} 636 637function testCaseBaseIntegerFunc10_1() { 638 let res = primitivesIntergerTest.TestBaseIntegerFunc10( 639 -7 as byte, -0.0005 as float) 640 assertEQ(res, -7.0005 as float) 641} 642 643function testCaseBaseIntegerFunc11() { 644 let res = 645 primitivesIntergerTest.TestBaseIntegerFunc11(100 as byte, 3.14 as float) 646 assertEQ(res, 103) 647} 648 649function testCaseBaseIntegerFunc11_1() { 650 let res = primitivesIntergerTest.TestBaseIntegerFunc11( 651 -7 as byte, -0.0005 as float) 652 assertEQ(res, -7) 653} 654 655function testCaseBaseIntegerFunc12() { 656 let res = 657 primitivesIntergerTest.TestBaseIntegerFunc12(100 as byte, 3.1415926) 658 assertEQ(res, 103.1415926) 659} 660 661function testCaseBaseIntegerFunc12_1() { 662 let res = primitivesIntergerTest.TestBaseIntegerFunc12(-7 as byte, -0.0005) 663 assertEQ(res, -7.0005) 664} 665 666function testCaseBaseIntegerFunc13() { 667 let res = primitivesIntergerTest.TestBaseIntegerFunc13(100 as byte, 27) 668 assertEQ(res, 127) 669} 670 671function testCaseBaseIntegerFunc13_1() { 672 let res = primitivesIntergerTest.TestBaseIntegerFunc13(-7 as byte, -121) 673 assertEQ(res, -128) 674} 675 676function testCaseBaseIntegerFunc14() { 677 let res = primitivesIntergerTest.TestBaseIntegerFunc14( 678 100 as byte, "TestBaseIntegerFunc14") 679 assertEQ(res, "TestBaseIntegerFunc14100") 680} 681 682function testCaseBaseIntegerFunc14_1() { 683 let res = primitivesIntergerTest.TestBaseIntegerFunc14( 684 -7 as byte, "testBaseIntegerFunc14_1") 685 assertEQ(res, "testBaseIntegerFunc14_1") 686} 687 688function testCaseBaseIntegerFunc15() { 689 let res = primitivesIntergerTest.TestBaseIntegerFunc15( 690 100 as byte, "TestBaseIntegerFunc15") 691 assertEQ(res, 110) 692} 693 694function testCaseBaseIntegerFunc15_1() { 695 let res = primitivesIntergerTest.TestBaseIntegerFunc15( 696 -7 as byte, "testBaseIntegerFunc15_1") 697 assertEQ(res, -7) 698} 699 700function testCaseBaseIntegerFunc16() { 701 let res = primitivesIntergerTest.TestBaseIntegerFunc16(100 as byte, true) 702 assertEQ(res, true) 703} 704 705function testCaseBaseIntegerFunc16_1() { 706 let res = primitivesIntergerTest.TestBaseIntegerFunc16(-7 as byte, false) 707 assertEQ(res, false) 708} 709 710function testCaseBaseIntegerFunc17() { 711 let res = primitivesIntergerTest.TestBaseIntegerFunc17(126 as byte, true) 712 assertEQ(res, 127) 713} 714 715function testCaseBaseIntegerFunc17_1() { 716 let res = primitivesIntergerTest.TestBaseIntegerFunc17(-126 as byte, false) 717 assertEQ(res, -126) 718} 719 720function testCaseBaseIntegerFunc18() { 721 try { 722 let res = primitivesIntergerTest.TestBaseIntegerFunc18(32767 as short) 723 } catch (e) { 724 assertEQ( 725 e.toString(), 726 "Error: TestBaseIntegerFunc18: result exceeds int16_t range") 727 } 728} 729 730function testCaseBaseIntegerFunc18_1() { 731 let res = primitivesIntergerTest.TestBaseIntegerFunc18(327 as short) 732 assertEQ(res, 3270) 733} 734 735function testCaseBaseIntegerFunc19() { 736 primitivesIntergerTest.TestBaseIntegerFunc19(32767 as short) 737} 738 739function testCaseBaseIntegerFunc19_1() { 740 primitivesIntergerTest.TestBaseIntegerFunc19(-32768 as short) 741} 742 743function testCaseBaseIntegerFunc20() { 744 try { 745 let res = 746 primitivesIntergerTest.TestBaseIntegerFunc20(32767 as short, 100) 747 } catch (e) { 748 assertEQ( 749 e.toString(), 750 "Error: TestBaseIntegerFunc20: result exceeds int16_t range") 751 } 752} 753 754function testCaseBaseIntegerFunc20_1() { 755 let res = primitivesIntergerTest.TestBaseIntegerFunc20(30000 as short, 2767) 756 assertEQ(res, 32767) 757} 758 759function testCaseBaseIntegerFunc21() { 760 try { 761 let res = primitivesIntergerTest.TestBaseIntegerFunc21( 762 100 as short, 9223372036854775807) 763 } catch (e) { 764 assertEQ( 765 e.toString(), 766 "Error: TestBaseIntegerFunc21: result exceeds int16_t range") 767 } 768} 769 770function testCaseBaseIntegerFunc21_1() { 771 let res = 772 primitivesIntergerTest.TestBaseIntegerFunc21(-30000 as short, -2768) 773 assertEQ(res, -32768) 774} 775 776function testCaseBaseIntegerFunc22() { 777 try { 778 let res = primitivesIntergerTest.TestBaseIntegerFunc22(2147483647) 779 } catch (e) { 780 assertEQ( 781 e.toString(), 782 "Error: TestBaseIntegerFunc22: result exceeds int32_t range") 783 } 784} 785 786function testCaseBaseIntegerFunc22_1() { 787 let res = primitivesIntergerTest.TestBaseIntegerFunc22(-21474836) 788 assertEQ(res, -2147483600) 789} 790 791function testCaseBaseIntegerFunc23() { 792 primitivesIntergerTest.TestBaseIntegerFunc23(2147483647) 793} 794 795function testCaseBaseIntegerFunc23_1() { 796 try { 797 primitivesIntergerTest.TestBaseIntegerFunc23(922337203) 798 } catch (e) { 799 assertEQ( 800 e.toString(), 801 "Error: TestBaseIntegerFunc22: result exceeds int32_t range") 802 } 803} 804 805function testCaseBaseIntegerFunc24() { 806 let res = primitivesIntergerTest.TestBaseIntegerFunc24(2147483646, 1) 807 assertEQ(res, 2147483647) 808} 809 810function testCaseBaseIntegerFunc24_1() { 811 try { 812 primitivesIntergerTest.TestBaseIntegerFunc24(32767, 9223372036854775807) 813 } catch (e) { 814 assertEQ( 815 e.toString(), 816 "Error: TestBaseIntegerFunc24: result exceeds int32_t range") 817 } 818} 819 820function testCaseBaseIntegerFunc25() { 821 let res = 822 primitivesIntergerTest.TestBaseIntegerFunc25(-2147483646, -2 as byte) 823 assertEQ(res, -2147483648) 824} 825 826function testCaseBaseIntegerFunc25_1() { 827 try { 828 primitivesIntergerTest.TestBaseIntegerFunc25(2147483647, 127 as byte) 829 } catch (e) { 830 assertEQ( 831 e.toString(), 832 "Error: TestBaseIntegerFunc24: result exceeds int32_t range") 833 } 834} 835 836function testCaseBaseIntegerFunc26() { 837 let res = primitivesIntergerTest.TestBaseIntegerFunc26(9223372036854775) 838 assertEQ(res, 922337203685477500) 839} 840 841function testCaseBaseIntegerFunc26_1() { 842 try { 843 let res = 844 primitivesIntergerTest.TestBaseIntegerFunc26(9223372036854775807) 845 } catch (e) { 846 assertEQ( 847 e.toString(), 848 "Error: TestBaseIntegerFunc24: result exceeds int64_t range") 849 } 850} 851 852function testCaseBaseIntegerFunc27() { 853 primitivesIntergerTest.TestBaseIntegerFunc27(-9223372036854775808) 854} 855 856function testCaseBaseIntegerFunc28() { 857 let res = primitivesIntergerTest.TestBaseIntegerFunc28( 858 9223372036854775, "TestBaseIntegerFunc28") 859 assertEQ(res, "TestBaseIntegerFunc289223372036854775") 860} 861 862function testCaseBaseIntegerFunc28_1() { 863 let res = primitivesIntergerTest.TestBaseIntegerFunc28( 864 9223372036854775, "testCaseBaseIntegerFunc28_1") 865 assertEQ(res, "testCaseBaseIntegerFunc28_1") 866} 867 868 869function testCaseBaseIntegerFunc29() { 870 let res = primitivesIntergerTest.TestBaseIntegerFunc29( 871 9223372036854, "TestBaseIntegerFunc29") 872 assertEQ(res, 92233720368540) 873} 874 875function testCaseBaseIntegerFunc29_1() { 876 try { 877 let res = primitivesIntergerTest.TestBaseIntegerFunc29( 878 9223372036854775807, "testBaseIntegerFunc29_1") 879 } catch (e) { 880 assertEQ( 881 e.toString(), 882 "Error: TestBaseIntegerFunc24: result exceeds int64_t range") 883 } 884} 885 886function testCaseBaseIntegerFunc30() { 887 let res: float = 888 primitivesIntergerTest.TestBaseIntegerFunc30(3.1415 as float) 889 assertEQ(res, 4.1415 as float) 890} 891 892function testCaseBaseIntegerFunc30_1() { 893 let res: float = 894 primitivesIntergerTest.TestBaseIntegerFunc30(-0.015 as float) 895 assertEQ(res, 0.985 as float) 896} 897 898function testCaseBaseIntegerFunc31() { 899 primitivesIntergerTest.TestBaseIntegerFunc31(-0.0151456 as float) 900} 901 902function testCaseBaseIntegerFunc31_1() { 903 primitivesIntergerTest.TestBaseIntegerFunc31(1.000123456789 as float) 904} 905 906function testCaseBaseIntegerFunc32() { 907 let res: float = 908 primitivesIntergerTest.TestBaseIntegerFunc32(-0.015 as float, 1.0) 909 assertEQ(res, 0.985 as float) 910} 911 912function testCaseBaseIntegerFunc32_1() { 913 let res: float = 914 primitivesIntergerTest.TestBaseIntegerFunc32(0.0001 as float, 100.12) 915 assertEQ(res, 100.1201 as float) 916} 917 918function testCaseBaseIntegerFunc33() { 919 let res: double = primitivesIntergerTest.TestBaseIntegerFunc33( 920 123.456 as float, 1000.11101) 921 console.log("testCaseBaseIntegerFunc33 res ", res) 922 let temp: double = Math.abs(res - 1123.56701); 923 console.log("testCaseBaseIntegerFunc33 temp ", temp) 924 const epsilon = Math.pow(10, -5); 925 console.log("testCaseBaseIntegerFunc33 epsilon ", epsilon) 926 let dif: boolean = temp < epsilon 927 assertEQ(dif, true) 928} 929 930function testCaseBaseIntegerFunc33_1() { 931 let res: double = 932 primitivesIntergerTest.TestBaseIntegerFunc33(-100.1111111 as float, 100) 933 console.log("testCaseBaseIntegerFunc33_1 res ", res) 934 let temp: double = Math.abs(res + 0.1111111); 935 console.log("testCaseBaseIntegerFunc33_1 temp ", temp) 936 const epsilon = Math.pow(10, -5); 937 console.log("testCaseBaseIntegerFunc33_1 epsilon ", epsilon) 938 let dif: boolean = temp < epsilon 939 assertEQ(dif, true) 940} 941 942function testCaseBaseIntegerFunc34() { 943 let res: double = 944 primitivesIntergerTest.TestBaseIntegerFunc34(3.141592653589793) 945 assertEQ(res, 4.141592653589793) 946} 947 948function testCaseBaseIntegerFunc34_1() { 949 let res: double = 950 primitivesIntergerTest.TestBaseIntegerFunc34(-0.000123456789) 951 assertEQ(res, 0.999876543211) 952} 953 954function testCaseBaseIntegerFunc35() { 955 primitivesIntergerTest.TestBaseIntegerFunc35(123456789.123456) 956} 957 958function testCaseBaseIntegerFunc35_1() { 959 primitivesIntergerTest.TestBaseIntegerFunc35(123456789.123456789123456789) 960} 961 962 963function testCaseBaseIntegerFunc36() { 964 let res: byte = primitivesIntergerTest.i8testattribute; 965 assertEQ(res, 127); 966} 967 968function testCaseBaseIntegerFunc37() { 969 let res: short = primitivesIntergerTest.i16testattribute; 970 assertEQ(res, -32768); 971} 972 973function testCaseBaseIntegerFunc38() { 974 let res: int = primitivesIntergerTest.i32testattribute; 975 assertEQ(res, 2147483647); 976} 977 978function testCaseBaseIntegerFunc39() { 979 let res: long = primitivesIntergerTest.i64testattribute; 980 assertEQ(res, 9223372036854775807); 981} 982 983function testCaseBaseIntegerFunc40() { 984 let res: float = primitivesIntergerTest.f32testattribute; 985 assertEQ(res, 3.14 as float); 986} 987 988function testCaseBaseIntegerFunc41() { 989 let res: double = primitivesIntergerTest.f64testattribute; 990 assertEQ(res, 123.45678); 991} 992 993 994function testCasetestBaseBoolFunc1() { 995 primitivesBoolTest.TestBaseBoolFunc1(true) 996} 997 998function testCasetestBaseBoolFunc1_1() { 999 primitivesBoolTest.TestBaseBoolFunc1(false) 1000} 1001 1002function testCasetestBaseBoolFunc2() { 1003 let res = primitivesBoolTest.TestBaseBoolFunc2(true) 1004 assertEQ(res, 65535) 1005} 1006 1007function testCasetestBaseBoolFunc2_1() { 1008 let res = primitivesBoolTest.TestBaseBoolFunc2(false) 1009 assertEQ(res, 0) 1010} 1011 1012function testCasetestBaseBoolFunc3() { 1013 let res = primitivesBoolTest.TestBaseBoolFunc3(true) 1014 assertEQ(res, false) 1015} 1016 1017function testCasetestBaseBoolFunc3_1() { 1018 let res = primitivesBoolTest.TestBaseBoolFunc3(false) 1019 assertEQ(res, true) 1020} 1021 1022function testCasetestBaseBoolFunc4() { 1023 let res = primitivesBoolTest.TestBaseBoolFunc4(true) 1024 assertEQ(res, false) 1025} 1026 1027function testCasetestBaseBoolFunc4_1() { 1028 let res = primitivesBoolTest.TestBaseBoolFunc4(false) 1029 assertEQ(res, false) 1030} 1031 1032function testCasetestBaseBoolFunc4_2() { 1033 let res = primitivesBoolTest.TestBaseBoolFunc4(undefined) 1034 assertEQ(res, true) 1035} 1036 1037function testCasetestBaseBoolFunc5() { 1038 let p = new Promise<boolean>((resolve, reject) => { 1039 primitivesBoolTest.TestBaseBoolFunc5Async( 1040 true, (err: BusinessError, data: boolean) => { 1041 if (err.code !== 0) { 1042 reject(err); 1043 } else { 1044 resolve(data); 1045 } 1046 }); 1047 }); 1048 let res: boolean; 1049 let err: BusinessError = new BusinessError(); 1050 try { 1051 res = await p; 1052 } catch (e) { 1053 err = e as BusinessError; 1054 } 1055 assertEQ(res, true); 1056} 1057 1058function testCasetestBaseBoolFunc5_1() { 1059 let p = new Promise<boolean>((resolve, reject) => { 1060 primitivesBoolTest.TestBaseBoolFunc5Async( 1061 false, (err: BusinessError, data: boolean) => { 1062 if (err.code !== 0) { 1063 reject(err); 1064 } else { 1065 resolve(data); 1066 } 1067 }); 1068 }); 1069 let res: boolean; 1070 let err: BusinessError = new BusinessError(); 1071 try { 1072 res = await p; 1073 } catch (e) { 1074 err = e as BusinessError; 1075 } 1076 assertEQ(res, false); 1077} 1078 1079function testCasetestBaseBoolFunc5_2() { 1080 try { 1081 let result: boolean = 1082 await primitivesBoolTest.TestBaseBoolFunc5Promise(true); 1083 assertEQ(result, true); 1084 console.log("testCasetestBaseBoolFunc5_2 result: " + result); 1085 } catch (error) { 1086 console.error("testCasetestBaseBoolFunc5_2 failed: " + error); 1087 } 1088} 1089 1090function testCasetestBaseBoolFunc5_3() { 1091 let result: boolean = primitivesBoolTest.TestBaseBoolFunc5(true); 1092 assertEQ(result, true); 1093} 1094 1095function testCasetestBaseBoolFunc6() { 1096 let result: boolean = 1097 test_primitives.PrimitivesBooleanClass.TestBaseBoolFunc6(); 1098 assertEQ(result, false); 1099} 1100 1101function testCasetestBaseBoolFunc7() { 1102 let result: boolean = primitivesBoolTest.boolTest; 1103 assertEQ(result, true); 1104} 1105 1106function testCasetestBaseBoolFunc8() { 1107 let testRecord: Record<string, boolean> = { 1108 "test1": false, 1109 "test2": false, 1110 "test3": false, 1111 "test4": true, 1112 }; 1113 let result: boolean = primitivesBoolTest.TestBaseBoolFunc7(testRecord); 1114 assertEQ(result, false); 1115} 1116 1117function testCasetestBaseBoolFunc8_1() { 1118 let testRecord: Record<string, boolean> = { 1119 "test1": true, 1120 "test2": false, 1121 "test3": false, 1122 "test4": true, 1123 }; 1124 let result: boolean = primitivesBoolTest.TestBaseBoolFunc7(testRecord); 1125 assertEQ(result, false); 1126} 1127 1128function testCasetestBaseBoolFunc8_2() { 1129 let testRecord: Record<string, boolean> = { 1130 "test1": false, 1131 "test2": false, 1132 "test3": false, 1133 "test4": false, 1134 }; 1135 let result: boolean = primitivesBoolTest.TestBaseBoolFunc7(testRecord); 1136 assertEQ(result, true); 1137} 1138 1139function testNsMyfunc1() { 1140 test_void_ns.mytest.Myfunc1(); 1141} 1142 1143function testNsMyfunc2() { 1144 test_void_ns.mytest.Myfunc2(120 as byte, 255 as short); 1145} 1146 1147function testNsMyfunc3() { 1148 test_void_ns.mytest.Myfunc3(10000, true); 1149} 1150 1151function testNsMyfunc3_1() { 1152 test_void_ns.mytest.Myfunc3(10000, false); 1153} 1154 1155function testNsMyfunc4() { 1156 test_void_ns.mytest.Myfunc4(25555, 9223372036854775807); 1157} 1158 1159function testNsMyfunc5() { 1160 test_void_ns.mytest.Myfunc5(2147483647, "testNsMyfunc5"); 1161} 1162 1163function testNsMyfunc6() { 1164 test_void_ns.mytest.Myfunc6(-9223372036854775808, true); 1165} 1166 1167function testNsMyfunc6_1() { 1168 test_void_ns.mytest.Myfunc6(2147483647, false); 1169} 1170 1171function testNsMyfunc7() { 1172 test_void_ns.mytest.Myfunc7(-2147483647, 3.12 as float); 1173} 1174 1175function testNsMyfunc8() { 1176 test_void_ns.mytest.Myfunc8(9223372036854775807, 1.123456789); 1177} 1178 1179 1180function testNsMyfunc9() { 1181 test_void_ns.mytest.Myfunc9(0.000123 as float, true); 1182} 1183 1184function testNsMyfunc10() { 1185 test_void_ns.mytest.Myfunc10(0.000123 as float, "testNsMyfunc10"); 1186} 1187 1188function testNsMyfunc11() { 1189 test_void_ns.mytest.Myfunc11(-0.000123, "testNsMyfunc11"); 1190} 1191 1192function testNsMyfunc12() { 1193 test_void_ns.mytest.Myfunc12(2147483647, 9223372036854775807); 1194} 1195 1196function testNsMyfunc12_1() { 1197 test_void_ns.mytest.Myfunc12(undefined, -9223372036854775808); 1198} 1199 1200function testNsMyfunc12_2() { 1201 test_void_ns.mytest.Myfunc12(undefined, undefined); 1202} 1203 1204function testNsMyfunc13() { 1205 test_void_ns.mytest.Myfunc13(3.11111 as float, 1.1245645); 1206} 1207 1208function testNsMyfunc13_1() { 1209 test_void_ns.mytest.Myfunc13(-3.11111 as float, undefined); 1210} 1211 1212function testNsMyfunc13_2() { 1213 test_void_ns.mytest.Myfunc13(undefined, undefined); 1214} 1215 1216function testNsMyfunc14() { 1217 test_void_ns.mytest.Myfunc14("testNsMyfunc14", true); 1218} 1219 1220function testNsMyfunc14_1() { 1221 test_void_ns.mytest.Myfunc14(undefined, undefined); 1222} 1223 1224function testNsMyfunc14_2() { 1225 test_void_ns.mytest.Myfunc14(undefined, false); 1226} 1227 1228function testNsMyfunc15() { 1229 test_void_ns.mytest.Myfunc15(32767 as short, 92233720368547758); 1230} 1231 1232function testNsMyfunc15_1() { 1233 test_void_ns.mytest.Myfunc15(-214748364 as short, undefined); 1234} 1235 1236function testNsMyfunc15_2() { 1237 test_void_ns.mytest.Myfunc15(undefined, undefined); 1238} 1239 1240function testNsMyfunc16() { 1241 test_void_ns.mytest.Myfunc16(255 as short, test_void_ns.mytest.BarTest.B) 1242} 1243 1244function testNsMyfunc16_1() { 1245 test_void_ns.mytest.Myfunc16(-32768 as short, test_void_ns.mytest.BarTest.A) 1246} 1247 1248function testNsMyfunc16_2() { 1249 test_void_ns.mytest.Myfunc16(0 as short, test_void_ns.mytest.BarTest.C) 1250} 1251 1252function testCaseConstant1() { 1253 let res: boolean = test_primitives.CONSTANT_BOOL_TRUE; 1254 assertEQ(res, true) 1255} 1256 1257function testCaseConstant2() { 1258 let res: boolean = test_primitives.CONSTANT_BOOL_FALSE; 1259 assertEQ(res, false) 1260} 1261 1262function testCaseConstant3() { 1263 let res: int = test_primitives.CONSTANT_I32_001; 1264 assertEQ(res, 10000) 1265} 1266 1267function testCaseConstant4() { 1268 let res: int = test_primitives.CONSTANT_I32_002; 1269 assertEQ(res, 10001) 1270} 1271 1272 1273function main() { 1274 console.log("run main ... test_primitives ...") 1275 const suite = new ArkTestsuite("test function primitives") 1276 1277 suite.addTest("check funcMultiply", testMultiply); 1278 suite.addTest("check testFunC1", testFunC1); 1279 suite.addTest("check testFunC2", testFunC2); 1280 suite.addTest("check testFunA1", testFunA1); 1281 suite.addTest("check testFunA2", testFunA2); 1282 suite.addTest("check testFunB1", testFunB1); 1283 suite.addTest("check testFunB2", testFunB2); 1284 suite.addTest("check testFunD1", testFunD1); 1285 suite.addTest("check testFunD2", testFunD2); 1286 suite.addTest("check testFunE", testFunE); 1287 suite.addTest("check testFunH1", testFunH1); 1288 suite.addTest("check testFunH2", testFunH2); 1289 suite.addTest("check testFunI1", testFunI1); 1290 // suite.addTest("check testFunI2", testFunI2); 1291 suite.addTest("check testbaseFunc1", baseFunc1); 1292 suite.addTest("check testbaseFunc2", baseFunc2); 1293 suite.addTest("check testbaseFunc3", baseFunc3); 1294 suite.addTest("check testbaseFunc4", baseFunc4); 1295 suite.addTest("check testbaseFunc5", baseFunc5); 1296 suite.addTest("check testbaseFunc6", baseFunc6); 1297 suite.addTest("check testbaseFunc7", baseFunc7); 1298 suite.addTest("check testbaseFunc8", baseFunc8); 1299 suite.addTest("check testbaseFunc6_1", baseFunc6_1); 1300 suite.addTest("check testbaseFunc7_1", baseFunc7_1); 1301 suite.addTest("check testbaseFunc8_1", baseFunc8_1); 1302 suite.addTest("check testbaseFunc9", baseFunc9); 1303 suite.addTest("check testbaseFunc10", baseFunc10); 1304 suite.addTest("check testbaseFunc11", baseFunc11); 1305 suite.addTest("check testbaseFunc11_1", baseFunc11_1); 1306 suite.addTest("check testbaseFunc12", baseFunc12); 1307 suite.addTest("check testbaseFunc13", baseFunc13); 1308 suite.addTest("check testbaseFunc14", baseFunc14); 1309 suite.addTest("check testbaseFunc14_1", baseFunc14_1); 1310 suite.addTest("check testbaseFunc15", baseFunc15); 1311 suite.addTest("check testbaseFunc16", baseFunc16); 1312 suite.addTest("check testbaseFunc16_1", baseFunc16_1); 1313 suite.addTest("check testbaseFunc17", baseFunc17); 1314 suite.addTest("check testbaseFunc17_1", baseFunc17_1); 1315 suite.addTest("check testbaseFunc18", baseFunc18); 1316 suite.addTest("check testbaseFunc18_1", baseFunc18_1); 1317 suite.addTest("check testbaseFunc19", baseFunc19); 1318 suite.addTest("check testbaseFunc20", baseFunc20); 1319 suite.addTest("check testbaseFunc20_1", baseFunc20_1); 1320 suite.addTest("check testbaseFunc21", baseFunc21); 1321 suite.addTest("check testbaseFunc21_1", baseFunc21_1); 1322 suite.addTest("check testbaseFunc21_2", baseFunc21_2); 1323 suite.addTest("check testbaseFunc21_3", baseFunc21_3); 1324 suite.addTest("check testbaseFunc22", baseFunc22); 1325 suite.addTest("check testbaseFunc22_1", baseFunc22_1); 1326 suite.addTest("check testbaseFunc22_2", baseFunc22_2); 1327 suite.addTest("check testbaseFunc22_3", baseFunc22_3); 1328 suite.addTest("check testbaseFunc23", baseFunc23); 1329 suite.addTest("check testbaseFunc23_1", baseFunc23_1); 1330 suite.addTest("check testbaseFunc23_2", baseFunc23_2); 1331 suite.addTest("check testbaseFunc23_3", baseFunc23_3); 1332 suite.addTest("check testbaseFunc24", baseFunc24); 1333 suite.addTest("check testbaseFunc24_1", baseFunc24_1); 1334 suite.addTest("check testbaseFunc24_2", baseFunc24_2); 1335 suite.addTest("check testbaseFunc24_3", baseFunc24_3); 1336 suite.addTest("check testCaseBaseFunc1", testCaseBaseFunc1); 1337 suite.addTest("check testCaseBaseFunc2", testCaseBaseFunc2); 1338 suite.addTest("check testCaseBaseFunc2_1", testCaseBaseFunc2_1); 1339 suite.addTest("check testCaseBaseFunc3", testCaseBaseFunc3); 1340 suite.addTest("check testCaseBaseFunc4", testCaseBaseFunc4); 1341 suite.addTest("check testCaseBaseFunc5", testCaseBaseFunc5); 1342 suite.addTest("check testCaseBaseFunc5_1", testCaseBaseFunc5_1); 1343 suite.addTest("check testCaseBaseFunc6", testCaseBaseFunc6); 1344 suite.addTest("check testCaseBaseFunc7", testCaseBaseFunc7); 1345 suite.addTest("check testCaseBaseFunc7_1", testCaseBaseFunc7_1); 1346 suite.addTest("check testCaseBaseFunc8", testCaseBaseFunc8); 1347 suite.addTest("check testCaseBaseFunc8_1", testCaseBaseFunc8_1); 1348 suite.addTest("check testCaseBaseFunc9", testCaseBaseFunc9); 1349 suite.addTest("check testCaseBaseFunc9_1", testCaseBaseFunc9_1); 1350 suite.addTest("check testCaseBaseFunc10", testCaseBaseFunc10); 1351 suite.addTest("check testCaseBaseFunc11", testCaseBaseFunc11); 1352 suite.addTest("check testCaseBaseFunc11_1", testCaseBaseFunc11_1); 1353 suite.addTest("check testCaseBaseFunc12", testCaseBaseFunc12); 1354 suite.addTest("check testCaseBaseFunc12_1", testCaseBaseFunc12_1); 1355 suite.addTest("check testCaseBaseFunc12_2", testCaseBaseFunc12_2); 1356 suite.addTest("check testCaseBaseFunc12_3", testCaseBaseFunc12_3); 1357 suite.addTest("check testCaseBaseFunc13", testCaseBaseFunc13); 1358 suite.addTest("check testCaseBaseFunc13_1", testCaseBaseFunc13_1); 1359 suite.addTest("check testCaseBaseFunc13_2", testCaseBaseFunc13_2); 1360 suite.addTest("check testCaseBaseFunc13_3", testCaseBaseFunc13_3); 1361 suite.addTest("check testCaseBaseFunc14", testCaseBaseFunc14); 1362 suite.addTest("check testCaseBaseFunc14_1", testCaseBaseFunc14_1); 1363 suite.addTest("check testCaseBaseFunc14_2", testCaseBaseFunc14_2); 1364 suite.addTest("check testCaseBaseFunc14_3", testCaseBaseFunc14_3); 1365 suite.addTest("check testCaseBaseFunc15", testCaseBaseFunc15); 1366 suite.addTest("check testCaseBaseFunc15_1", testCaseBaseFunc15_1); 1367 suite.addTest("check testCaseBaseFunc15_2", testCaseBaseFunc15_2); 1368 suite.addTest("check testCaseBaseFunc15_3", testCaseBaseFunc15_3); 1369 suite.addTest("check testCaseBaseFunc16", testCaseBaseFunc16); 1370 suite.addTest("check testCaseBaseFunc16_1", testCaseBaseFunc16_1); 1371 suite.addTest("check testCaseBaseFunc17", testCaseBaseFunc17); 1372 suite.addTest("check testCaseBaseFunc18", testCaseBaseFunc18); 1373 suite.addTest("check testCaseBaseFunc19", testCaseBaseFunc19); 1374 suite.addTest("check testCaseBaseFunc20", testCaseBaseFunc20); 1375 suite.addTest("check testCaseBaseIntegerFunc1", testCaseBaseIntegerFunc1); 1376 suite.addTest( 1377 "check testCaseBaseIntegerFunc1_1", testCaseBaseIntegerFunc1_1); 1378 suite.addTest("check testCaseBaseIntegerFunc2", testCaseBaseIntegerFunc2); 1379 suite.addTest( 1380 "check testCaseBaseIntegerFunc2_1", testCaseBaseIntegerFunc2_1); 1381 suite.addTest( 1382 "check testCaseBaseIntegerFunc2_2", testCaseBaseIntegerFunc2_2); 1383 suite.addTest( 1384 "check testCaseBaseIntegerFunc2_3", testCaseBaseIntegerFunc2_3); 1385 suite.addTest("check testCaseBaseIntegerFunc3", testCaseBaseIntegerFunc3); 1386 suite.addTest("check testCaseBaseIntegerFunc4", testCaseBaseIntegerFunc4); 1387 suite.addTest( 1388 "check testCaseBaseIntegerFunc4_1", testCaseBaseIntegerFunc4_1); 1389 suite.addTest( 1390 "check testCaseBaseIntegerFunc4_2", testCaseBaseIntegerFunc4_2); 1391 suite.addTest("check testCaseBaseIntegerFunc5", testCaseBaseIntegerFunc5); 1392 suite.addTest( 1393 "check testCaseBaseIntegerFunc5_1", testCaseBaseIntegerFunc5_1); 1394 suite.addTest( 1395 "check testCaseBaseIntegerFunc5_2", testCaseBaseIntegerFunc5_2); 1396 suite.addTest("check testCaseBaseIntegerFunc6", testCaseBaseIntegerFunc6); 1397 suite.addTest( 1398 "check testCaseBaseIntegerFunc6_1", testCaseBaseIntegerFunc6_1); 1399 suite.addTest( 1400 "check testCaseBaseIntegerFunc6_2", testCaseBaseIntegerFunc6_2); 1401 suite.addTest("check testCaseBaseIntegerFunc7", testCaseBaseIntegerFunc7); 1402 suite.addTest( 1403 "check testCaseBaseIntegerFunc7_1", testCaseBaseIntegerFunc7_1); 1404 suite.addTest("check testCaseBaseIntegerFunc8", testCaseBaseIntegerFunc8); 1405 suite.addTest( 1406 "check testCaseBaseIntegerFunc8_1", testCaseBaseIntegerFunc8_1); 1407 suite.addTest( 1408 "check testCaseBaseIntegerFunc8_2", testCaseBaseIntegerFunc8_2); 1409 suite.addTest("check testCaseBaseIntegerFunc9", testCaseBaseIntegerFunc9); 1410 suite.addTest( 1411 "check testCaseBaseIntegerFunc9_1", testCaseBaseIntegerFunc9_1); 1412 suite.addTest("check testCaseBaseIntegerFunc10", testCaseBaseIntegerFunc10); 1413 suite.addTest( 1414 "check testCaseBaseIntegerFunc10_1", testCaseBaseIntegerFunc10_1); 1415 suite.addTest("check testCaseBaseIntegerFunc11", testCaseBaseIntegerFunc11); 1416 suite.addTest( 1417 "check testCaseBaseIntegerFunc11_1", testCaseBaseIntegerFunc11_1); 1418 suite.addTest("check testCaseBaseIntegerFunc12", testCaseBaseIntegerFunc12); 1419 suite.addTest( 1420 "check testCaseBaseIntegerFunc12_1", testCaseBaseIntegerFunc12_1); 1421 suite.addTest("check testCaseBaseIntegerFunc13", testCaseBaseIntegerFunc13); 1422 suite.addTest( 1423 "check testCaseBaseIntegerFunc13_1", testCaseBaseIntegerFunc13_1); 1424 suite.addTest("check testCaseBaseIntegerFunc14", testCaseBaseIntegerFunc14); 1425 suite.addTest( 1426 "check testCaseBaseIntegerFunc14_1", testCaseBaseIntegerFunc14_1); 1427 suite.addTest("check testCaseBaseIntegerFunc15", testCaseBaseIntegerFunc15); 1428 suite.addTest( 1429 "check testCaseBaseIntegerFunc15_1", testCaseBaseIntegerFunc15_1); 1430 suite.addTest("check testCaseBaseIntegerFunc16", testCaseBaseIntegerFunc16); 1431 suite.addTest( 1432 "check testCaseBaseIntegerFunc16_1", testCaseBaseIntegerFunc16_1); 1433 suite.addTest("check testCaseBaseIntegerFunc17", testCaseBaseIntegerFunc17); 1434 suite.addTest( 1435 "check testCaseBaseIntegerFunc17_1", testCaseBaseIntegerFunc17_1); 1436 suite.addTest("check testCaseBaseIntegerFunc18", testCaseBaseIntegerFunc18); 1437 suite.addTest( 1438 "check testCaseBaseIntegerFunc18_1", testCaseBaseIntegerFunc18_1); 1439 suite.addTest("check testCaseBaseIntegerFunc19", testCaseBaseIntegerFunc19); 1440 suite.addTest( 1441 "check testCaseBaseIntegerFunc19_1", testCaseBaseIntegerFunc19_1); 1442 suite.addTest("check testCaseBaseIntegerFunc20", testCaseBaseIntegerFunc20); 1443 suite.addTest( 1444 "check testCaseBaseIntegerFunc20_1", testCaseBaseIntegerFunc20_1); 1445 suite.addTest("check testCaseBaseIntegerFunc21", testCaseBaseIntegerFunc21); 1446 suite.addTest( 1447 "check testCaseBaseIntegerFunc21_1", testCaseBaseIntegerFunc21_1); 1448 suite.addTest("check testCaseBaseIntegerFunc22", testCaseBaseIntegerFunc22); 1449 suite.addTest( 1450 "check testCaseBaseIntegerFunc22_1", testCaseBaseIntegerFunc22_1); 1451 suite.addTest("check testCaseBaseIntegerFunc23", testCaseBaseIntegerFunc23); 1452 suite.addTest( 1453 "check testCaseBaseIntegerFunc23_1", testCaseBaseIntegerFunc23_1); 1454 suite.addTest("check testCaseBaseIntegerFunc24", testCaseBaseIntegerFunc24); 1455 suite.addTest( 1456 "check testCaseBaseIntegerFunc24_1", testCaseBaseIntegerFunc24_1); 1457 suite.addTest("check testCaseBaseIntegerFunc25", testCaseBaseIntegerFunc25); 1458 suite.addTest( 1459 "check testCaseBaseIntegerFunc25_1", testCaseBaseIntegerFunc25_1); 1460 suite.addTest("check testCaseBaseIntegerFunc26", testCaseBaseIntegerFunc26); 1461 suite.addTest( 1462 "check testCaseBaseIntegerFunc26_1", testCaseBaseIntegerFunc26_1); 1463 suite.addTest("check testCaseBaseIntegerFunc27", testCaseBaseIntegerFunc27); 1464 suite.addTest("check testCaseBaseIntegerFunc28", testCaseBaseIntegerFunc28); 1465 suite.addTest( 1466 "check testCaseBaseIntegerFunc28_1", testCaseBaseIntegerFunc28_1); 1467 suite.addTest("check testCaseBaseIntegerFunc29", testCaseBaseIntegerFunc29); 1468 suite.addTest( 1469 "check testCaseBaseIntegerFunc29_1", testCaseBaseIntegerFunc29_1); 1470 suite.addTest("check testCaseBaseIntegerFunc30", testCaseBaseIntegerFunc30); 1471 suite.addTest( 1472 "check testCaseBaseIntegerFunc30_1", testCaseBaseIntegerFunc30_1); 1473 suite.addTest("check testCaseBaseIntegerFunc31", testCaseBaseIntegerFunc31); 1474 suite.addTest( 1475 "check testCaseBaseIntegerFunc31_1", testCaseBaseIntegerFunc31_1); 1476 suite.addTest("check testCaseBaseIntegerFunc32", testCaseBaseIntegerFunc32); 1477 suite.addTest( 1478 "check testCaseBaseIntegerFunc32_1", testCaseBaseIntegerFunc32_1); 1479 suite.addTest("check testCaseBaseIntegerFunc33", testCaseBaseIntegerFunc33); 1480 suite.addTest( 1481 "check testCaseBaseIntegerFunc33_1", testCaseBaseIntegerFunc33_1); 1482 suite.addTest("check testCaseBaseIntegerFunc34", testCaseBaseIntegerFunc34); 1483 suite.addTest( 1484 "check testCaseBaseIntegerFunc34_1", testCaseBaseIntegerFunc34_1); 1485 suite.addTest("check testCaseBaseIntegerFunc35", testCaseBaseIntegerFunc35); 1486 suite.addTest( 1487 "check testCaseBaseIntegerFunc35_1", testCaseBaseIntegerFunc35_1); 1488 suite.addTest("check testCaseBaseIntegerFunc36", testCaseBaseIntegerFunc36); 1489 suite.addTest("check testCaseBaseIntegerFunc37", testCaseBaseIntegerFunc37); 1490 suite.addTest("check testCaseBaseIntegerFunc38", testCaseBaseIntegerFunc38); 1491 suite.addTest("check testCaseBaseIntegerFunc39", testCaseBaseIntegerFunc39); 1492 suite.addTest("check testCaseBaseIntegerFunc40", testCaseBaseIntegerFunc40); 1493 suite.addTest("check testCaseBaseIntegerFunc41", testCaseBaseIntegerFunc41); 1494 suite.addTest("check testCasetestBaseBoolFunc1", testCasetestBaseBoolFunc1); 1495 suite.addTest( 1496 "check testCasetestBaseBoolFunc1_1", testCasetestBaseBoolFunc1_1); 1497 suite.addTest("check testCasetestBaseBoolFunc2", testCasetestBaseBoolFunc2); 1498 suite.addTest( 1499 "check testCasetestBaseBoolFunc2_1", testCasetestBaseBoolFunc2_1); 1500 suite.addTest("check testCasetestBaseBoolFunc3", testCasetestBaseBoolFunc3); 1501 suite.addTest( 1502 "check testCasetestBaseBoolFunc3_1", testCasetestBaseBoolFunc3_1); 1503 suite.addTest("check testCasetestBaseBoolFunc4", testCasetestBaseBoolFunc4); 1504 suite.addTest( 1505 "check testCasetestBaseBoolFunc4_1", testCasetestBaseBoolFunc4_1); 1506 suite.addTest( 1507 "check testCasetestBaseBoolFunc4_2", testCasetestBaseBoolFunc4_2); 1508 suite.addTest("check testCasetestBaseBoolFunc5", testCasetestBaseBoolFunc5); 1509 suite.addTest( 1510 "check testCasetestBaseBoolFunc5_1", testCasetestBaseBoolFunc5_1); 1511 suite.addTest( 1512 "check testCasetestBaseBoolFunc5_2", testCasetestBaseBoolFunc5_2); 1513 suite.addTest( 1514 "check testCasetestBaseBoolFunc5_3", testCasetestBaseBoolFunc5_3); 1515 suite.addTest("check testCasetestBaseBoolFunc6", testCasetestBaseBoolFunc6); 1516 suite.addTest("check testCasetestBaseBoolFunc7", testCasetestBaseBoolFunc7); 1517 suite.addTest("check testCasetestBaseBoolFunc8", testCasetestBaseBoolFunc8); 1518 suite.addTest( 1519 "check testCasetestBaseBoolFunc8_1", testCasetestBaseBoolFunc8_1); 1520 suite.addTest( 1521 "check testCasetestBaseBoolFunc8_2", testCasetestBaseBoolFunc8_2); 1522 // namspacevoid test 1523 suite.addTest("check testNsMyfunc1", testNsMyfunc1); 1524 suite.addTest("check testNsMyfunc2", testNsMyfunc2); 1525 suite.addTest("check testNsMyfunc3", testNsMyfunc3); 1526 suite.addTest("check testNsMyfunc3_1", testNsMyfunc3_1); 1527 suite.addTest("check testNsMyfunc4", testNsMyfunc4); 1528 suite.addTest("check testNsMyfunc5", testNsMyfunc5); 1529 suite.addTest("check testNsMyfunc6", testNsMyfunc6); 1530 suite.addTest("check testNsMyfunc6_1", testNsMyfunc6_1); 1531 suite.addTest("check testNsMyfunc7", testNsMyfunc7); 1532 suite.addTest("check testNsMyfunc8", testNsMyfunc8); 1533 suite.addTest("check testNsMyfunc9", testNsMyfunc9); 1534 suite.addTest("check testNsMyfunc10", testNsMyfunc10); 1535 suite.addTest("check testNsMyfunc11", testNsMyfunc11); 1536 suite.addTest("check testNsMyfunc12", testNsMyfunc12); 1537 suite.addTest("check testNsMyfunc12_1", testNsMyfunc12_1); 1538 suite.addTest("check testNsMyfunc12_2", testNsMyfunc12_2); 1539 suite.addTest("check testNsMyfunc13", testNsMyfunc13); 1540 suite.addTest("check testNsMyfunc13_1", testNsMyfunc13_1); 1541 suite.addTest("check testNsMyfunc13_2", testNsMyfunc13_2); 1542 suite.addTest("check testNsMyfunc14", testNsMyfunc14); 1543 suite.addTest("check testNsMyfunc14_1", testNsMyfunc14_1); 1544 suite.addTest("check testNsMyfunc14_2", testNsMyfunc14_2); 1545 suite.addTest("check testNsMyfunc15", testNsMyfunc15); 1546 suite.addTest("check testNsMyfunc15_1", testNsMyfunc15_1); 1547 suite.addTest("check testNsMyfunc15_2", testNsMyfunc15_2); 1548 suite.addTest("check testNsMyfunc16", testNsMyfunc16); 1549 suite.addTest("check testNsMyfunc16_1", testNsMyfunc16_1); 1550 suite.addTest("check testNsMyfunc16_2", testNsMyfunc16_2); 1551 suite.addTest("check testCaseConstant1", testCaseConstant1); 1552 suite.addTest("check testCaseConstant2", testCaseConstant2); 1553 suite.addTest("check testCaseConstant3", testCaseConstant3); 1554 suite.addTest("check testCaseConstant4", testCaseConstant4); 1555 exit(suite.run()) 1556} 1557