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 27619 Details for
Bug 109940
[dom] IllegalArgumentException is thrown in CharacterLiteral.charValue()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
patch_109940_tests.txt (text/plain), 3.87 KB, created by
Olivier Thomann
on 2005-09-28 11:35:07 EDT
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-09-28 11:35:07 EDT
Size:
3.87 KB
patch
obsolete
>Index: ASTConverterTestAST3_2.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v >retrieving revision 1.65 >diff -u -r1.65 ASTConverterTestAST3_2.java >--- ASTConverterTestAST3_2.java 15 Sep 2005 18:48:55 -0000 1.65 >+++ ASTConverterTestAST3_2.java 28 Sep 2005 15:34:55 -0000 >@@ -106,7 +106,7 @@ > > static { > // TESTS_NAMES = new String[] {"test0602"}; >-// TESTS_NUMBERS = new int[] { 619 }; >+ TESTS_NUMBERS = new int[] { 620 }; > } > public static Test suite() { > return buildTestSuite(ASTConverterTestAST3_2.class); >@@ -6812,4 +6812,78 @@ > VariableDeclarationStatement declarationStatement = (VariableDeclarationStatement) statement2; > assertEquals("Wrong number of fragments", 4, declarationStatement.fragments().size()); > } >+ /** >+ * http://dev.eclipse.org/bugs/show_bug.cgi?id=109940 >+ */ >+ public void test0620() throws JavaModelException { >+ ICompilationUnit workingCopy = null; >+ try { >+ String contents = >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " System.out.println((int) \'\\0\');\n" + >+ " System.out.println((int) \'\\1\');\n" + >+ " System.out.println((int) \'\\2\');\n" + >+ " System.out.println((int) \'\\3\');\n" + >+ " System.out.println((int) \'\\4\');\n" + >+ " System.out.println((int) \'\\5\');\n" + >+ " System.out.println((int) \'\\6\');\n" + >+ " System.out.println((int) \'\\7\');\n" + >+ " System.out.println((int) \'\\077\');\n" + >+ " System.out.println((int) \'\\55\');\n" + >+ " System.out.println((int) \'\\77\');\n" + >+ " System.out.println((int) \'\\377\');\n" + >+ " }\n" + >+ "}"; >+ workingCopy = getWorkingCopy("/Converter/src/X.java", false/*resolve*/); >+ ASTNode node = buildAST( >+ contents, >+ workingCopy, >+ false); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize(unit, 0); >+ unit.accept(new ASTVisitor() { >+ public boolean visit(CharacterLiteral characterLiteral) { >+ try { >+ final String escapedValue = characterLiteral.getEscapedValue(); >+ final char charValue = characterLiteral.charValue(); >+ if (escapedValue.equals("\'\\0\'")) { >+ assertEquals("Wrong value", 0, charValue); >+ } else if (escapedValue.equals("\'\\1\'")) { >+ assertEquals("Wrong value", 1, charValue); >+ } else if (escapedValue.equals("\'\\2\'")) { >+ assertEquals("Wrong value", 2, charValue); >+ } else if (escapedValue.equals("\'\\3\'")) { >+ assertEquals("Wrong value", 3, charValue); >+ } else if (escapedValue.equals("\'\\4\'")) { >+ assertEquals("Wrong value", 4, charValue); >+ } else if (escapedValue.equals("\'\\5\'")) { >+ assertEquals("Wrong value", 5, charValue); >+ } else if (escapedValue.equals("\'\\6\'")) { >+ assertEquals("Wrong value", 6, charValue); >+ } else if (escapedValue.equals("\'\\7\'")) { >+ assertEquals("Wrong value", 7, charValue); >+ } else if (escapedValue.equals("\'\\077\'")) { >+ assertEquals("Wrong value", 63, charValue); >+ } else if (escapedValue.equals("\'\\55\'")) { >+ assertEquals("Wrong value", 45, charValue); >+ } else if (escapedValue.equals("\'\\77\'")) { >+ assertEquals("Wrong value", 63, charValue); >+ } else if (escapedValue.equals("\'\\377\'")) { >+ assertEquals("Wrong value", 255, charValue); >+ } else { >+ assertTrue("Should not get there", false); >+ } >+ } catch(IllegalArgumentException e) { >+ assertTrue("Should not happen", false); >+ } >+ return false; >+ } >+ }); >+ } finally { >+ if (workingCopy != null) >+ workingCopy.discardWorkingCopy(); >+ } >+ } > }
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 109940
:
27319
|
27618
| 27619