Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 21529 Details for
Bug 88395
[1.5][compiler] Binary compat problem with enum/switch codegen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Apply on HEAD of org.eclipse.jdt.core.tests.compiler
patch_88395_tests.txt (text/plain), 8.80 KB, created by
Olivier Thomann
on 2005-05-20 15:34:01 EDT
(
hide
)
Description:
Apply on HEAD of org.eclipse.jdt.core.tests.compiler
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-05-20 15:34:01 EDT
Size:
8.80 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java,v >retrieving revision 1.48 >diff -u -r1.48 AbstractRegressionTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java 17 May 2005 15:38:20 -0000 1.48 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java 20 May 2005 19:29:30 -0000 >@@ -424,4 +424,43 @@ > } > super.tearDown(); > } >+ >+ protected void executeClass( >+ String sourceFile, >+ String expectedSuccessOutputString, >+ String[] classLib, >+ boolean shouldFlushOutputDirectory, >+ String[] vmArguments, >+ Map customOptions, >+ ICompilerRequestor clientRequestor) { >+ >+ // Compute class name by removing ".java" and replacing slashes with dots >+ String className = sourceFile.substring(0, sourceFile.length() - 5).replace('/', '.').replace('\\', '.'); >+ if (className.endsWith(PACKAGE_INFO_NAME)) return; >+ >+ if (vmArguments != null) { >+ if (this.verifier != null) { >+ this.verifier.shutDown(); >+ } >+ this.verifier = new TestVerifier(false); >+ this.createdVerifier = true; >+ } >+ boolean passed = >+ this.verifier.verifyClassFiles( >+ sourceFile, >+ className, >+ expectedSuccessOutputString, >+ this.classpaths, >+ null, >+ vmArguments); >+ assertTrue(this.verifier.failureReason, // computed by verifyClassFiles(...) action >+ passed); >+ if (vmArguments != null) { >+ if (this.verifier != null) { >+ this.verifier.shutDown(); >+ } >+ this.verifier = new TestVerifier(false); >+ this.createdVerifier = true; >+ } >+ } > } >Index: src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java,v >retrieving revision 1.72 >diff -u -r1.72 EnumTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 20 May 2005 11:44:05 -0000 1.72 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/EnumTest.java 20 May 2005 19:29:30 -0000 >@@ -33,7 +33,7 @@ > // All specified tests which does not belong to the class are skipped... > static { > // TESTS_NAMES = new String[] { "test000" }; >-// TESTS_NUMBERS = new int[] { 106 }; >+// TESTS_NUMBERS = new int[] { 105 }; > // TESTS_RANGE = new int[] { 21, 50 }; > } > public static Test suite() { >@@ -1554,8 +1554,6 @@ > > // TODO (philippe) check one cannot redefine Enum incorrectly > >- // TODO (philippe) check binary compatibility (removing referenced enum constants in switch) >- > // TODO (philippe) check enum syntax recovery > /** > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=78914 - variation >@@ -3235,5 +3233,258 @@ > "} \n", > }, > "ENUM1"); >- } >+ } >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88395 >+ public void test105() { >+ this.runConformTest( >+ new String[] { >+ "pack/X.java", >+ "package pack;\n" + >+ "import static pack.Color.*;\n" + >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " Color c = BLACK;\n" + >+ " switch(c) {\n" + >+ " case BLACK:\n" + >+ " System.out.print(\"Black\");\n" + >+ " break;\n" + >+ " case WHITE:\n" + >+ " System.out.print(\"White\");\n" + >+ " break;\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {WHITE, BLACK}" >+ }, >+ "Black" >+ ); >+ >+ this.runConformTest( >+ new String[] { >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {BLACK, WHITE}" >+ }, >+ "", >+ null, >+ false, >+ null >+ ); >+ >+ this.executeClass( >+ "pack/X.java", >+ "Black", >+ null, >+ false, >+ null, >+ null, >+ null); >+ } >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88395 >+ public void test106() { >+ this.runConformTest( >+ new String[] { >+ "pack/X.java", >+ "package pack;\n" + >+ "import static pack.Color.*;\n" + >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " Color c = BLACK;\n" + >+ " switch(c) {\n" + >+ " }\n" + >+ " System.out.print(\"SUCCESS\");\n" + >+ " }\n" + >+ "}", >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {WHITE, BLACK}" >+ }, >+ "SUCCESS" >+ ); >+ >+ this.runConformTest( >+ new String[] { >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {BLACK, WHITE}" >+ }, >+ "", >+ null, >+ false, >+ null >+ ); >+ >+ this.executeClass( >+ "pack/X.java", >+ "SUCCESS", >+ null, >+ false, >+ null, >+ null, >+ null); >+ } >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88395 >+ public void test107() { >+ this.runConformTest( >+ new String[] { >+ "pack/X.java", >+ "package pack;\n" + >+ "import static pack.Color.*;\n" + >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " Color c = BLACK;\n" + >+ " switch(c) {\n" + >+ " case BLACK:\n" + >+ " System.out.print(\"Black\");\n" + >+ " break;\n" + >+ " case WHITE:\n" + >+ " System.out.print(\"White\");\n" + >+ " break;\n" + >+ " }\n" + >+ " switch(c) {\n" + >+ " case BLACK:\n" + >+ " System.out.print(\"Black\");\n" + >+ " break;\n" + >+ " case WHITE:\n" + >+ " System.out.print(\"White\");\n" + >+ " break;\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {WHITE, BLACK}" >+ }, >+ "BlackBlack" >+ ); >+ >+ this.runConformTest( >+ new String[] { >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color { BLACK }" >+ }, >+ "", >+ null, >+ false, >+ null >+ ); >+ >+ this.executeClass( >+ "pack/X.java", >+ "BlackBlack", >+ null, >+ false, >+ null, >+ null, >+ null); >+ } >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88395 >+ public void test108() { >+ this.runConformTest( >+ new String[] { >+ "pack/X.java", >+ "package pack;\n" + >+ "import static pack.Color.*;\n" + >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " Color c = BLACK;\n" + >+ " switch(c) {\n" + >+ " case BLACK:\n" + >+ " System.out.print(\"Black\");\n" + >+ " break;\n" + >+ " case WHITE:\n" + >+ " System.out.print(\"White\");\n" + >+ " break;\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {WHITE, BLACK}" >+ }, >+ "Black" >+ ); >+ >+ this.runConformTest( >+ new String[] { >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {RED, GREEN, YELLOW, BLACK, WHITE}" >+ }, >+ "", >+ null, >+ false, >+ null >+ ); >+ >+ this.executeClass( >+ "pack/X.java", >+ "Black", >+ null, >+ false, >+ null, >+ null, >+ null); >+ } >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88395 >+ public void test109() { >+ this.runConformTest( >+ new String[] { >+ "pack/X.java", >+ "package pack;\n" + >+ "import static pack.Color.*;\n" + >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " Color c = null;\n" + >+ " try {\n" + >+ " c = BLACK;\n" + >+ " } catch(NoSuchFieldError e) {\n" + >+ " System.out.print(\"SUCCESS\");\n" + >+ " return;\n" + >+ " }\n" + >+ " switch(c) {\n" + >+ " case BLACK:\n" + >+ " System.out.print(\"Black\");\n" + >+ " break;\n" + >+ " case WHITE:\n" + >+ " System.out.print(\"White\");\n" + >+ " break;\n" + >+ " }\n" + >+ " }\n" + >+ "}", >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {WHITE, BLACK}" >+ }, >+ "Black" >+ ); >+ >+ this.runConformTest( >+ new String[] { >+ "pack/Color.java", >+ "package pack;\n" + >+ "enum Color {RED, GREEN, YELLOW, WHITE}" >+ }, >+ "", >+ null, >+ false, >+ null >+ ); >+ >+ this.executeClass( >+ "pack/X.java", >+ "SUCCESS", >+ null, >+ false, >+ null, >+ null, >+ null); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 88395
:
21522
|
21523
|
21527
|
21528
| 21529