1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

org.eclipse.cdt.core

Fixed bug 50344 - Wrong completion in Class scope if before the first declaration.

org.eclipse.cdt.ui.tests
	Updated CompletionFailedTest_FieldType_NoPrefix_Bug50344 and moved from failed tests.
This commit is contained in:
John Camelon 2004-01-22 18:51:18 +00:00
parent 703e1086c9
commit 34754f2099
4 changed files with 15 additions and 9 deletions

View file

@ -2751,6 +2751,10 @@ public abstract class Parser implements IParser
if (LT(1) == IToken.tLBRACE) if (LT(1) == IToken.tLBRACE)
{ {
consume(IToken.tLBRACE); consume(IToken.tLBRACE);
setCompletionKind(CompletionKind.FIELD_TYPE);
setCompletionContext(null);
setCompletionKeywords(Key.DECLARATION);
setCurrentScope(astClassSpecifier);
astClassSpecifier.enterScope( requestor ); astClassSpecifier.enterScope( requestor );
memberDeclarationLoop : while (LT(1) != IToken.tRBRACE) memberDeclarationLoop : while (LT(1) != IToken.tRBRACE)
{ {

View file

@ -1,3 +1,6 @@
2004-01-22 John Camelon
Updated CompletionFailedTest_FieldType_NoPrefix_Bug50344 and moved from failed tests.
2004-01-21 Hoda Amer 2004-01-21 Hoda Amer
Renamed completion tests to be more meaningful. Renamed completion tests to be more meaningful.

View file

@ -52,7 +52,7 @@ public class AutomatedSuite extends TestSuite {
// Failed Tests // Failed Tests
addTest(CompletionFailedTest_ScopedReference_NoPrefix_Bug50152.suite()); addTest(CompletionFailedTest_ScopedReference_NoPrefix_Bug50152.suite());
addTest(CompletionFailedTest_ScopedReference_Prefix_Bug50152.suite()); addTest(CompletionFailedTest_ScopedReference_Prefix_Bug50152.suite());
addTest(CompletionFailedTest_FieldType_NoPrefix_Bug50344.suite()); addTest(CompletionTest_FieldType_NoPrefix2.suite());
} }

View file

@ -8,12 +8,11 @@
* Contributors: * Contributors:
* IBM Rational Software - Initial API and implementation * IBM Rational Software - Initial API and implementation
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.ui.tests.text.contentassist.failedtests; package org.eclipse.cdt.ui.tests.text.contentassist;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind; import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
/** /**
* @author hamer * @author hamer
@ -22,26 +21,26 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
* Bug#50344 :Wrong completion in Class scope if before the first declaration * Bug#50344 :Wrong completion in Class scope if before the first declaration
* *
*/ */
public class CompletionFailedTest_FieldType_NoPrefix_Bug50344 extends CompletionProposalsBaseTest{ public class CompletionTest_FieldType_NoPrefix2 extends CompletionProposalsBaseTest{
private final String fileName = "CompletionFailedTestStart3.h"; private final String fileName = "CompletionFailedTestStart3.h";
private final String fileFullPath ="resources/contentassist/failedtests/" + fileName; private final String fileFullPath ="resources/contentassist/failedtests/" + fileName;
private final String headerFileName = "CompletionTestStart.h"; private final String headerFileName = "CompletionTestStart.h";
private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
private final String expectedScopeName = "ASTCompilationUnit"; // should be "ASTClassSpecifier"; private final String expectedScopeName = "ASTClassSpecifier";
private final String expectedContextName = "null"; private final String expectedContextName = "null";
private final CompletionKind expectedKind =CompletionKind.USER_SPECIFIED_NAME; // should be CompletionKind.FIELD_TYPE; private final CompletionKind expectedKind = CompletionKind.FIELD_TYPE;
private final String expectedPrefix = ""; private final String expectedPrefix = "";
private final String[] expectedResults = { private final String[] expectedResults = {
}; };
public CompletionFailedTest_FieldType_NoPrefix_Bug50344(String name) { public CompletionTest_FieldType_NoPrefix2(String name) {
super(name); super(name);
} }
public static Test suite() { public static Test suite() {
TestSuite suite= new TestSuite(CompletionFailedTest_FieldType_NoPrefix_Bug50344.class.getName()); TestSuite suite= new TestSuite(CompletionTest_FieldType_NoPrefix2.class.getName());
suite.addTest(new CompletionFailedTest_FieldType_NoPrefix_Bug50344("testCompletionProposals")); suite.addTest(new CompletionTest_FieldType_NoPrefix2("testCompletionProposals"));
return suite; return suite;
} }