From 00cf81d29158ff97f8d7ad20afa3b1826e3e91f3 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Tue, 9 Jan 2007 10:39:05 +0000 Subject: [PATCH] Reworked contentassist2 test cases and add them to the automated suite --- .../eclipse/cdt/ui/tests/AutomatedSuite.java | 9 +- .../eclipse/cdt/ui/tests/BaseUITestCase.java | 3 - .../AbstractCompletionTest.java | 218 ++++++++++++++++++ .../CompletionProposalsBaseTest.java | 206 ++++------------- .../CompletionTest_ArgumentType_NoPrefix.java | 11 + ...CompletionTest_ArgumentType_NoPrefix2.java | 12 + .../CompletionTest_ArgumentType_Prefix.java | 5 +- .../CompletionTest_ArgumentType_Prefix2.java | 5 +- ...ompletionTest_ClassReference_NoPrefix.java | 2 + .../CompletionTest_ClassReference_Prefix.java | 3 +- .../CompletionTest_ConstructorReference.java | 2 + ...etionTest_ExceptionReference_NoPrefix.java | 4 +- ...pletionTest_ExceptionReference_Prefix.java | 5 +- .../CompletionTest_FieldType_NoPrefix.java | 3 + .../CompletionTest_FieldType_NoPrefix2.java | 3 + .../CompletionTest_FieldType_Prefix.java | 5 +- .../CompletionTest_MacroRef_NoPrefix.java | 11 +- .../CompletionTest_MacroRef_Prefix.java | 5 +- ...onTest_MemberReference_Arrow_NoPrefix.java | 4 + ...tionTest_MemberReference_Arrow_Prefix.java | 2 + ...onTest_MemberReference_Arrow_Prefix2.java} | 25 +- ...tionTest_MemberReference_Dot_NoPrefix.java | 2 + ...letionTest_MemberReference_Dot_Prefix.java | 4 + .../CompletionTest_NamespaceRef_NoPrefix.java | 2 + .../CompletionTest_NamespaceRef_Prefix.java | 3 + ...pletionTest_NewTypeReference_NoPrefix.java | 7 + ...ompletionTest_NewTypeReference_Prefix.java | 5 +- ...tionTest_ScopedReference_NonCodeScope.java | 2 + ...CompletionTest_ScopedReference_Prefix.java | 13 -- ...letionTest_SingleName_Method_NoPrefix.java | 2 + ...mpletionTest_SingleName_Method_Prefix.java | 13 +- .../CompletionTest_SingleName_NoPrefix.java | 2 + .../CompletionTest_SingleName_Prefix2.java | 6 +- .../CompletionTest_TypeDef_NoPrefix.java | 9 - .../CompletionTest_TypeDef_Prefix.java | 10 - .../CompletionTest_TypeRef_NoPrefix.java | 2 + .../CompletionTest_TypeRef_Prefix.java | 3 +- ...pletionTest_VariableType_NestedPrefix.java | 2 + .../CompletionTest_VariableType_NoPrefix.java | 11 + .../CompletionTest_VariableType_Prefix.java | 14 +- .../ContentAssist2TestSuite.java | 2 +- 41 files changed, 415 insertions(+), 242 deletions(-) create mode 100644 core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/AbstractCompletionTest.java rename core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/{CompletionFailedTest_MemberReference_Arrow_Prefix2.java => CompletionTest_MemberReference_Arrow_Prefix2.java} (77%) diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java index ff26a1afc8f..ff200ed38ee 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java @@ -20,6 +20,7 @@ import org.eclipse.cdt.ui.tests.callhierarchy.CallHierarchyTestSuite; import org.eclipse.cdt.ui.tests.includebrowser.IncludeBrowserTestSuite; import org.eclipse.cdt.ui.tests.text.TextTestSuite; import org.eclipse.cdt.ui.tests.text.contentassist.ContentAssistTestSuite; +import org.eclipse.cdt.ui.tests.text.contentassist2.ContentAssist2TestSuite; import org.eclipse.cdt.ui.tests.text.selection.SelectionTestSuite; import org.eclipse.cdt.ui.tests.viewsupport.ViewSupportTestSuite; @@ -56,12 +57,12 @@ public class AutomatedSuite extends TestSuite { // tests from package org.eclipse.cdt.ui.tests.text.contentAssist addTest(ContentAssistTestSuite.suite()); + // tests from package org.eclipse.cdt.ui.tests.text.contentAssist2 + addTest(ContentAssist2TestSuite.suite()); + // tests from the refactoring plugin addTest(RenameRegressionTests.suite()); - // tests from package org.eclipse.cdt.ui.tests.text.contentAssist2 - // commented out because they are failing pretty badly - // addTest(ContentAssist2TestSuite.suite()); - + // tests from package org.eclipse.cdt.ui.tests.text.selection addTest(SelectionTestSuite.suite()); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java index e8f30db338d..e39b6afe35c 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/BaseUITestCase.java @@ -8,7 +8,6 @@ * Contributors: * Markus Schorn - initial API and implementation *******************************************************************************/ - package org.eclipse.cdt.ui.tests; import java.io.IOException; @@ -30,8 +29,6 @@ import org.eclipse.cdt.core.testplugin.util.TestSourceReader; import org.eclipse.cdt.ui.testplugin.CTestPlugin; public class BaseUITestCase extends BaseTestCase { - private boolean fExpectFailure= false; - private int fBugnumber= 0; public BaseUITestCase() { super(); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/AbstractCompletionTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/AbstractCompletionTest.java new file mode 100644 index 00000000000..bccb09e949e --- /dev/null +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/AbstractCompletionTest.java @@ -0,0 +1,218 @@ +/******************************************************************************* + * Copyright (c) 2004, 2006 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Rational Software - Initial API and implementation + * Anton Leherbauer (Wind River Systems) + *******************************************************************************/ +package org.eclipse.cdt.ui.tests.text.contentassist2; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.jface.text.contentassist.ICompletionProposal; +import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.jface.text.templates.TemplateProposal; +import org.eclipse.ui.texteditor.AbstractTextEditor; +import org.eclipse.ui.texteditor.ITextEditor; + +import org.eclipse.cdt.core.dom.IPDOMManager; +import org.eclipse.cdt.core.dom.ast.ASTCompletionNode; +import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.cdt.core.parser.KeywordSetKey; +import org.eclipse.cdt.core.parser.ParserFactory; +import org.eclipse.cdt.core.parser.ParserLanguage; +import org.eclipse.cdt.core.testplugin.CProjectHelper; +import org.eclipse.cdt.ui.testplugin.CTestPlugin; +import org.eclipse.cdt.ui.tests.BaseUITestCase; +import org.eclipse.cdt.ui.tests.text.EditorTestHelper; +import org.eclipse.cdt.ui.text.ICCompletionProposal; + +import org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProcessor2; + +/** + * + * @since 4.0 + */ +public abstract class AbstractCompletionTest extends BaseUITestCase { + + private ICProject fCProject; + protected IFile fCFile; + private ITextEditor fEditor; + + private final static Set fgAllKeywords= new HashSet(); + + static { + Set cKeywords= ParserFactory.getKeywordSet(KeywordSetKey.KEYWORDS, ParserLanguage.C); + Set cppKeywords= ParserFactory.getKeywordSet(KeywordSetKey.KEYWORDS, ParserLanguage.CPP); + fgAllKeywords.addAll(cKeywords); + fgAllKeywords.addAll(cppKeywords); + } + public AbstractCompletionTest(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + fCProject= CProjectHelper.createCCProject(getName(), "unused", IPDOMManager.ID_FAST_INDEXER); + fCFile= setUpProjectContent(fCProject.getProject()); + assertNotNull(fCFile); + fEditor= (ITextEditor)EditorTestHelper.openInEditor(fCFile, true); + assertNotNull(fEditor); + EditorTestHelper.joinBackgroundActivities((AbstractTextEditor)fEditor); + } + + /** + * Setup the project's content. + * @param project + * @return the file to be opened in the editor + * @throws Exception + */ + protected abstract IFile setUpProjectContent(IProject project) throws Exception; + + protected void tearDown() throws Exception { + EditorTestHelper.closeEditor(fEditor); + fEditor= null; + CProjectHelper.delete(fCProject); + fCProject= null; + fCFile= null; + super.tearDown(); + } + + protected void assertCompletionResults(int offset, String[] expected, boolean compareIdString) throws Exception { + + if (CTestPlugin.getDefault().isDebugging()) { + System.out.println("\n\n\n\n\nTesting "+this.getClass().getName()); + } + + CCompletionProcessor2 completionProcessor = new CCompletionProcessor2(fEditor); + // call the CompletionProcessor + ISourceViewer sourceViewer= EditorTestHelper.getSourceViewer((AbstractTextEditor)fEditor); + long startTime= System.currentTimeMillis(); + ICompletionProposal[] results = completionProcessor.computeCompletionProposals(sourceViewer, offset); + long endTime= System.currentTimeMillis(); + assertTrue(results != null); + + results= filterProposals(results); + + checkCompletionNode(completionProcessor.getCurrentCompletionNode()); + + if (CTestPlugin.getDefault().isDebugging()) { + System.out.println("Time (ms): " + (endTime-startTime)); + for (int i = 0; i < results.length; i++) { + ICompletionProposal proposal = results[i]; + System.out.println("Result: " + proposal.getDisplayString()); + } + } + + boolean allFound = true ; // for the time being, let's be optimistic + + for (int i = 0; i< expected.length; i++){ + boolean found = false; + for(int j = 0; j< results.length; j++){ + ICompletionProposal proposal = results[j]; + String displayString = proposal.getDisplayString(); + if(expected[i].equals(displayString)){ + found = true; + if (CTestPlugin.getDefault().isDebugging()) { + System.out.println("Lookup success for " + expected[i]); + } + break; + } + } + if (!found) { + allFound = false ; + if (CTestPlugin.getDefault().isDebugging()) { + System.out.println( "Lookup failed for " + expected[i]); //$NON-NLS-1$ + } + } + } + + String[] resultStrings= toStringArray(results, compareIdString); + Arrays.sort(expected); + Arrays.sort(resultStrings); + + if (!allFound) { + assertEquals("Missing results!", toString(expected), toString(resultStrings)); + } else if (doCheckExtraResults()) { + assertEquals("Extra results!", toString(expected), toString(resultStrings)); + } + + } + + /** + * Perform additional checks on the ASTCompletionNode. + * + * @param currentCompletionNode + */ + protected void checkCompletionNode(ASTCompletionNode currentCompletionNode) { + // no-op by default + } + + private String toString(String[] strings) { + StringBuffer buf= new StringBuffer(); + for(int i=0; i< strings.length; i++){ + buf.append(strings[i]).append('\n'); + } + return buf.toString(); + } + + private String[] toStringArray(ICompletionProposal[] proposals, boolean useIdString) { + String[] strings= new String[proposals.length]; + for(int i=0; i< proposals.length; i++){ + ICompletionProposal proposal = proposals[i]; + if (proposal instanceof ICCompletionProposal && useIdString) { + strings[i]= ((ICCompletionProposal)proposal).getIdString(); + } else { + strings[i]= proposal.getDisplayString(); + } + } + return strings; + } + + /** + * Override to relax checking of extra results + */ + protected boolean doCheckExtraResults() { + return true ; + } + + /** + * Filter out template and keyword proposals. + * @param results + * @return filtered proposals + */ + private ICompletionProposal[] filterProposals(ICompletionProposal[] results) { + List filtered= new ArrayList(); + for (int i = 0; i < results.length; i++) { + ICompletionProposal proposal = results[i]; + if (proposal instanceof TemplateProposal) { + continue; + } + if (proposal instanceof ICCompletionProposal) { + // check for keywords proposal + if (fgAllKeywords.contains(proposal.getDisplayString())) { + continue; + } + } + filtered.add(proposal); + } + return (ICompletionProposal[]) filtered.toArray(new ICompletionProposal[filtered.size()]); + } + + /** + * @return the content of the editor buffer + */ + protected String getBuffer() { + return EditorTestHelper.getDocument(fEditor).get(); + } +} \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionProposalsBaseTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionProposalsBaseTest.java index 043282e307e..710ceb2944e 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionProposalsBaseTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionProposalsBaseTest.java @@ -6,7 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Rational Software - Initial API and implementation + * IBM Rational Software - Initial API and implementation + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.ui.tests.text.contentassist2; @@ -17,199 +18,92 @@ package org.eclipse.cdt.ui.tests.text.contentassist2; * */ import java.io.FileInputStream; - -import junit.framework.TestCase; +import java.io.FileNotFoundException; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.dom.IPDOMManager; 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; -import org.eclipse.cdt.core.testplugin.CProjectHelper; import org.eclipse.cdt.ui.testplugin.CTestPlugin; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.internal.ui.text.contentassist.CCompletionProcessor2; +public abstract class CompletionProposalsBaseTest extends AbstractCompletionTest { + + private boolean fFailingTest; -public abstract class CompletionProposalsBaseTest extends TestCase{ - protected static final String EMPTY_STRING = ""; //$NON-NLS-1$ - private final String projectName = "TestProject1"; //$NON-NLS-1$ - private final String projectType = "bin"; //$NON-NLS-1$ - private ICProject fCProject; - private IFile fCFile; - private IFile fHeaderFile; - private NullProgressMonitor monitor; - private ITranslationUnit tu = null; - private String buffer = EMPTY_STRING; - private Document document = null; - - public CompletionProposalsBaseTest(String name) { super(name); } /* - * Derived classes have to provide these test parameters + * @see junit.framework.TestCase#getName() + */ + public String getName() { + if (fFailingTest) { + return "[Failing] " + super.getName(); + } + return super.getName(); + } + + /* + * @see org.eclipse.cdt.core.testplugin.util.BaseTestCase#setExpectFailure(int) + */ + public void setExpectFailure(int bugnumber) { + super.setExpectFailure(bugnumber); + fFailingTest= true; + } + + /* + * Derived classes have to provide the file locations */ protected abstract String getFileName(); protected abstract String getFileFullPath(); protected abstract String getHeaderFileName(); protected abstract String getHeaderFileFullPath(); + /* + * Derived classes have to provide these test parameters + */ protected abstract int getCompletionPosition(); protected abstract String getExpectedPrefix(); protected abstract String[] getExpectedResultsValues(); - protected String getFunctionOrConstructorName() { return EMPTY_STRING; } - - /** - * Override to relax checking of extra results - */ - protected boolean doCheckExtraResults() { - return true ; - } - - protected void setUp() throws Exception { - monitor = new NullProgressMonitor(); - - fCProject= CProjectHelper.createCProject(projectName, projectType, IPDOMManager.ID_NO_INDEXER); - fHeaderFile = fCProject.getProject().getFile(getHeaderFileName()); + + protected IFile setUpProjectContent(IProject project) throws FileNotFoundException { + IFile headerFile = project.getFile(getHeaderFileName()); String fileName = getFileName(); - fCFile = fCProject.getProject().getFile(fileName); - if ( (!fCFile.exists()) &&( !fHeaderFile.exists() )) { + IFile bodyFile = project.getFile(fileName); + if ( (!bodyFile.exists()) &&( !headerFile.exists() )) { + IProgressMonitor monitor= new NullProgressMonitor(); try{ FileInputStream headerFileIn = new FileInputStream( CTestPlugin.getDefault().getFileInPlugin(new Path(getHeaderFileFullPath()))); - fHeaderFile.create(headerFileIn,false, monitor); + headerFile.create(headerFileIn,false, monitor); FileInputStream bodyFileIn = new FileInputStream( CTestPlugin.getDefault().getFileInPlugin(new Path(getFileFullPath()))); - fCFile.create(bodyFileIn,false, monitor); + bodyFile.create(bodyFileIn,false, monitor); } catch (CoreException e) { e.printStackTrace(); } } - if (!fCProject.getProject().hasNature(CCProjectNature.CC_NATURE_ID)) { - addNatureToProject(fCProject.getProject(), CCProjectNature.CC_NATURE_ID, null); - } + return bodyFile; } - private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException { - IProjectDescription description = proj.getDescription(); - String[] prevNatures= description.getNatureIds(); - String[] newNatures= new String[prevNatures.length + 1]; - System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); - newNatures[prevNatures.length]= natureId; - description.setNatureIds(newNatures); - proj.setDescription(description, monitor); - } - - protected void tearDown() { - CProjectHelper.delete(fCProject); - } - public void testCompletionProposals() throws Exception { - - if (CTestPlugin.getDefault().isDebugging()) { - System.out.println("\n\n\n\n\nTesting "+this.getClass().getName()); - } - // setup the translation unit, the buffer and the document - ITranslationUnit tu = (ITranslationUnit)CoreModel.getDefault().create(fCFile); - buffer = tu.getBuffer().getContents(); - - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - FileEditorInput editorInput = new FileEditorInput(fCFile); - IEditorPart editorPart = page.openEditor(editorInput, "org.eclipse.cdt.ui.editor.CEditor"); - - CEditor editor = (CEditor) editorPart ; - IAction completionAction = editor.getAction("ContentAssistProposal"); - - CCompletionProcessor2 completionProcessor = new CCompletionProcessor2(editorPart); - // call the CompletionProcessor - ICompletionProposal[] results = completionProcessor.computeCompletionProposals(editor.getCSourceViewer(), getCompletionPosition()); // (document, pos, wc, null); - assertTrue(results != null); - if (CTestPlugin.getDefault().isDebugging()) { - for (int i = 0; i < results.length; i++) { - ICompletionProposal proposal = results[i]; - System.out.println("Result: " + proposal.getDisplayString()); - } - } - - // check the completion node - ASTCompletionNode currentCompletionNode = completionProcessor.getCurrentCompletionNode(); - assertNotNull("null completion node!", currentCompletionNode); - IASTName[] names = currentCompletionNode.getNames(); - IASTName currentName = names[0]; - IBinding binding = currentName.getBinding(); - String prefix = currentCompletionNode.getPrefix(); - assertEquals(getExpectedPrefix(), prefix); - - String[] expected = getExpectedResultsValues(); + String[] expected = getExpectedResultsValues(); + assertCompletionResults(getCompletionPosition(), expected, false); - boolean allFound = true ; // for the time being, let's be optimistic - - for (int i = 0; i< expected.length; i++){ - boolean found = false; - for(int j = 0; j< results.length; j++){ - ICompletionProposal proposal = results[j]; - String displayString = proposal.getDisplayString(); - if(expected[i].equals(displayString)){ - found = true; - if (CTestPlugin.getDefault().isDebugging()) { - System.out.println("Lookup success for " + expected[i]); - } - break; - } - } - if (!found) { - allFound = false ; - if (CTestPlugin.getDefault().isDebugging()) { - System.out.println( "Lookup failed for " + expected[i]); //$NON-NLS-1$ - } - } - } - assertTrue("Not enough results!", results.length >= expected.length); - if (doCheckExtraResults()) { - assertEquals("Extra results! Run with tracing to see details!", expected.length, results.length); - } - assertTrue("Some expected results were not found!", allFound); - - } + } + + /* + * @see org.eclipse.cdt.ui.tests.text.contentassist2.AbstractCompletionTest#checkCompletionNode(org.eclipse.cdt.core.dom.ast.ASTCompletionNode) + */ + protected void checkCompletionNode(ASTCompletionNode currentCompletionNode) { + assertNotNull("null completion node!", currentCompletionNode); + // check the completion node + String prefix = currentCompletionNode.getPrefix(); + assertEquals(getExpectedPrefix(), prefix); + } - /** - * @return Returns the buffer. - */ - public String getBuffer() { - return buffer; - } - - /** - * @return Returns the document. - */ - public Document getDocument() { - return document; - } - - /** - * @return Returns the tu. - */ - public ITranslationUnit getTranslationUnit() { - return tu; - } - } \ No newline at end of file diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_NoPrefix.java index ec611b2ff33..afc25b3235a 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_NoPrefix.java @@ -28,10 +28,21 @@ public class CompletionTest_ArgumentType_NoPrefix extends CompletionProposalsBa private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = ""; private final String[] expectedResults = { + "aClass", + "anotherClass", + "aNamespace", + "anEnumeration", + "AStruct", + "xOtherClass", + "xNamespace", + "xEnumeration", + "XStruct" }; public CompletionTest_ArgumentType_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_NoPrefix2.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_NoPrefix2.java index c280bcf72d0..7f1f0eb8ebf 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_NoPrefix2.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_NoPrefix2.java @@ -27,10 +27,22 @@ public class CompletionTest_ArgumentType_NoPrefix2 extends CompletionProposalsB private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = ""; private final String[] expectedResults = { + "aClass", + "anotherClass", + "aNamespace", + "anEnumeration", + "AStruct", + "xOtherClass", + "xNamespace", + "xEnumeration", + "XStruct", + "ClassA" }; public CompletionTest_ArgumentType_NoPrefix2(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_Prefix.java index 3a3211ea93d..3b4e9d76d97 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_Prefix.java @@ -31,6 +31,7 @@ public class CompletionTest_ArgumentType_Prefix extends CompletionProposalsBase "anotherClass", "aNamespace", "anEnumeration", + // missing proposal: "AStruct" /* FIXME: Additional results which should not be there. Run with trace enabled to reproduce: Result: aFirstEnum @@ -38,13 +39,15 @@ Result: aFunction(void) bool Result: anotherFunction(void) void Result: aSecondEnum Result: aThirdEnum -Result: author - author name Result: aVariable : int */ }; public CompletionTest_ArgumentType_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724 + // and https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(109724); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_Prefix2.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_Prefix2.java index b7c812aaa5c..12e220d7a07 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_Prefix2.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ArgumentType_Prefix2.java @@ -31,6 +31,7 @@ public class CompletionTest_ArgumentType_Prefix2 extends CompletionProposalsBas "anotherClass", "aNamespace", "anEnumeration", + // missing proposal: "AStruct" /* FIXME: Additional results which should not be there. Run with trace enabled to reproduce: Result: aFirstEnum @@ -38,13 +39,15 @@ Result: aFunction(void) bool Result: anotherFunction(void) void Result: aSecondEnum Result: aThirdEnum -Result: author - author name Result: aVariable : int */ }; public CompletionTest_ArgumentType_Prefix2(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724 + // and https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(109724); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ClassReference_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ClassReference_NoPrefix.java index a757533c8c2..91a02330d85 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ClassReference_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ClassReference_NoPrefix.java @@ -36,6 +36,8 @@ public class CompletionTest_ClassReference_NoPrefix extends CompletionProposals public CompletionTest_ClassReference_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ClassReference_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ClassReference_Prefix.java index 64062765831..53ec1ad4653 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ClassReference_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ClassReference_Prefix.java @@ -38,13 +38,14 @@ public class CompletionTest_ClassReference_Prefix extends CompletionProposalsBa Result: anotherFunction(void) void Result: aSecondEnum Result: aThirdEnum - Result: author - author name Result: aVariable : int */ }; public CompletionTest_ClassReference_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ConstructorReference.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ConstructorReference.java index 1230a16c875..3caa829243b 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ConstructorReference.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ConstructorReference.java @@ -36,6 +36,8 @@ public class CompletionTest_ConstructorReference extends CompletionProposalsBas public CompletionTest_ConstructorReference(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ExceptionReference_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ExceptionReference_NoPrefix.java index 6f57f4e06c3..d037eb26dd0 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ExceptionReference_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ExceptionReference_NoPrefix.java @@ -29,11 +29,13 @@ public class CompletionTest_ExceptionReference_NoPrefix extends CompletionPropo private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = ""; private final String[] expectedResults = { - "..." + "..." // TODO }; public CompletionTest_ExceptionReference_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ExceptionReference_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ExceptionReference_Prefix.java index e393e794009..8b856abaf0c 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ExceptionReference_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ExceptionReference_Prefix.java @@ -33,6 +33,7 @@ public class CompletionTest_ExceptionReference_Prefix extends CompletionProposa "anotherClass", "aNamespace", "anEnumeration", + // missing proposal: "AStruct" /* FIXME: Additional results which should not be there. Run with trace enabled to reproduce: Result: aFirstEnum @@ -42,13 +43,15 @@ Result: anotherFunction(void) void Result: anotherMethod(void) void Result: aSecondEnum Result: aThirdEnum -Result: author - author name Result: aVariable : int */ }; public CompletionTest_ExceptionReference_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724 + // and https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(109724); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_NoPrefix.java index 1a191bfeb1a..2df5aa1e2c1 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_NoPrefix.java @@ -26,10 +26,13 @@ public class CompletionTest_FieldType_NoPrefix extends CompletionProposalsBaseT private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = ""; private final String[] expectedResults = { + "" // TODO }; public CompletionTest_FieldType_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_NoPrefix2.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_NoPrefix2.java index b50a6317fe1..f22bc5bc3ea 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_NoPrefix2.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_NoPrefix2.java @@ -27,10 +27,13 @@ public class CompletionTest_FieldType_NoPrefix2 extends CompletionProposalsBase private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = ""; private final String[] expectedResults = { + "" // TODO }; public CompletionTest_FieldType_NoPrefix2(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_Prefix.java index e365704975d..7c4ec2f9547 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_FieldType_Prefix.java @@ -30,6 +30,7 @@ public class CompletionTest_FieldType_Prefix extends CompletionProposalsBaseTes "aThirdClass", "aNamespace", "anEnumeration", + // missing proposal: "AStruct" /* FIXME: Additional results which should not be returned. Run with tracing enabled to reproduce: Result: aFirstEnum @@ -37,13 +38,15 @@ Result: aFunction(void) bool Result: anotherFunction(void) void Result: aSecondEnum Result: aThirdEnum -Result: author - author name Result: aVariable : int */ }; public CompletionTest_FieldType_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724 + // and https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(109724); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MacroRef_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MacroRef_NoPrefix.java index 932c236396f..e2b0d195838 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MacroRef_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MacroRef_NoPrefix.java @@ -27,21 +27,22 @@ public class CompletionTest_MacroRef_NoPrefix extends CompletionProposalsBaseTe private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = ""; private final String[] expectedResults = { -// Should be -// "aMacro(x)", -// "Debug", -// "xMacro(x,y)" + "aMacro(x)", + "Debug", + "xMacro(x,y)" }; public CompletionTest_MacroRef_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { TestSuite suite= new TestSuite(CompletionTest_MacroRef_NoPrefix.class.getName()); suite.addTest(new CompletionTest_MacroRef_NoPrefix("testCompletionProposals")); return suite; - } + } /* (non-Javadoc) * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition() diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MacroRef_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MacroRef_Prefix.java index a5f0d09a9fa..30712556848 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MacroRef_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MacroRef_Prefix.java @@ -27,12 +27,13 @@ public class CompletionTest_MacroRef_Prefix extends CompletionProposalsBaseTest private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = "D"; private final String[] expectedResults = { -// Should be -// "Debug" + "Debug" }; public CompletionTest_MacroRef_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_NoPrefix.java index 270e2389a15..01c05579760 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_NoPrefix.java @@ -31,10 +31,14 @@ public class CompletionTest_MemberReference_Arrow_NoPrefix extends CompletionPr "xAClassField : float", "aMethod(void) int", "xAClassMethod(int x) void" + /* "aClass" FIXME: Surplus result: aClass is currently returned as a result, but this is not syntactically correct. + Completion processing needs to be fixed, putting this here as a reminder. */ }; public CompletionTest_MemberReference_Arrow_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_Prefix.java index 555d32dcbf6..47ce7aafcb0 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_Prefix.java @@ -34,6 +34,8 @@ public class CompletionTest_MemberReference_Arrow_Prefix extends CompletionProp public CompletionTest_MemberReference_Arrow_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionFailedTest_MemberReference_Arrow_Prefix2.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_Prefix2.java similarity index 77% rename from core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionFailedTest_MemberReference_Arrow_Prefix2.java rename to core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_Prefix2.java index f49d50385e4..af45f142065 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionFailedTest_MemberReference_Arrow_Prefix2.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Arrow_Prefix2.java @@ -19,30 +19,28 @@ import junit.framework.TestSuite; * Complex Context: Function return value: foo()->a(CTRL+SPACE) * */ -public class CompletionFailedTest_MemberReference_Arrow_Prefix2 extends CompletionProposalsBaseTest{ +public class CompletionTest_MemberReference_Arrow_Prefix2 extends CompletionProposalsBaseTest{ private final String fileName = "CompletionTestStart7.cpp"; private final String fileFullPath ="resources/contentassist/" + fileName; private final String headerFileName = "CompletionTestStart.h"; private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = "a"; private final String[] expectedResults = { - "aClass", +// FIXME: additional result +// "aClass", "aField : int", "aMethod(void) int" }; - /* Additional results which should not be found. Run with trace activated to reproduce: - * Result: author - author name - * is a template --> relax extra results checking - */ - - public CompletionFailedTest_MemberReference_Arrow_Prefix2(String name) { + public CompletionTest_MemberReference_Arrow_Prefix2(String name) { super(name) ; + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { - TestSuite suite= new TestSuite(CompletionFailedTest_MemberReference_Arrow_Prefix2.class.getName()); - suite.addTest(new CompletionFailedTest_MemberReference_Arrow_Prefix2("testCompletionProposals")); + TestSuite suite= new TestSuite(CompletionTest_MemberReference_Arrow_Prefix2.class.getName()); + suite.addTest(new CompletionTest_MemberReference_Arrow_Prefix2("testCompletionProposals")); return suite; } /* (non-Javadoc) @@ -93,11 +91,4 @@ public class CompletionFailedTest_MemberReference_Arrow_Prefix2 extends Complet return headerFileName; } - /* (non-Javadoc) - * @see org.eclipse.cdt.ui.tests.text.contentassist2.CompletionProposalsBaseTest#doCheckExtraResults() - */ - protected boolean doCheckExtraResults() { - return false ; - } - } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Dot_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Dot_NoPrefix.java index 24a7b4b0f91..1c0aee6d762 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Dot_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Dot_NoPrefix.java @@ -37,6 +37,8 @@ public class CompletionTest_MemberReference_Dot_NoPrefix extends CompletionProp public CompletionTest_MemberReference_Dot_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Dot_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Dot_Prefix.java index 1e498f85cf0..bf3fb6d1514 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Dot_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_MemberReference_Dot_Prefix.java @@ -28,10 +28,14 @@ public class CompletionTest_MemberReference_Dot_Prefix extends CompletionPropos private final String[] expectedResults = { "aField : int", "aMethod(void) int", + /* "aClass" FIXME: Surplus result: aClass is currently returned as a result, but this is not syntactically correct. + Completion processing needs to be fixed, putting this here as a reminder. */ }; public CompletionTest_MemberReference_Dot_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NamespaceRef_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NamespaceRef_NoPrefix.java index e9f35593c24..dbdf30f1b1b 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NamespaceRef_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NamespaceRef_NoPrefix.java @@ -33,6 +33,8 @@ public class CompletionTest_NamespaceRef_NoPrefix extends CompletionProposalsBa public CompletionTest_NamespaceRef_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NamespaceRef_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NamespaceRef_Prefix.java index 3aafdabb91f..96c5a9eb557 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NamespaceRef_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NamespaceRef_Prefix.java @@ -29,10 +29,13 @@ public class CompletionTest_NamespaceRef_Prefix extends CompletionProposalsBase private final String expectedPrefix = "a"; private final String[] expectedResults = { "aNamespace" + /* FIXME: extra results */ }; public CompletionTest_NamespaceRef_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_NoPrefix.java index f72fa7444cf..7bd10e8a0e7 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_NoPrefix.java @@ -28,10 +28,17 @@ public class CompletionTest_NewTypeReference_NoPrefix extends CompletionProposa private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = ""; private final String[] expectedResults = { + "aClass", + "anotherClass", + "AStruct", + "xOtherClass", + "XStruct" }; public CompletionTest_NewTypeReference_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java index 14222709b7c..47d8b94f260 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_NewTypeReference_Prefix.java @@ -30,6 +30,7 @@ public class CompletionTest_NewTypeReference_Prefix extends CompletionProposals private final String[] expectedResults = { "aClass", "anotherClass", + // missing proposal: "AStruct" /* FIXME: Additional results which should not be there. Run with trace enabled to reproduce: Result: aFirstEnum @@ -39,12 +40,14 @@ Result: anotherFunction(void) void Result: anotherMethod(void) void Result: aSecondEnum Result: aThirdEnum -Result: author - author name Result: aVariable : int */ }; public CompletionTest_NewTypeReference_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724 + // and https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(109724); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ScopedReference_NonCodeScope.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ScopedReference_NonCodeScope.java index c904db29573..1a4de1bd90b 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ScopedReference_NonCodeScope.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ScopedReference_NonCodeScope.java @@ -38,6 +38,8 @@ Result: y : int public CompletionTest_ScopedReference_NonCodeScope(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ScopedReference_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ScopedReference_Prefix.java index d94d386ee3a..60885f18d5b 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ScopedReference_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_ScopedReference_Prefix.java @@ -30,19 +30,6 @@ public class CompletionTest_ScopedReference_Prefix extends CompletionProposalsB "aNamespaceFunction(void) void" }; - - /* FIXME: Addtional result which should not be there. Run with tracing to reproduce: -Result: author - author name - */ - - /* (non-Javadoc) - * Relax result checking here because the "a" prefix finds the template for "author" - * @see org.eclipse.cdt.ui.tests.text.contentassist2.CompletionProposalsBaseTest#doCheckExtraResults() - */ - protected boolean doCheckExtraResults() { - return false ; - } - public CompletionTest_ScopedReference_Prefix(String name) { super(name); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_NoPrefix.java index 96de6ac5e4e..04bc4eb0001 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_NoPrefix.java @@ -34,6 +34,8 @@ public class CompletionTest_SingleName_Method_NoPrefix extends CompletionPropos public CompletionTest_SingleName_Method_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java index 052165249fe..1c3e28ed4b1 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Method_Prefix.java @@ -38,22 +38,15 @@ public class CompletionTest_SingleName_Method_Prefix extends CompletionProposa "aFirstEnum", "aSecondEnum", "aThirdEnum", + // missing proposals: "AStruct", "AMacro(x)" }; - - - /* (non-Javadoc) - * Relax result checking here because the "a" prefix also finds the template for "author" - * @see org.eclipse.cdt.ui.tests.text.contentassist2.CompletionProposalsBaseTest#doCheckExtraResults() - */ - protected boolean doCheckExtraResults() { - return false ; - } - public CompletionTest_SingleName_Method_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724 + setExpectFailure(109724); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_NoPrefix.java index 057fc019239..aa5f75b0b52 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_NoPrefix.java @@ -64,6 +64,8 @@ public class CompletionTest_SingleName_NoPrefix extends CompletionProposalsBase public CompletionTest_SingleName_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java index 5fee7f723e2..ff6cf189e25 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_SingleName_Prefix2.java @@ -35,14 +35,14 @@ public class CompletionTest_SingleName_Prefix2 extends CompletionProposalsBaseT "aFirstEnum", "aSecondEnum", "aThirdEnum", + // missing proposal: "AMacro(x)" - /* FIXME: Additional results which should not be there. Run with tracing to reproduce: - * Result: author - author name - */ }; public CompletionTest_SingleName_Prefix2(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724 + setExpectFailure(109724); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeDef_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeDef_NoPrefix.java index b8adccfaf43..680cc412ee9 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeDef_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeDef_NoPrefix.java @@ -34,15 +34,6 @@ public class CompletionTest_TypeDef_NoPrefix extends CompletionProposalsBaseTes }; - - /* (non-Javadoc) - * Relax checking here because the "m" prefix also finds the templates for "main" and "mutable" - * @see org.eclipse.cdt.ui.tests.text.contentassist2.CompletionProposalsBaseTest#doCheckExtraResults() - */ - protected boolean doCheckExtraResults() { - return false ; - } - public CompletionTest_TypeDef_NoPrefix(String name) { super(name); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeDef_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeDef_Prefix.java index b17627c6f5a..ec8c32eeb43 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeDef_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeDef_Prefix.java @@ -34,16 +34,6 @@ public class CompletionTest_TypeDef_Prefix extends CompletionProposalsBaseTest{ }; - - /* (non-Javadoc) - * Checking for prefix "m" finds also the template for "main" and "mutable". - * --> we relax extra results checking in this case. - * @see org.eclipse.cdt.ui.tests.text.contentassist2.CompletionProposalsBaseTest#doCheckExtraResults() - */ - protected boolean doCheckExtraResults() { - return false ; - } - public CompletionTest_TypeDef_Prefix(String name) { super(name); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeRef_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeRef_NoPrefix.java index 32b97cc9bea..23ad4987a56 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeRef_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeRef_NoPrefix.java @@ -53,6 +53,8 @@ Result: xVariable : int public CompletionTest_TypeRef_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeRef_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeRef_Prefix.java index c93df9cd3f9..ce4efe08862 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeRef_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_TypeRef_Prefix.java @@ -38,12 +38,13 @@ Result: anotherClass Result: anotherFunction(void) void Result: aSecondEnum Result: aThirdEnum -Result: author - author name Result: aVariable : int */ }; public CompletionTest_TypeRef_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_NestedPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_NestedPrefix.java index 8e4656fd1ac..6894d62c2c3 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_NestedPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_NestedPrefix.java @@ -38,6 +38,8 @@ Result: y : int */ public CompletionTest_VariableType_NestedPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(88787); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_NoPrefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_NoPrefix.java index e0fd3e377a8..31b03f6d041 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_NoPrefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_NoPrefix.java @@ -25,10 +25,21 @@ public class CompletionTest_VariableType_NoPrefix extends CompletionProposalsBa private final String headerFileFullPath ="resources/contentassist/" + headerFileName; private final String expectedPrefix = ""; private final String[] expectedResults = { + "aClass", + "anotherClass", + "aNamespace", + "anEnumeration", + "AStruct", + "xOtherClass", + "xNamespace", + "xEnumeration", + "XStruct", }; public CompletionTest_VariableType_NoPrefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=151207 + setExpectFailure(151207); } public static Test suite() { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_Prefix.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_Prefix.java index 01584d54563..f35604476fb 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_Prefix.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTest_VariableType_Prefix.java @@ -29,18 +29,30 @@ public class CompletionTest_VariableType_Prefix extends CompletionProposalsBase "anotherClass", "aNamespace", "anEnumeration", + // missing proposal: "AStruct" + /* Superfluous proposals: + "aFirstEnum", + "aFunction(void) bool", + "aSecondEnum", + "aThirdEnum", + "aVariable : int", + "anotherFunction(void) void" + */ }; public CompletionTest_VariableType_Prefix(String name) { super(name); + // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109724 + // and https://bugs.eclipse.org/bugs/show_bug.cgi?id=88787 + setExpectFailure(109724); } public static Test suite() { TestSuite suite= new TestSuite(CompletionTest_VariableType_Prefix.class.getName()); suite.addTest(new CompletionTest_VariableType_Prefix("testCompletionProposals")); return suite; - } + } /* (non-Javadoc) * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition() */ diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/ContentAssist2TestSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/ContentAssist2TestSuite.java index 53aa8773509..53c8689706a 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/ContentAssist2TestSuite.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/ContentAssist2TestSuite.java @@ -25,7 +25,7 @@ public class ContentAssist2TestSuite extends TestSuite { public ContentAssist2TestSuite() { super("Tests in package org.eclipse.cdt.ui.tests.text.contentassist2"); - addTest(CompletionFailedTest_MemberReference_Arrow_Prefix2.suite()); + addTest(CompletionTest_MemberReference_Arrow_Prefix2.suite()); addTest(CompletionTest_ArgumentType_NoPrefix.suite()); addTest(CompletionTest_ArgumentType_NoPrefix2.suite()); addTest(CompletionTest_ArgumentType_Prefix.suite());