Lines 106-112
Link Here
|
106 |
|
106 |
|
107 |
static { |
107 |
static { |
108 |
// TESTS_NAMES = new String[] {"test0602"}; |
108 |
// TESTS_NAMES = new String[] {"test0602"}; |
109 |
// TESTS_NUMBERS = new int[] { 619 }; |
109 |
TESTS_NUMBERS = new int[] { 620 }; |
110 |
} |
110 |
} |
111 |
public static Test suite() { |
111 |
public static Test suite() { |
112 |
return buildTestSuite(ASTConverterTestAST3_2.class); |
112 |
return buildTestSuite(ASTConverterTestAST3_2.class); |
Lines 6812-6815
Link Here
|
6812 |
VariableDeclarationStatement declarationStatement = (VariableDeclarationStatement) statement2; |
6812 |
VariableDeclarationStatement declarationStatement = (VariableDeclarationStatement) statement2; |
6813 |
assertEquals("Wrong number of fragments", 4, declarationStatement.fragments().size()); |
6813 |
assertEquals("Wrong number of fragments", 4, declarationStatement.fragments().size()); |
6814 |
} |
6814 |
} |
|
|
6815 |
/** |
6816 |
* http://dev.eclipse.org/bugs/show_bug.cgi?id=109940 |
6817 |
*/ |
6818 |
public void test0620() throws JavaModelException { |
6819 |
ICompilationUnit workingCopy = null; |
6820 |
try { |
6821 |
String contents = |
6822 |
"public class X {\n" + |
6823 |
" public static void main(String[] args) {\n" + |
6824 |
" System.out.println((int) \'\\0\');\n" + |
6825 |
" System.out.println((int) \'\\1\');\n" + |
6826 |
" System.out.println((int) \'\\2\');\n" + |
6827 |
" System.out.println((int) \'\\3\');\n" + |
6828 |
" System.out.println((int) \'\\4\');\n" + |
6829 |
" System.out.println((int) \'\\5\');\n" + |
6830 |
" System.out.println((int) \'\\6\');\n" + |
6831 |
" System.out.println((int) \'\\7\');\n" + |
6832 |
" System.out.println((int) \'\\077\');\n" + |
6833 |
" System.out.println((int) \'\\55\');\n" + |
6834 |
" System.out.println((int) \'\\77\');\n" + |
6835 |
" System.out.println((int) \'\\377\');\n" + |
6836 |
" }\n" + |
6837 |
"}"; |
6838 |
workingCopy = getWorkingCopy("/Converter/src/X.java", false/*resolve*/); |
6839 |
ASTNode node = buildAST( |
6840 |
contents, |
6841 |
workingCopy, |
6842 |
false); |
6843 |
assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); |
6844 |
CompilationUnit unit = (CompilationUnit) node; |
6845 |
assertProblemsSize(unit, 0); |
6846 |
unit.accept(new ASTVisitor() { |
6847 |
public boolean visit(CharacterLiteral characterLiteral) { |
6848 |
try { |
6849 |
final String escapedValue = characterLiteral.getEscapedValue(); |
6850 |
final char charValue = characterLiteral.charValue(); |
6851 |
if (escapedValue.equals("\'\\0\'")) { |
6852 |
assertEquals("Wrong value", 0, charValue); |
6853 |
} else if (escapedValue.equals("\'\\1\'")) { |
6854 |
assertEquals("Wrong value", 1, charValue); |
6855 |
} else if (escapedValue.equals("\'\\2\'")) { |
6856 |
assertEquals("Wrong value", 2, charValue); |
6857 |
} else if (escapedValue.equals("\'\\3\'")) { |
6858 |
assertEquals("Wrong value", 3, charValue); |
6859 |
} else if (escapedValue.equals("\'\\4\'")) { |
6860 |
assertEquals("Wrong value", 4, charValue); |
6861 |
} else if (escapedValue.equals("\'\\5\'")) { |
6862 |
assertEquals("Wrong value", 5, charValue); |
6863 |
} else if (escapedValue.equals("\'\\6\'")) { |
6864 |
assertEquals("Wrong value", 6, charValue); |
6865 |
} else if (escapedValue.equals("\'\\7\'")) { |
6866 |
assertEquals("Wrong value", 7, charValue); |
6867 |
} else if (escapedValue.equals("\'\\077\'")) { |
6868 |
assertEquals("Wrong value", 63, charValue); |
6869 |
} else if (escapedValue.equals("\'\\55\'")) { |
6870 |
assertEquals("Wrong value", 45, charValue); |
6871 |
} else if (escapedValue.equals("\'\\77\'")) { |
6872 |
assertEquals("Wrong value", 63, charValue); |
6873 |
} else if (escapedValue.equals("\'\\377\'")) { |
6874 |
assertEquals("Wrong value", 255, charValue); |
6875 |
} else { |
6876 |
assertTrue("Should not get there", false); |
6877 |
} |
6878 |
} catch(IllegalArgumentException e) { |
6879 |
assertTrue("Should not happen", false); |
6880 |
} |
6881 |
return false; |
6882 |
} |
6883 |
}); |
6884 |
} finally { |
6885 |
if (workingCopy != null) |
6886 |
workingCopy.discardWorkingCopy(); |
6887 |
} |
6888 |
} |
6815 |
} |
6889 |
} |