1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Test case for getRawSignature, bug 117029.

This commit is contained in:
Markus Schorn 2007-11-23 13:54:16 +00:00
parent 95abd050f6
commit 3aefe7ea04

View file

@ -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());
}
}