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:
parent
95abd050f6
commit
3aefe7ea04
1 changed files with 15 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue