mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Old code for checking completion kind, and scope removed.
This commit is contained in:
parent
20ace94bc2
commit
5939ff9c35
17 changed files with 8 additions and 422 deletions
|
@ -26,9 +26,6 @@ public class CompletionFailedTest_MemberReference_Arrow_Prefix2 extends Complet
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTMethod";
|
||||
private final String expectedContextName = "ASTBinaryExpression";
|
||||
private final CompletionKind expectedKind = CompletionKind.MEMBER_REFERENCE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aField : int",
|
||||
|
@ -55,27 +52,6 @@ Result: author - author name
|
|||
return getBuffer().indexOf("->a ") + 3;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,7 @@ import junit.framework.TestCase;
|
|||
import org.eclipse.cdt.core.CCProjectNature;
|
||||
import org.eclipse.cdt.core.dom.ast.ASTCompletionNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
|
@ -71,10 +72,7 @@ public abstract class CompletionProposalsBaseTest extends TestCase{
|
|||
protected abstract String getHeaderFileName();
|
||||
protected abstract String getHeaderFileFullPath();
|
||||
protected abstract int getCompletionPosition();
|
||||
protected abstract String getExpectedScopeClassName();
|
||||
protected abstract String getExpectedContextClassName();
|
||||
protected abstract String getExpectedPrefix();
|
||||
protected abstract IASTCompletionNode.CompletionKind getExpectedKind();
|
||||
protected abstract String[] getExpectedResultsValues();
|
||||
protected String getFunctionOrConstructorName() { return EMPTY_STRING; }
|
||||
|
||||
|
@ -118,10 +116,8 @@ public abstract class CompletionProposalsBaseTest extends TestCase{
|
|||
|
||||
public void testCompletionProposals() throws Exception {
|
||||
// setup the translation unit, the buffer and the document
|
||||
//ITranslationUnit header = (ITranslationUnit)CoreModel.getDefault().create(fHeaderFile);
|
||||
ITranslationUnit tu = (ITranslationUnit)CoreModel.getDefault().create(fCFile);
|
||||
buffer = tu.getBuffer().getContents();
|
||||
// document = new Document(buffer);
|
||||
|
||||
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
|
||||
FileEditorInput editorInput = new FileEditorInput(fCFile);
|
||||
|
@ -131,15 +127,7 @@ public abstract class CompletionProposalsBaseTest extends TestCase{
|
|||
IAction completionAction = editor.getAction("ContentAssistProposal");
|
||||
|
||||
CCompletionProcessor2 completionProcessor = new CCompletionProcessor2(editorPart);
|
||||
// IWorkingCopy wc = null;
|
||||
// try{
|
||||
// wc = tu.getWorkingCopy();
|
||||
// }catch (CModelException e){
|
||||
// fail("Failed to get working copy"); //$NON-NLS-1$
|
||||
// }
|
||||
|
||||
// call the CompletionProcessor
|
||||
// ICompletionProposal[] results = completionProcessor.evalProposals(document, pos, wc, null);
|
||||
ICompletionProposal[] results = completionProcessor.computeCompletionProposals(editor.getCSourceViewer(), getCompletionPosition()); // (document, pos, wc, null);
|
||||
assertTrue(results != null);
|
||||
if (CTestPlugin.getDefault().isDebugging()) {
|
||||
|
@ -151,30 +139,12 @@ public abstract class CompletionProposalsBaseTest extends TestCase{
|
|||
|
||||
// check the completion node
|
||||
ASTCompletionNode currentCompletionNode = completionProcessor.getCurrentCompletionNode();
|
||||
assertNotNull(currentCompletionNode);
|
||||
IASTName[] names = currentCompletionNode.getNames();
|
||||
IASTName currentName = names[0];
|
||||
// IASTCompletionNode completionNode = (IASTCompletionNode) currentCompletionNode ;
|
||||
// assertNotNull(completionNode);
|
||||
assertNotNull(currentCompletionNode);
|
||||
// scope
|
||||
// IASTScope scope = completionNode.getCompletionScope();
|
||||
// assertNotNull(scope);
|
||||
// assertTrue(scope.getClass().getName().endsWith(getExpectedScopeClassName()));
|
||||
// // context
|
||||
// IASTNode context = completionNode.getCompletionContext();
|
||||
// if(context == null)
|
||||
// assertTrue(getExpectedContextClassName().equals("null")); //$NON-NLS-1$
|
||||
// else
|
||||
// assertTrue(context.getClass().getName().endsWith(getExpectedContextClassName()));
|
||||
// // kind
|
||||
// IASTCompletionNode.CompletionKind kind = completionNode.getCompletionKind();
|
||||
// assertTrue(kind == getExpectedKind());
|
||||
// prefix
|
||||
// String prefix = completionNode.getCompletionPrefix();
|
||||
IBinding binding = currentName.getBinding();
|
||||
String prefix = currentCompletionNode.getPrefix();
|
||||
assertEquals(prefix, getExpectedPrefix());
|
||||
|
||||
// assertEquals( completionNode.getFunctionName(), getFunctionOrConstructorName() );
|
||||
assertEquals(getExpectedPrefix(), prefix);
|
||||
|
||||
String[] expected = getExpectedResultsValues();
|
||||
|
||||
|
@ -226,4 +196,4 @@ public abstract class CompletionProposalsBaseTest extends TestCase{
|
|||
return tu;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -27,9 +27,6 @@ public class CompletionTest_ArgumentType_Prefix extends CompletionProposalsBase
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTCompilationUnit";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aClass",
|
||||
|
@ -64,27 +61,6 @@ Result: aVariable : int
|
|||
return getBuffer().indexOf(" a ") + 2;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -27,9 +27,6 @@ public class CompletionTest_ArgumentType_Prefix2 extends CompletionProposalsBas
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTClassSpecifier";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.ARGUMENT_TYPE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aClass",
|
||||
|
@ -64,27 +61,6 @@ Result: aVariable : int
|
|||
return getBuffer().indexOf(" a ") + 2;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -28,9 +28,6 @@ public class CompletionTest_ClassReference_Prefix extends CompletionProposalsBa
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName; //$NON-NLS-1$
|
||||
private final String headerFileName = "CompletionTestStart.h"; //$NON-NLS-1$
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName; //$NON-NLS-1$
|
||||
private final String expectedScopeName = "ASTClassSpecifier"; //$NON-NLS-1$
|
||||
private final String expectedContextName = "null"; //$NON-NLS-1$
|
||||
private final CompletionKind expectedKind = CompletionKind.CLASS_REFERENCE;
|
||||
private final String expectedPrefix = "a"; //$NON-NLS-1$
|
||||
private final String[] expectedResults = {
|
||||
"aClass", //$NON-NLS-1$
|
||||
|
@ -65,27 +62,6 @@ public class CompletionTest_ClassReference_Prefix extends CompletionProposalsBa
|
|||
return getBuffer().indexOf(" a ") + 2; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -29,9 +29,6 @@ public class CompletionTest_ExceptionReference_Prefix extends CompletionProposa
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTMethod";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.EXCEPTION_REFERENCE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aClass",
|
||||
|
@ -69,27 +66,6 @@ Result: aVariable : int
|
|||
return getBuffer().indexOf(" a ") + 2;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -28,9 +28,6 @@ public class CompletionTest_FunctionReference_Prefix extends CompletionProposal
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTMethod";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.FUNCTION_REFERENCE;
|
||||
private final String expectedPrefix = "x";
|
||||
private final String[] expectedResults = {
|
||||
"xLocal : int",
|
||||
|
@ -65,27 +62,6 @@ public class CompletionTest_FunctionReference_Prefix extends CompletionProposal
|
|||
return getBuffer().indexOf(" x ") + 2;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -26,9 +26,6 @@ public class CompletionTest_MemberReference_Arrow_Prefix extends CompletionProp
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTMethod";
|
||||
private final String expectedContextName = "ASTVariable";
|
||||
private final CompletionKind expectedKind = CompletionKind.MEMBER_REFERENCE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aField : int",
|
||||
|
@ -53,27 +50,6 @@ public class CompletionTest_MemberReference_Arrow_Prefix extends CompletionProp
|
|||
return getBuffer().indexOf(" c->a ") + 5;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -26,10 +26,7 @@ public class CompletionTest_MemberReference_Dot_NoPrefix extends CompletionProp
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTMethod";
|
||||
private final String expectedContextName = "ASTVariable";
|
||||
private final CompletionKind expectedKind = CompletionKind.MEMBER_REFERENCE;
|
||||
private final String expectedPrefix = "EOC" ; // ""; FIXME: Why does the completion node have this 'EOC' as prefix?
|
||||
private final String expectedPrefix = "" ;
|
||||
private final String[] expectedResults = {
|
||||
"aField : int",
|
||||
"xAClassField : float",
|
||||
|
@ -56,27 +53,6 @@ public class CompletionTest_MemberReference_Dot_NoPrefix extends CompletionProp
|
|||
return getBuffer().indexOf(" c. ") + 3;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -26,9 +26,6 @@ public class CompletionTest_MemberReference_Dot_Prefix extends CompletionPropos
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTMethod";
|
||||
private final String expectedContextName = "ASTVariable";
|
||||
private final CompletionKind expectedKind = CompletionKind.MEMBER_REFERENCE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aField : int",
|
||||
|
@ -53,27 +50,6 @@ public class CompletionTest_MemberReference_Dot_Prefix extends CompletionPropos
|
|||
return getBuffer().indexOf(" c.a ") + 4;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -28,9 +28,6 @@ public class CompletionTest_NewTypeReference_Prefix extends CompletionProposals
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTMethod";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.NEW_TYPE_REFERENCE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aClass",
|
||||
|
@ -67,27 +64,6 @@ Result: aVariable : int
|
|||
return getBuffer().indexOf(" a ") + 2;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -26,9 +26,6 @@ public class CompletionTest_SingleName_Method_Prefix extends CompletionProposa
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTMethod";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.SINGLE_NAME_REFERENCE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"anotherField : int",
|
||||
|
@ -64,27 +61,6 @@ public class CompletionTest_SingleName_Method_Prefix extends CompletionProposa
|
|||
return getBuffer().indexOf(" a ") + 2;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -25,9 +25,6 @@ public class CompletionTest_SingleName_Prefix extends CompletionProposalsBaseTe
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTFunction";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.SINGLE_NAME_REFERENCE;
|
||||
private final String expectedPrefix = "AM";
|
||||
private final String[] expectedResults = {
|
||||
"AMacro(x)"
|
||||
|
@ -49,27 +46,6 @@ public class CompletionTest_SingleName_Prefix extends CompletionProposalsBaseTe
|
|||
return getBuffer().indexOf(" AM ") + 3;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -25,9 +25,6 @@ public class CompletionTest_SingleName_Prefix2 extends CompletionProposalsBaseT
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTFunction";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.SINGLE_NAME_REFERENCE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aVariable : int",
|
||||
|
@ -63,27 +60,6 @@ public class CompletionTest_SingleName_Prefix2 extends CompletionProposalsBaseT
|
|||
return getBuffer().indexOf(" a ") + 2;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -27,10 +27,7 @@ public class CompletionTest_TypeRef_NoPrefix extends CompletionProposalsBaseTes
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTCompilationUnit";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.TYPE_REFERENCE;
|
||||
private final String expectedPrefix = "EOC" ; // ""; FIXME: Why does the CompletionNode have 'EOC' as expected prefix?
|
||||
private final String expectedPrefix = "" ;
|
||||
private final String[] expectedResults = {
|
||||
"aNamespace",
|
||||
"xNamespace"
|
||||
|
@ -73,27 +70,6 @@ Result: xVariable : int
|
|||
return getBuffer().indexOf("using ") + 6;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -28,9 +28,6 @@ public class CompletionTest_TypeRef_Prefix extends CompletionProposalsBaseTest{
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTCompilationUnit";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.TYPE_REFERENCE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aNamespace"
|
||||
|
@ -64,27 +61,6 @@ Result: aVariable : int
|
|||
return getBuffer().indexOf("using a ") + 7;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
|
@ -25,16 +25,13 @@ public class CompletionTest_VariableType_Prefix extends CompletionProposalsBase
|
|||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
|
||||
private final String expectedScopeName = "ASTCompilationUnit";
|
||||
private final String expectedContextName = "null";
|
||||
private final CompletionKind expectedKind = CompletionKind.VARIABLE_TYPE;
|
||||
private final String expectedPrefix = "a";
|
||||
private final String[] expectedResults = {
|
||||
"aClass",
|
||||
"anotherClass",
|
||||
"aNamespace",
|
||||
"anEnumeration",
|
||||
"AStruct"
|
||||
// "AStruct" FIXME: Result removed. The DOM search is currently case sensitive
|
||||
};
|
||||
|
||||
public CompletionTest_VariableType_Prefix(String name) {
|
||||
|
@ -53,27 +50,6 @@ public class CompletionTest_VariableType_Prefix extends CompletionProposalsBase
|
|||
return getBuffer().indexOf(" a ") + 2;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedScope()
|
||||
*/
|
||||
protected String getExpectedScopeClassName() {
|
||||
return expectedScopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedContext()
|
||||
*/
|
||||
protected String getExpectedContextClassName() {
|
||||
return expectedContextName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedKind()
|
||||
*/
|
||||
protected CompletionKind getExpectedKind() {
|
||||
return expectedKind;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue