From a9a182409247fd5ae93c5012cfbdeaca9799159f Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Fri, 7 Dec 2007 14:51:11 +0000 Subject: [PATCH] Testcase for bug 211756. --- .../cdt/core/parser/tests/ast2/AST2CPPTests.java | 16 ++++++++++++++++ .../parser/tests/ast2/DOMParserTestSuite.java | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java index ae6d8fdf9fc..e0c3bbb930a 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java @@ -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$ diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMParserTestSuite.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMParserTestSuite.java index e48af9b0314..03a4dc25ee7 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMParserTestSuite.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMParserTestSuite.java @@ -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() );