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

Testcase for bug 211756.

This commit is contained in:
Markus Schorn 2007-12-07 14:51:11 +00:00
parent 20a23cb80a
commit a9a1824092
2 changed files with 17 additions and 1 deletions

View file

@ -22,6 +22,8 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.dom.ast.ASTSignatureUtil;
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
@ -121,6 +123,10 @@ public class AST2CPPTests extends AST2BaseTest {
super(name);
}
public static TestSuite suite() {
return suite(AST2CPPTests.class);
}
public void testBug102825() throws Exception {
StringBuffer buffer = new StringBuffer("#define CURLOPTTYPE_OBJECTPOINT 10000\n" ); //$NON-NLS-1$
buffer.append("#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number\n" ); //$NON-NLS-1$
@ -4865,6 +4871,16 @@ public class AST2CPPTests extends AST2BaseTest {
assertTrue(d.getName().resolveBinding() instanceof IVariable);
}
public void _testBug211756() throws Exception {
StringBuffer buffer = new StringBuffer();
buffer.append("int t= 0;\n"); //$NON-NLS-1$
buffer.append("int s ( t );\n"); //$NON-NLS-1$
IASTTranslationUnit tu = parse(buffer.toString(), ParserLanguage.CPP);
IASTSimpleDeclaration sd = (IASTSimpleDeclaration) (tu.getDeclarations()[1]);
IASTDeclarator d = sd.getDeclarators()[0];
assertTrue(d.getName().resolveBinding() instanceof IVariable);
}
public void testBug95714() throws Exception {
StringBuffer buffer = new StringBuffer();
buffer.append("typedef struct xs { \n"); //$NON-NLS-1$

View file

@ -29,7 +29,7 @@ public class DOMParserTestSuite extends TestCase {
suite.addTest(DOMScannerTests.suite());
suite.addTest(AST2Tests.suite());
suite.addTestSuite( GCCTests.class );
suite.addTestSuite( AST2CPPTests.class );
suite.addTest( AST2CPPTests.suite() );
suite.addTest( AST2TemplateTests.suite() );
suite.addTestSuite( QuickParser2Tests.class );
suite.addTest( CompleteParser2Tests.suite() );