Changeset 13595 in josm for trunk/tools/japicc/modules/Internals/RegTests.pm
- Timestamp:
- 2018-04-02T23:20:00+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/japicc/modules/Internals/RegTests.pm
r12872 r13595 2 2 # A module with regression test suite 3 3 # 4 # Copyright (C) 2016-201 7Andrey Ponomarenko's ABI Laboratory4 # Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory 5 5 # 6 6 # Written by Andrey Ponomarenko 7 7 # 8 # This program is free software: you can redistribute it and/or modify 9 # it under the terms of the GNU General Public License or the GNU Lesser 10 # General Public License as published by the Free Software Foundation. 8 # This library is free software; you can redistribute it and/or 9 # modify it under the terms of the GNU Lesser General Public 10 # License as published by the Free Software Foundation; either 11 # version 2.1 of the License, or (at your option) any later version. 11 12 # 12 # This programis distributed in the hope that it will be useful,13 # This library is distributed in the hope that it will be useful, 13 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNUGeneral Public License for more details.15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 # Lesser General Public License for more details. 16 17 # 17 # You should have received a copy of the GNU General Public License 18 # and the GNU Lesser General Public License along with this program. 19 # If not, see <http://www.gnu.org/licenses/>. 18 # You should have received a copy of the GNU Lesser General Public 19 # License along with this library; if not, write to the Free Software 20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 # MA 02110-1301 USA. 20 22 ########################################################################### 21 23 use strict; … … 384 386 }"); 385 387 388 # Added vararg parameter 389 writeFile($Path_v1."/AddedVarargParam.java", 390 "package $PackageName; 391 public class AddedVarargParam { 392 public void method(Integer x, String... y) { } 393 }"); 394 writeFile($Path_v2."/AddedVarargParam.java", 395 "package $PackageName; 396 public class AddedVarargParam { 397 public void method(Integer x, String... y) { } 398 }"); 399 400 writeFile($TestsPath."/Test_AddedVarargParam.java", 401 "import $PackageName.*; 402 public class Test_AddedVarargParam 403 { 404 public static void main(String[] args) { 405 AddedVarargParam X = new AddedVarargParam(); 406 X.method(0); 407 } 408 }"); 409 386 410 # Removed_Annotation 387 411 writeFile($Path_v1."/RemovedAnnotation.java", … … 402 426 }"); 403 427 428 # Changed Annotation 429 writeFile($Path_v1."/ChangedAnnotation.java", 430 "package $PackageName; 431 432 enum MyEnum { 433 SUNDAY, MONDAY 434 } 435 436 public \@interface ChangedAnnotation { 437 String value(); 438 String datatype() default \"Str\"; 439 int num1() default 1; 440 String[] values() default {\"Alice\", \"Bob\", \"Cindy\"}; 441 int[] nums() default {1, 2, 3}; 442 String safe_change() default \"Str\"; 443 MyEnum day() default MyEnum.SUNDAY; 444 short num2() default 1; 445 long num3() default 1; 446 byte num4() default 1; 447 float num5() default 1.5f; 448 double num6() default 1.5; 449 boolean bit() default true; 450 char ch() default 'A'; 451 }"); 452 453 writeFile($Path_v2."/ChangedAnnotation.java", 454 "package $PackageName; 455 456 enum MyEnum { 457 SUNDAY, MONDAY 458 } 459 460 public \@interface ChangedAnnotation { 461 String value() default \"Str\"; 462 String datatype(); 463 int[] values(); 464 int[] nums() default {1, 2}; 465 int[] new_default_param() default {1, 2}; 466 int[] new_param(); 467 String[] safe_change() default {\"Str\"}; 468 MyEnum day() default MyEnum.MONDAY; 469 }"); 470 471 writeFile($TestsPath."/Test_ChangedAnnotation.java", 472 "import $PackageName.*; 473 public class Test_ChangedAnnotation { 474 public static void main(String[] args) { 475 testMethod(); 476 } 477 478 \@ChangedAnnotation(value=\"Val\") 479 static void testMethod() { 480 } 481 }"); 482 404 483 # Beta Annotation 405 484 writeFile($Path_v1."/Beta.java", … … 752 831 "package $PackageName; 753 832 public class ChangedFinalFieldValue { 754 public final int field = 1; 833 enum MyEnum { 834 ONE, TWO 835 } 836 public final int field1 = 1; 755 837 public final String field2 = \" \"; 838 public final MyEnum field3 = MyEnum.ONE; 756 839 }"); 757 840 writeFile($Path_v2."/ChangedFinalFieldValue.java", 758 841 "package $PackageName; 759 842 public class ChangedFinalFieldValue { 760 public final int field = 2; 843 enum MyEnum { 844 ONE, TWO 845 } 846 public final int field1 = 2; 761 847 public final String field2 = \"newValue\"; 848 public final MyEnum field3 = MyEnum.TWO; 762 849 }"); 763 850 … … 1920 2007 $Cmd .= " -old-style"; 1921 2008 } 2009 if(my $JdkPath = $In::Opt{"JdkPath"}) { 2010 $Cmd .= " -jdk-path \"$JdkPath\""; 2011 } 1922 2012 1923 2013 my $TmpDir = $In::Opt{"Tmp"};
Note:
See TracChangeset
for help on using the changeset viewer.