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

org.eclipse.cdt.core<BR>

&nbsp;&nbsp;Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=57800.<BR><BR>
org.eclipse.cdt.core.tests<BR>
&nbsp;&nbsp;Removed warnings from CompletionTests.<BR>
&nbsp;&nbsp;Added CompleteParseASTTest::testBug57800().<BR>
This commit is contained in:
John Camelon 2004-04-08 14:38:14 +00:00
parent 3980981b94
commit 1ac6f78fc3
7 changed files with 33 additions and 10 deletions

View file

@ -1,3 +1,7 @@
2004-04-08 John Camelon
Removed warnings from CompletionTests.
Added CompleteParseASTTest::testBug57800().
2004-04-07 Andrew Niefer 2004-04-07 Andrew Niefer
added CompletionParseTest.testCompletionWithTemplateInstanceAsParent() added CompletionParseTest.testCompletionWithTemplateInstanceAsParent()

View file

@ -1411,4 +1411,21 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
assertAllReferences( 2, createTaskList( new Task( outerS ), new Task( innerS ) ) ); assertAllReferences( 2, createTaskList( new Task( outerS ), new Task( innerS ) ) );
} }
public void testBug57800() throws Exception
{
Writer writer= new StringWriter();
writer.write( "class G2 { int j; };");
writer.write( "typedef G2 AltG2;");
writer.write( "class AltG3 : AltG2 { int x;};");
Iterator i = parse( writer.toString() ).getDeclarations();
IASTClassSpecifier G2 = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
IASTTypedefDeclaration AltG2 = (IASTTypedefDeclaration) i.next();
IASTClassSpecifier AltG3 = (IASTClassSpecifier) ((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
assertFalse( i.hasNext() );
Iterator baseClauses = AltG3.getBaseClauses();
IASTBaseSpecifier baseClause = (IASTBaseSpecifier) baseClauses.next();
assertFalse( baseClauses.hasNext() );
baseClause.getParentClassSpecifier();
}
} }

View file

@ -734,7 +734,6 @@ public class CompletionParseTest extends CompleteParseBaseTest {
assertEquals( result.getResultsSize(), matches.size() ); assertEquals( result.getResultsSize(), matches.size() );
Iterator iter = result.getNodes(); Iterator iter = result.getNodes();
int assertionCount = 0;
while( iter.hasNext() ) while( iter.hasNext() )
{ {
IASTOffsetableNamedElement element = (IASTOffsetableNamedElement) iter.next(); IASTOffsetableNamedElement element = (IASTOffsetableNamedElement) iter.next();
@ -746,7 +745,6 @@ public class CompletionParseTest extends CompleteParseBaseTest {
* @return * @return
*/ */
protected IASTCompilationUnit getCompilationUnit() { protected IASTCompilationUnit getCompilationUnit() {
CompleteParseBaseTest.Scope s = (Scope) callback.getCompilationUnit();
IASTCompilationUnit compilationUnit = (IASTCompilationUnit) ((Scope) callback.getCompilationUnit()).getScope(); IASTCompilationUnit compilationUnit = (IASTCompilationUnit) ((Scope) callback.getCompilationUnit()).getScope();
return compilationUnit; return compilationUnit;
} }
@ -826,8 +824,9 @@ public class CompletionParseTest extends CompleteParseBaseTest {
Iterator i = result.getNodes(); Iterator i = result.getNodes();
IASTField bmember = (IASTField) i.next(); assertTrue( i.next() instanceof IASTField );
IASTField amember = (IASTField) i.next(); assertTrue( i.next() instanceof IASTField );
assertFalse( i.hasNext() );
} }
} }

View file

@ -1,3 +1,6 @@
2004-04-08 John Camelon
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=57800.
2004-04-07 John Camelon 2004-04-07 John Camelon
Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=50808. Fixed https://bugs.eclipse.org/bugs/show_bug.cgi?id=50808.
Provided partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=50807. Provided partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=50807.

View file

@ -22,7 +22,7 @@ public interface IASTBaseSpecifier extends ISourceElementCallbackDelegate {
public ASTAccessVisibility getAccess(); public ASTAccessVisibility getAccess();
public boolean isVirtual(); public boolean isVirtual();
public String getParentClassName(); public String getParentClassName();
public IASTClassSpecifier getParentClassSpecifier() throws ASTNotImplementedException; public IASTTypeSpecifier getParentClassSpecifier() throws ASTNotImplementedException;
public int getNameOffset(); public int getNameOffset();
} }

View file

@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.cdt.core.parser.ISourceElementRequestor; import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier; import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
import org.eclipse.cdt.internal.core.parser.pst.ISymbol; import org.eclipse.cdt.internal.core.parser.pst.ISymbol;
/** /**
@ -67,9 +67,9 @@ public class ASTBaseSpecifier implements IASTBaseSpecifier
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier() * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier()
*/ */
public IASTClassSpecifier getParentClassSpecifier() public IASTTypeSpecifier getParentClassSpecifier()
{ {
return (IASTClassSpecifier)symbol.getASTExtension().getPrimaryDeclaration(); return (IASTTypeSpecifier)symbol.getASTExtension().getPrimaryDeclaration();
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -14,8 +14,8 @@ import org.eclipse.cdt.core.parser.ISourceElementRequestor;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException; import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier; import org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTReference; import org.eclipse.cdt.core.parser.ast.IASTReference;
import org.eclipse.cdt.core.parser.ast.IASTTypeSpecifier;
/** /**
* @author jcamelon * @author jcamelon
@ -58,7 +58,7 @@ public class ASTBaseSpecifier implements IASTBaseSpecifier {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier() * @see org.eclipse.cdt.core.parser.ast.IASTBaseSpecifier#getParentClassSpecifier()
*/ */
public IASTClassSpecifier getParentClassSpecifier() throws ASTNotImplementedException public IASTTypeSpecifier getParentClassSpecifier() throws ASTNotImplementedException
{ {
throw new ASTNotImplementedException(); throw new ASTNotImplementedException();
} }