From 3aefe7ea04c1c341c7fcfcc3cbe62bc2def04cee Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Fri, 23 Nov 2007 13:54:16 +0000 Subject: [PATCH] Test case for getRawSignature, bug 117029. --- .../core/parser/tests/ast2/DOMLocationTests.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMLocationTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMLocationTests.java index 574d0473e7e..ab322579f1b 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMLocationTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMLocationTests.java @@ -720,4 +720,19 @@ public class DOMLocationTests extends AST2BaseTest { assertSoleLocation(problems[1], code, "\"deprecated include\""); assertSoleLocation(problems[2], code, fUsesCPreprocessor ? "#invalid" : "invalid"); } + + // int main(void){ + // #define one 1 + // int integer = one; + // return integer; + // } + public void testRawSignature_Bug117029() throws Exception { + String content= getContents(1)[0].toString(); + IASTTranslationUnit tu= parse(content, ParserLanguage.CPP); + IASTFunctionDefinition decl= (IASTFunctionDefinition) tu.getDeclarations()[0]; + IASTCompoundStatement compound= (IASTCompoundStatement) decl.getBody(); + assertEquals("int integer = one;", compound.getStatements()[0].getRawSignature()); + assertEquals("return integer;", compound.getStatements()[1].getRawSignature()); + } + }