mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
org.eclipse.cdt.core
Fixed 50642 - Wrong completion kind when declaring an argument type Updated using declarations for more accurate keywords and closure. org.eclipse.cdt.ui.tests Updated CompletionTest_ArgumentType_Prefix_Bug50642, renamed it to CompletionTest_ArgumentType_Prefix and moved to passed test package. Updated CompletionTest_ArgumentType_Prefix2_Bug50642, renamed it to CompletionTest_ArgumentType_Prefix2 and moved to passed test package. Updated CompletionTest_ArgumentType_NoPrefix_Bug50642, renamed it to CompletionTest_ArgumentType_NoPrefix and moved to passed test package. Updated CompletionTest_ArgumentType_NoPrefix2_Bug50642, renamed it to CompletionTest_ArgumentType_NoPrefix2 and moved to passed test package.
This commit is contained in:
parent
752890b1aa
commit
d46025b64f
9 changed files with 211 additions and 161 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-01-29 John Camelon
|
||||||
|
Fixed 50642 - Wrong completion kind when declaring an argument type
|
||||||
|
Updated using declarations for more accurate keywords and closure.
|
||||||
|
|
||||||
2004-01-29 Hoda Amer
|
2004-01-29 Hoda Amer
|
||||||
Put CompletionKind.FUNCTION_REFERENCE back.
|
Put CompletionKind.FUNCTION_REFERENCE back.
|
||||||
|
|
||||||
|
|
|
@ -301,13 +301,16 @@ public abstract class Parser implements IParser
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
boolean typeName = false;
|
boolean typeName = false;
|
||||||
|
setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.POST_USING );
|
||||||
|
|
||||||
if (LT(1) == IToken.t_typename)
|
if (LT(1) == IToken.t_typename)
|
||||||
{
|
{
|
||||||
typeName = true;
|
typeName = true;
|
||||||
consume(IToken.t_typename);
|
consume(IToken.t_typename);
|
||||||
|
|
||||||
}
|
}
|
||||||
setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.EMPTY );
|
|
||||||
|
setCompletionValues(scope, CompletionKind.TYPE_REFERENCE, Key.NAMESPACE_ONLY );
|
||||||
TokenDuple name = null;
|
TokenDuple name = null;
|
||||||
if (LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON)
|
if (LT(1) == IToken.tIDENTIFIER || LT(1) == IToken.tCOLONCOLON)
|
||||||
{
|
{
|
||||||
|
@ -337,6 +340,7 @@ public abstract class Parser implements IParser
|
||||||
throw backtrack;
|
throw backtrack;
|
||||||
}
|
}
|
||||||
declaration.acceptElement( requestor );
|
declaration.acceptElement( requestor );
|
||||||
|
setCompletionValues(scope, getCompletionKindForDeclaration(scope, null), Key.DECLARATION );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1206,6 +1210,7 @@ public abstract class Parser implements IParser
|
||||||
throw backtrack;
|
throw backtrack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCompletionValues(scope,CompletionKind.USER_SPECIFIED_NAME,Key.EMPTY );
|
||||||
if (LT(1) != IToken.tSEMI)
|
if (LT(1) != IToken.tSEMI)
|
||||||
initDeclarator(sdw, SimpleDeclarationStrategy.TRY_FUNCTION );
|
initDeclarator(sdw, SimpleDeclarationStrategy.TRY_FUNCTION );
|
||||||
|
|
||||||
|
@ -2188,10 +2193,10 @@ public abstract class Parser implements IParser
|
||||||
{
|
{
|
||||||
case IToken.tLPAREN :
|
case IToken.tLPAREN :
|
||||||
|
|
||||||
// temporary fix for initializer/function declaration ambiguity
|
|
||||||
if (!LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE )
|
|
||||||
{
|
|
||||||
boolean failed = false;
|
boolean failed = false;
|
||||||
|
// temporary fix for initializer/function declaration ambiguity
|
||||||
|
if ( queryLookaheadCapability(2) && !LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE )
|
||||||
|
{
|
||||||
if( LT(2) == IToken.tIDENTIFIER )
|
if( LT(2) == IToken.tIDENTIFIER )
|
||||||
{
|
{
|
||||||
IToken newMark = mark();
|
IToken newMark = mark();
|
||||||
|
@ -2215,12 +2220,14 @@ public abstract class Parser implements IParser
|
||||||
|
|
||||||
backup( newMark );
|
backup( newMark );
|
||||||
}
|
}
|
||||||
if( !failed )
|
}
|
||||||
|
if( ( queryLookaheadCapability(2) && !LA(2).looksLikeExpression() && strategy != SimpleDeclarationStrategy.TRY_VARIABLE && !failed) || ! queryLookaheadCapability(3) )
|
||||||
{
|
{
|
||||||
// parameterDeclarationClause
|
// parameterDeclarationClause
|
||||||
d.setIsFunction(true);
|
d.setIsFunction(true);
|
||||||
// TODO need to create a temporary scope object here
|
// TODO need to create a temporary scope object here
|
||||||
consume(IToken.tLPAREN);
|
consume(IToken.tLPAREN);
|
||||||
|
setCompletionValues( scope, CompletionKind.ARGUMENT_TYPE, Key.DECL_SPECIFIER_SEQUENCE );
|
||||||
boolean seenParameter = false;
|
boolean seenParameter = false;
|
||||||
parameterDeclarationLoop : for (;;)
|
parameterDeclarationLoop : for (;;)
|
||||||
{
|
{
|
||||||
|
@ -2228,6 +2235,7 @@ public abstract class Parser implements IParser
|
||||||
{
|
{
|
||||||
case IToken.tRPAREN :
|
case IToken.tRPAREN :
|
||||||
consume();
|
consume();
|
||||||
|
setCompletionValues( scope, CompletionKind.NO_SUCH_KIND, KeywordSets.Key.FUNCTION_MODIFIER );
|
||||||
break parameterDeclarationLoop;
|
break parameterDeclarationLoop;
|
||||||
case IToken.tELLIPSIS :
|
case IToken.tELLIPSIS :
|
||||||
consume();
|
consume();
|
||||||
|
@ -2235,6 +2243,7 @@ public abstract class Parser implements IParser
|
||||||
break;
|
break;
|
||||||
case IToken.tCOMMA :
|
case IToken.tCOMMA :
|
||||||
consume();
|
consume();
|
||||||
|
setCompletionValues( scope, CompletionKind.ARGUMENT_TYPE, Key.DECL_SPECIFIER_SEQUENCE );
|
||||||
seenParameter = false;
|
seenParameter = false;
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
|
@ -2347,7 +2356,6 @@ public abstract class Parser implements IParser
|
||||||
// In this case (method) we can't expect K&R parameter declarations,
|
// In this case (method) we can't expect K&R parameter declarations,
|
||||||
// but we'll check anyway, for errorhandling
|
// but we'll check anyway, for errorhandling
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case IToken.tLBRACKET :
|
case IToken.tLBRACKET :
|
||||||
consumeArrayModifiers(d, sdw.getScope());
|
consumeArrayModifiers(d, sdw.getScope());
|
||||||
|
|
|
@ -33,6 +33,8 @@ public class KeywordSets {
|
||||||
public static final Key STATEMENT = new Key(3);
|
public static final Key STATEMENT = new Key(3);
|
||||||
public static final Key BASE_SPECIFIER = new Key(4);
|
public static final Key BASE_SPECIFIER = new Key(4);
|
||||||
public static final Key POST_USING = new Key( 5 );
|
public static final Key POST_USING = new Key( 5 );
|
||||||
|
public static final Key FUNCTION_MODIFIER = new Key( 6 );
|
||||||
|
public static final Key NAMESPACE_ONLY = new Key(6);
|
||||||
/**
|
/**
|
||||||
* @param enumValue
|
* @param enumValue
|
||||||
*/
|
*/
|
||||||
|
@ -56,6 +58,10 @@ public class KeywordSets {
|
||||||
return BASE_SPECIFIER_CPP;
|
return BASE_SPECIFIER_CPP;
|
||||||
if( kind == Key.POST_USING )
|
if( kind == Key.POST_USING )
|
||||||
return POST_USING_CPP;
|
return POST_USING_CPP;
|
||||||
|
if( kind == Key.FUNCTION_MODIFIER )
|
||||||
|
return (Set) FUNCTION_MODIFIER.get( language );
|
||||||
|
if( kind == Key.NAMESPACE_ONLY )
|
||||||
|
return NAMESPACE_ONLY;
|
||||||
|
|
||||||
//TODO finish this
|
//TODO finish this
|
||||||
return null;
|
return null;
|
||||||
|
@ -63,6 +69,13 @@ public class KeywordSets {
|
||||||
|
|
||||||
private static final Set EMPTY = new HashSet();
|
private static final Set EMPTY = new HashSet();
|
||||||
|
|
||||||
|
private static final Set NAMESPACE_ONLY;
|
||||||
|
static
|
||||||
|
{
|
||||||
|
NAMESPACE_ONLY = new HashSet();
|
||||||
|
NAMESPACE_ONLY.add(Keywords.NAMESPACE );
|
||||||
|
}
|
||||||
|
|
||||||
private static final Set DECL_SPECIFIER_SEQUENCE_C;
|
private static final Set DECL_SPECIFIER_SEQUENCE_C;
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
|
@ -189,4 +202,27 @@ public class KeywordSets {
|
||||||
POST_USING_CPP.add(Keywords.NAMESPACE);
|
POST_USING_CPP.add(Keywords.NAMESPACE);
|
||||||
POST_USING_CPP.add(Keywords.TYPENAME);
|
POST_USING_CPP.add(Keywords.TYPENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Set FUNCTION_MODIFIER_C;
|
||||||
|
static
|
||||||
|
{
|
||||||
|
FUNCTION_MODIFIER_C = new TreeSet();
|
||||||
|
}
|
||||||
|
private static final Set FUNCTION_MODIFIER_CPP;
|
||||||
|
static
|
||||||
|
{
|
||||||
|
FUNCTION_MODIFIER_CPP = new TreeSet( FUNCTION_MODIFIER_C );
|
||||||
|
FUNCTION_MODIFIER_CPP.add( Keywords.CONST );
|
||||||
|
FUNCTION_MODIFIER_CPP.add( Keywords.THROW);
|
||||||
|
FUNCTION_MODIFIER_CPP.add( Keywords.TRY );
|
||||||
|
FUNCTION_MODIFIER_CPP.add( Keywords.VOLATILE );
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final Hashtable FUNCTION_MODIFIER;
|
||||||
|
static
|
||||||
|
{
|
||||||
|
FUNCTION_MODIFIER= new Hashtable();
|
||||||
|
FUNCTION_MODIFIER.put( ParserLanguage.CPP, FUNCTION_MODIFIER_CPP );
|
||||||
|
FUNCTION_MODIFIER.put( ParserLanguage.C, FUNCTION_MODIFIER_C );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2004-01-29 John Camelon
|
||||||
|
Updated CompletionTest_ArgumentType_Prefix_Bug50642, renamed it to CompletionTest_ArgumentType_Prefix and moved to passed test package.
|
||||||
|
Updated CompletionTest_ArgumentType_Prefix2_Bug50642, renamed it to CompletionTest_ArgumentType_Prefix2 and moved to passed test package.
|
||||||
|
Updated CompletionTest_ArgumentType_NoPrefix_Bug50642, renamed it to CompletionTest_ArgumentType_NoPrefix and moved to passed test package.
|
||||||
|
Updated CompletionTest_ArgumentType_NoPrefix2_Bug50642, renamed it to CompletionTest_ArgumentType_NoPrefix2 and moved to passed test package.
|
||||||
|
|
||||||
2004-01-29 Hoda Amer
|
2004-01-29 Hoda Amer
|
||||||
Added two more tests, namely Function_Reference and Constructor_Reference.
|
Added two more tests, namely Function_Reference and Constructor_Reference.
|
||||||
Moved tests starts resources all to one directory.
|
Moved tests starts resources all to one directory.
|
||||||
|
|
|
@ -42,10 +42,10 @@ public class AutomatedSuite extends TestSuite {
|
||||||
addTest(CompletionTest_FieldType_NoPrefix2.suite());
|
addTest(CompletionTest_FieldType_NoPrefix2.suite());
|
||||||
addTest(CompletionTest_VariableType_Prefix.suite());
|
addTest(CompletionTest_VariableType_Prefix.suite());
|
||||||
addTest(CompletionTest_VariableType_NoPrefix.suite());
|
addTest(CompletionTest_VariableType_NoPrefix.suite());
|
||||||
addTest(CompletionTest_ArgumentType_NoPrefix_Bug50642.suite());
|
addTest(CompletionTest_ArgumentType_NoPrefix.suite());
|
||||||
addTest(CompletionTest_ArgumentType_NoPrefix2_Bug50642.suite());
|
addTest(CompletionTest_ArgumentType_NoPrefix2.suite());
|
||||||
addTest(CompletionTest_ArgumentType_Prefix_Bug50642.suite());
|
addTest(CompletionTest_ArgumentType_Prefix.suite());
|
||||||
addTest(CompletionTest_ArgumentType_NoPrefix2_Bug50642.suite());
|
addTest(CompletionTest_ArgumentType_NoPrefix2.suite());
|
||||||
addTest(CompletionTest_SingleName_Method_Prefix.suite());
|
addTest(CompletionTest_SingleName_Method_Prefix.suite());
|
||||||
addTest(CompletionTest_SingleName_Method_NoPrefix.suite());
|
addTest(CompletionTest_SingleName_Method_NoPrefix.suite());
|
||||||
addTest(CompletionTest_SingleName_Prefix.suite());
|
addTest(CompletionTest_SingleName_Prefix.suite());
|
||||||
|
|
|
@ -8,14 +8,13 @@
|
||||||
* 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
|
||||||
|
@ -24,25 +23,25 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
|
||||||
* Bug#50642 : Wrong completion kind when declaring an argument type
|
* Bug#50642 : Wrong completion kind when declaring an argument type
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CompletionTest_ArgumentType_NoPrefix_Bug50642 extends CompletionProposalsBaseTest{
|
public class CompletionTest_ArgumentType_NoPrefix extends CompletionProposalsBaseTest{
|
||||||
private final String fileName = "CompletionTestStart17.cpp";
|
private final String fileName = "CompletionTestStart17.cpp";
|
||||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
private final String fileFullPath ="resources/contentassist/" + 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";
|
private final String expectedScopeName = "ASTCompilationUnit";
|
||||||
private final String expectedContextName = "null";
|
private final String expectedContextName = "null";
|
||||||
private final CompletionKind expectedKind = CompletionKind.VARIABLE_TYPE; // should be CompletionKind.ARGUMENT_TYPE;
|
private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE;
|
||||||
private final String expectedPrefix = "";
|
private final String expectedPrefix = "";
|
||||||
private final String[] expectedResults = {
|
private final String[] expectedResults = {
|
||||||
};
|
};
|
||||||
|
|
||||||
public CompletionTest_ArgumentType_NoPrefix_Bug50642(String name) {
|
public CompletionTest_ArgumentType_NoPrefix(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix_Bug50642.class.getName());
|
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix.class.getName());
|
||||||
suite.addTest(new CompletionTest_ArgumentType_NoPrefix_Bug50642("testCompletionProposals"));
|
suite.addTest(new CompletionTest_ArgumentType_NoPrefix("testCompletionProposals"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
|
@ -8,13 +8,12 @@
|
||||||
* 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
|
||||||
|
@ -23,25 +22,25 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
|
||||||
* Bug#50642 : Wrong completion kind when declaring an argument type
|
* Bug#50642 : Wrong completion kind when declaring an argument type
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CompletionTest_ArgumentType_NoPrefix2_Bug50642 extends CompletionProposalsBaseTest{
|
public class CompletionTest_ArgumentType_NoPrefix2 extends CompletionProposalsBaseTest{
|
||||||
private final String fileName = "CompletionTestStart19.cpp";
|
private final String fileName = "CompletionTestStart19.cpp";
|
||||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
private final String fileFullPath ="resources/contentassist/" + 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 = "ASTClassSpecifier";
|
private final String expectedScopeName = "ASTClassSpecifier";
|
||||||
private final String expectedContextName = "null";
|
private final String expectedContextName = "null";
|
||||||
private final CompletionKind expectedKind = CompletionKind.FIELD_TYPE; // should be CompletionKind.ARGUMENT_TYPE;
|
private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE;
|
||||||
private final String expectedPrefix = "";
|
private final String expectedPrefix = "";
|
||||||
private final String[] expectedResults = {
|
private final String[] expectedResults = {
|
||||||
};
|
};
|
||||||
|
|
||||||
public CompletionTest_ArgumentType_NoPrefix2_Bug50642(String name) {
|
public CompletionTest_ArgumentType_NoPrefix2(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix2_Bug50642.class.getName());
|
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix2.class.getName());
|
||||||
suite.addTest(new CompletionTest_ArgumentType_NoPrefix2_Bug50642("testCompletionProposals"));
|
suite.addTest(new CompletionTest_ArgumentType_NoPrefix2("testCompletionProposals"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
|
@ -8,13 +8,12 @@
|
||||||
* 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
|
||||||
|
@ -23,14 +22,14 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
|
||||||
* Bug#50642 : Wrong completion kind when declaring an argument type
|
* Bug#50642 : Wrong completion kind when declaring an argument type
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CompletionTest_ArgumentType_Prefix_Bug50642 extends CompletionProposalsBaseTest{
|
public class CompletionTest_ArgumentType_Prefix extends CompletionProposalsBaseTest{
|
||||||
private final String fileName = "CompletionTestStart16.cpp";
|
private final String fileName = "CompletionTestStart16.cpp";
|
||||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
private final String fileFullPath ="resources/contentassist/" + 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";
|
private final String expectedScopeName = "ASTCompilationUnit";
|
||||||
private final String expectedContextName = "null";
|
private final String expectedContextName = "null";
|
||||||
private final CompletionKind expectedKind = CompletionKind.VARIABLE_TYPE; // should be CompletionKind.ARGUMENT_TYPE;
|
private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE;
|
||||||
private final String expectedPrefix = "a";
|
private final String expectedPrefix = "a";
|
||||||
private final String[] expectedResults = {
|
private final String[] expectedResults = {
|
||||||
"aClass",
|
"aClass",
|
||||||
|
@ -40,13 +39,13 @@ public class CompletionTest_ArgumentType_Prefix_Bug50642 extends CompletionProp
|
||||||
"AStruct"
|
"AStruct"
|
||||||
};
|
};
|
||||||
|
|
||||||
public CompletionTest_ArgumentType_Prefix_Bug50642(String name) {
|
public CompletionTest_ArgumentType_Prefix(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix_Bug50642.class.getName());
|
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix.class.getName());
|
||||||
suite.addTest(new CompletionTest_ArgumentType_Prefix_Bug50642("testCompletionProposals"));
|
suite.addTest(new CompletionTest_ArgumentType_Prefix("testCompletionProposals"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
|
@ -8,13 +8,12 @@
|
||||||
* 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
|
||||||
|
@ -23,14 +22,14 @@ import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
|
||||||
* Bug#50642 : Wrong completion kind when declaring an argument type
|
* Bug#50642 : Wrong completion kind when declaring an argument type
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CompletionTest_ArgumentType_Prefix2_Bug50642 extends CompletionProposalsBaseTest{
|
public class CompletionTest_ArgumentType_Prefix2 extends CompletionProposalsBaseTest{
|
||||||
private final String fileName = "CompletionTestStart18.cpp";
|
private final String fileName = "CompletionTestStart18.cpp";
|
||||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
private final String fileFullPath ="resources/contentassist/" + 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 = "ASTClassSpecifier";
|
private final String expectedScopeName = "ASTClassSpecifier";
|
||||||
private final String expectedContextName = "null";
|
private final String expectedContextName = "null";
|
||||||
private final CompletionKind expectedKind = CompletionKind.FIELD_TYPE; // should be CompletionKind.ARGUMENT_TYPE;
|
private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE;
|
||||||
private final String expectedPrefix = "a";
|
private final String expectedPrefix = "a";
|
||||||
private final String[] expectedResults = {
|
private final String[] expectedResults = {
|
||||||
"aClass",
|
"aClass",
|
||||||
|
@ -40,13 +39,13 @@ public class CompletionTest_ArgumentType_Prefix2_Bug50642 extends CompletionPro
|
||||||
"AStruct"
|
"AStruct"
|
||||||
};
|
};
|
||||||
|
|
||||||
public CompletionTest_ArgumentType_Prefix2_Bug50642(String name) {
|
public CompletionTest_ArgumentType_Prefix2(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix2_Bug50642.class.getName());
|
TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix2.class.getName());
|
||||||
suite.addTest(new CompletionTest_ArgumentType_Prefix2_Bug50642("testCompletionProposals"));
|
suite.addTest(new CompletionTest_ArgumentType_Prefix2("testCompletionProposals"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
Loading…
Add table
Reference in a new issue