Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoda Amer2004-01-26 21:17:39 +0000
committerHoda Amer2004-01-26 21:17:39 +0000
commitd4ca6eb809424920f0b034cf70d54e4b4d684c7e (patch)
tree6d71a38bbbf74a536cd85339f568521ae82f749f /core/org.eclipse.cdt.ui.tests
parent0f7f7e0b139767106772d2abec831a6df3fdc228 (diff)
downloadorg.eclipse.cdt-d4ca6eb809424920f0b034cf70d54e4b4d684c7e.tar.gz
org.eclipse.cdt-d4ca6eb809424920f0b034cf70d54e4b4d684c7e.tar.xz
org.eclipse.cdt-d4ca6eb809424920f0b034cf70d54e4b4d684c7e.zip
Content Assist Work: More JUnit tests
Diffstat (limited to 'core/org.eclipse.cdt.ui.tests')
-rw-r--r--core/org.eclipse.cdt.ui.tests/ChangeLog3
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart16.cpp3
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart17.cpp3
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart18.cpp6
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart19.cpp5
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart10.cpp7
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart7.h4
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart8.h3
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart9.cpp8
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java10
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ClassReference_NoPrefix_Bug50621.java122
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ClassReference_Prefix_Bug50621.java121
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640.java126
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ExceptionReference_Prefix_Bug50640.java125
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix2_Bug50642.java116
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix_Bug50642.java117
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix2_Bug50642.java121
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix_Bug50642.java121
18 files changed, 1020 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ChangeLog b/core/org.eclipse.cdt.ui.tests/ChangeLog
index 5d47b247e2..a844862c97 100644
--- a/core/org.eclipse.cdt.ui.tests/ChangeLog
+++ b/core/org.eclipse.cdt.ui.tests/ChangeLog
@@ -1,3 +1,6 @@
+2004-01-26 Hoda Amer
+ More Completion JUnit tests.
+
2004-01-23 Hoda Amer
More Completion JUnit tests.
diff --git a/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart16.cpp b/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart16.cpp
new file mode 100644
index 0000000000..8e4eed27f1
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart16.cpp
@@ -0,0 +1,3 @@
+#include "CompletionTestStart.h"
+
+void foo ( a
diff --git a/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart17.cpp b/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart17.cpp
new file mode 100644
index 0000000000..fb9f4cda18
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart17.cpp
@@ -0,0 +1,3 @@
+#include "CompletionTestStart.h"
+
+void foo (
diff --git a/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart18.cpp b/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart18.cpp
new file mode 100644
index 0000000000..aa593d2137
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart18.cpp
@@ -0,0 +1,6 @@
+#include "CompletionTestStart.h"
+
+class ClassA {
+ void foo ( a
+};
+
diff --git a/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart19.cpp b/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart19.cpp
new file mode 100644
index 0000000000..6ec3631b5d
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/contentassist/CompletionTestStart19.cpp
@@ -0,0 +1,5 @@
+#include "CompletionTestStart.h"
+
+class ClassA {
+ void foo (
+};
diff --git a/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart10.cpp b/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart10.cpp
new file mode 100644
index 0000000000..5e2cbae78a
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart10.cpp
@@ -0,0 +1,7 @@
+#include "CompletionTestStart.h"
+
+void anotherClass::anotherMethod()
+{
+ try {
+ } catch (
+}
diff --git a/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart7.h b/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart7.h
new file mode 100644
index 0000000000..c0dd03edf3
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart7.h
@@ -0,0 +1,4 @@
+#include "CompletionTestStart.h"
+
+class ClassA : public a
+
diff --git a/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart8.h b/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart8.h
new file mode 100644
index 0000000000..142826ffde
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart8.h
@@ -0,0 +1,3 @@
+#include "CompletionTestStart.h"
+
+class ClassA : public
diff --git a/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart9.cpp b/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart9.cpp
new file mode 100644
index 0000000000..721d0efbe9
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/resources/contentassist/failedtests/CompletionFailedTestStart9.cpp
@@ -0,0 +1,8 @@
+#include "CompletionTestStart.h"
+
+void anotherClass::anotherMethod()
+{
+ try {
+ } catch ( a
+
+}
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 7513c78599..41cf4242d7 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
@@ -42,6 +42,10 @@ public class AutomatedSuite extends TestSuite {
addTest(CompletionTest_FieldType_NoPrefix2.suite());
addTest(CompletionTest_VariableType_Prefix.suite());
addTest(CompletionTest_VariableType_NoPrefix.suite());
+ addTest(CompletionTest_ArgumentType_NoPrefix_Bug50642.suite());
+ addTest(CompletionTest_ArgumentType_NoPrefix2_Bug50642.suite());
+ addTest(CompletionTest_ArgumentType_Prefix_Bug50642.suite());
+ addTest(CompletionTest_ArgumentType_NoPrefix2_Bug50642.suite());
addTest(CompletionTest_StatementStart_Prefix.suite());
addTest(CompletionTest_StatementStart_NoPrefix.suite());
addTest(CompletionTest_SingleName_Prefix.suite());
@@ -59,7 +63,11 @@ public class AutomatedSuite extends TestSuite {
addTest(CompletionFailedTest_NamespaceRef_NoPrefix_Bug50471.suite());
addTest(CompletionFailedTest_NamespaceRef_Prefix_Bug50471.suite());
addTest(CompletionFailedTest_MacroRef_NoPrefix_Bug50487.suite());
- addTest(CompletionFailedTest_MacroRef_Prefix_Bug50487.suite());
+ addTest(CompletionFailedTest_MacroRef_Prefix_Bug50487.suite());
+ addTest(CompletionFailedTest_ClassReference_NoPrefix_Bug50621.suite());
+ addTest(CompletionFailedTest_ClassReference_Prefix_Bug50621.suite());
+ addTest(CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640.suite());
+ addTest(CompletionFailedTest_ExceptionReference_Prefix_Bug50640.suite());
}
}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ClassReference_NoPrefix_Bug50621.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ClassReference_NoPrefix_Bug50621.java
new file mode 100644
index 0000000000..9b0ea08e9c
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ClassReference_NoPrefix_Bug50621.java
@@ -0,0 +1,122 @@
+/**********************************************************************
+ * Copyright (c) 2004 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.ui.tests.text.contentassist.failedtests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
+import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
+
+/**
+ * @author hamer
+ *
+ * Testing Class_Reference, with No prefix
+ * Bug#50621 :Wrong completion kind in a class declaration
+ *
+ */
+public class CompletionFailedTest_ClassReference_NoPrefix_Bug50621 extends CompletionProposalsBaseTest{
+
+ private final String fileName = "CompletionFailedTestStart8.h";
+ private final String fileFullPath ="resources/contentassist/failedtests/" + 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.USER_SPECIFIED_NAME; // sould be CompletionKind.CLASS_REFERENCE;
+ private final String expectedPrefix = "";
+ private final String[] expectedResults = {
+// Should be
+// "aClass",
+// "anotherClass",
+// "xOtherClass"
+ };
+
+ public CompletionFailedTest_ClassReference_NoPrefix_Bug50621(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite(CompletionFailedTest_ClassReference_NoPrefix_Bug50621.class.getName());
+ suite.addTest(new CompletionFailedTest_ClassReference_NoPrefix_Bug50621("testCompletionProposals"));
+ return suite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
+ */
+ protected int getCompletionPosition() {
+ return getBuffer().indexOf(" ") + 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()
+ */
+ protected String getExpectedPrefix() {
+ return expectedPrefix;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
+ */
+ protected String[] getExpectedResultsValues() {
+ return expectedResults;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
+ */
+ protected String getFileName() {
+ return fileName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
+ */
+ protected String getFileFullPath() {
+ return fileFullPath;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
+ */
+ protected String getHeaderFileFullPath() {
+ return headerFileFullPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
+ */
+ protected String getHeaderFileName() {
+ return headerFileName;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ClassReference_Prefix_Bug50621.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ClassReference_Prefix_Bug50621.java
new file mode 100644
index 0000000000..c8f10518f1
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ClassReference_Prefix_Bug50621.java
@@ -0,0 +1,121 @@
+/**********************************************************************
+ * Copyright (c) 2004 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.ui.tests.text.contentassist.failedtests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
+import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
+
+/**
+ * @author hamer
+ *
+ * Testing Class_Reference, with prefix
+ * Bug#50621 :Wrong completion kind in a class declaration
+ *
+ */
+public class CompletionFailedTest_ClassReference_Prefix_Bug50621 extends CompletionProposalsBaseTest{
+
+ private final String fileName = "CompletionFailedTestStart7.h";
+ private final String fileFullPath ="resources/contentassist/failedtests/" + 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.USER_SPECIFIED_NAME; // sould be CompletionKind.CLASS_REFERENCE;
+ private final String expectedPrefix = "a";
+ private final String[] expectedResults = {
+// Should be
+// "aClass",
+// "anotherClass"
+ };
+
+ public CompletionFailedTest_ClassReference_Prefix_Bug50621(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite(CompletionFailedTest_ClassReference_Prefix_Bug50621.class.getName());
+ suite.addTest(new CompletionFailedTest_ClassReference_Prefix_Bug50621("testCompletionProposals"));
+ return suite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
+ */
+ protected int getCompletionPosition() {
+ 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()
+ */
+ protected String getExpectedPrefix() {
+ return expectedPrefix;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
+ */
+ protected String[] getExpectedResultsValues() {
+ return expectedResults;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
+ */
+ protected String getFileName() {
+ return fileName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
+ */
+ protected String getFileFullPath() {
+ return fileFullPath;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
+ */
+ protected String getHeaderFileFullPath() {
+ return headerFileFullPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
+ */
+ protected String getHeaderFileName() {
+ return headerFileName;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640.java
new file mode 100644
index 0000000000..27adb3c034
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640.java
@@ -0,0 +1,126 @@
+/**********************************************************************
+ * Copyright (c) 2004 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.ui.tests.text.contentassist.failedtests;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
+import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
+
+/**
+ * @author hamer
+ *
+ * Testing Exception_Reference, with No prefix
+ * Bug#50640 : Wrong completion kind when expecting an exception
+ *
+ */
+public class CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640 extends CompletionProposalsBaseTest{
+
+ private final String fileName = "CompletionFailedTestStart10.cpp";
+ private final String fileFullPath ="resources/contentassist/failedtests/" + fileName;
+ private final String headerFileName = "CompletionTestStart.h";
+ private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
+ private final String expectedScopeName = "ASTCodeScope"; // should be "ASTMethod";
+ private final String expectedContextName = "null";
+ private final CompletionKind expectedKind = CompletionKind.STATEMENT_START; // should be CompletionKind.EXCEPTION_REFERENCE ;
+ private final String expectedPrefix = "";
+ private final String[] expectedResults = {
+// Should be
+// "aClass",
+// "anotherClass",
+// "aNamespace",
+// "anEnumeration",
+// "AStruct",
+// "..."
+ };
+
+ public CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite(CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640.class.getName());
+ suite.addTest(new CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640("testCompletionProposals"));
+ return suite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
+ */
+ protected int getCompletionPosition() {
+ return getBuffer().indexOf(" ") + 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()
+ */
+ protected String getExpectedPrefix() {
+ return expectedPrefix;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
+ */
+ protected String[] getExpectedResultsValues() {
+ return expectedResults;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
+ */
+ protected String getFileName() {
+ return fileName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
+ */
+ protected String getFileFullPath() {
+ return fileFullPath;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
+ */
+ protected String getHeaderFileFullPath() {
+ return headerFileFullPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
+ */
+ protected String getHeaderFileName() {
+ return headerFileName;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ExceptionReference_Prefix_Bug50640.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ExceptionReference_Prefix_Bug50640.java
new file mode 100644
index 0000000000..08e0b0795b
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionFailedTest_ExceptionReference_Prefix_Bug50640.java
@@ -0,0 +1,125 @@
+/**********************************************************************
+ * Copyright (c) 2004 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.ui.tests.text.contentassist.failedtests;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
+import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
+
+/**
+ * @author hamer
+ *
+ * Testing Exception_Reference, with prefix
+ * Bug#50640 : Wrong completion kind when expecting an exception
+ *
+ */
+public class CompletionFailedTest_ExceptionReference_Prefix_Bug50640 extends CompletionProposalsBaseTest{
+
+ private final String fileName = "CompletionFailedTestStart9.cpp";
+ private final String fileFullPath ="resources/contentassist/failedtests/" + 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; // should be CompletionKind.EXCEPTION_REFERENCE ;
+ private final String expectedPrefix = "a";
+ private final String[] expectedResults = {
+// Should be
+// "aClass",
+// "anotherClass",
+// "aNamespace",
+// "anEnumeration",
+// "AStruct"
+ };
+
+ public CompletionFailedTest_ExceptionReference_Prefix_Bug50640(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite(CompletionFailedTest_ExceptionReference_Prefix_Bug50640.class.getName());
+ suite.addTest(new CompletionFailedTest_ExceptionReference_Prefix_Bug50640("testCompletionProposals"));
+ return suite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
+ */
+ protected int getCompletionPosition() {
+ 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()
+ */
+ protected String getExpectedPrefix() {
+ return expectedPrefix;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
+ */
+ protected String[] getExpectedResultsValues() {
+ return expectedResults;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
+ */
+ protected String getFileName() {
+ return fileName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
+ */
+ protected String getFileFullPath() {
+ return fileFullPath;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
+ */
+ protected String getHeaderFileFullPath() {
+ return headerFileFullPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
+ */
+ protected String getHeaderFileName() {
+ return headerFileName;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix2_Bug50642.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix2_Bug50642.java
new file mode 100644
index 0000000000..b056c9f72e
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix2_Bug50642.java
@@ -0,0 +1,116 @@
+/**********************************************************************
+ * Copyright (c) 2004 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.ui.tests.text.contentassist.failedtests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
+import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
+
+/**
+ * @author hamer
+ *
+ * Testing Argument_Type completion kind , with No prefix
+ * Bug#50642 : Wrong completion kind when declaring an argument type
+ *
+ */
+public class CompletionTest_ArgumentType_NoPrefix2_Bug50642 extends CompletionProposalsBaseTest{
+ private final String fileName = "CompletionTestStart19.cpp";
+ 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.FIELD_TYPE; // should be CompletionKind.ARGUMENT_TYPE;
+ private final String expectedPrefix = "";
+ private final String[] expectedResults = {
+ };
+
+ public CompletionTest_ArgumentType_NoPrefix2_Bug50642(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix2_Bug50642.class.getName());
+ suite.addTest(new CompletionTest_ArgumentType_NoPrefix2_Bug50642("testCompletionProposals"));
+ return suite;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
+ */
+ protected int getCompletionPosition() {
+ return getBuffer().indexOf(" ") + 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()
+ */
+ protected String getExpectedPrefix() {
+ return expectedPrefix;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
+ */
+ protected String[] getExpectedResultsValues() {
+ return expectedResults;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
+ */
+ protected String getFileName() {
+ return fileName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
+ */
+ protected String getFileFullPath() {
+ return fileFullPath;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
+ */
+ protected String getHeaderFileFullPath() {
+ return headerFileFullPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
+ */
+ protected String getHeaderFileName() {
+ return headerFileName;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix_Bug50642.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix_Bug50642.java
new file mode 100644
index 0000000000..1eda49714e
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_NoPrefix_Bug50642.java
@@ -0,0 +1,117 @@
+/**********************************************************************
+ * Copyright (c) 2004 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.ui.tests.text.contentassist.failedtests;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
+import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
+
+/**
+ * @author hamer
+ *
+ * Testing Argument_Type completion kind , with No prefix
+ * Bug#50642 : Wrong completion kind when declaring an argument type
+ *
+ */
+public class CompletionTest_ArgumentType_NoPrefix_Bug50642 extends CompletionProposalsBaseTest{
+ private final String fileName = "CompletionTestStart17.cpp";
+ 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; // should be CompletionKind.ARGUMENT_TYPE;
+ private final String expectedPrefix = "";
+ private final String[] expectedResults = {
+ };
+
+ public CompletionTest_ArgumentType_NoPrefix_Bug50642(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite(CompletionTest_ArgumentType_NoPrefix_Bug50642.class.getName());
+ suite.addTest(new CompletionTest_ArgumentType_NoPrefix_Bug50642("testCompletionProposals"));
+ return suite;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
+ */
+ protected int getCompletionPosition() {
+ return getBuffer().indexOf(" ") + 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()
+ */
+ protected String getExpectedPrefix() {
+ return expectedPrefix;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
+ */
+ protected String[] getExpectedResultsValues() {
+ return expectedResults;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
+ */
+ protected String getFileName() {
+ return fileName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
+ */
+ protected String getFileFullPath() {
+ return fileFullPath;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
+ */
+ protected String getHeaderFileFullPath() {
+ return headerFileFullPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
+ */
+ protected String getHeaderFileName() {
+ return headerFileName;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix2_Bug50642.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix2_Bug50642.java
new file mode 100644
index 0000000000..bd3db81952
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix2_Bug50642.java
@@ -0,0 +1,121 @@
+/**********************************************************************
+ * Copyright (c) 2004 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.ui.tests.text.contentassist.failedtests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
+import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
+
+/**
+ * @author hamer
+ *
+ * Testing Argument_Type completion kind , with a prefix
+ * Bug#50642 : Wrong completion kind when declaring an argument type
+ *
+ */
+public class CompletionTest_ArgumentType_Prefix2_Bug50642 extends CompletionProposalsBaseTest{
+ private final String fileName = "CompletionTestStart18.cpp";
+ 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.FIELD_TYPE; // should be CompletionKind.ARGUMENT_TYPE;
+ private final String expectedPrefix = "a";
+ private final String[] expectedResults = {
+ "aClass",
+ "anotherClass",
+ "aNamespace",
+ "anEnumeration",
+ "AStruct"
+ };
+
+ public CompletionTest_ArgumentType_Prefix2_Bug50642(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix2_Bug50642.class.getName());
+ suite.addTest(new CompletionTest_ArgumentType_Prefix2_Bug50642("testCompletionProposals"));
+ return suite;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
+ */
+ protected int getCompletionPosition() {
+ 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()
+ */
+ protected String getExpectedPrefix() {
+ return expectedPrefix;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
+ */
+ protected String[] getExpectedResultsValues() {
+ return expectedResults;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
+ */
+ protected String getFileName() {
+ return fileName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
+ */
+ protected String getFileFullPath() {
+ return fileFullPath;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
+ */
+ protected String getHeaderFileFullPath() {
+ return headerFileFullPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
+ */
+ protected String getHeaderFileName() {
+ return headerFileName;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix_Bug50642.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix_Bug50642.java
new file mode 100644
index 0000000000..995be0aa25
--- /dev/null
+++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/failedtests/CompletionTest_ArgumentType_Prefix_Bug50642.java
@@ -0,0 +1,121 @@
+/**********************************************************************
+ * Copyright (c) 2004 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.ui.tests.text.contentassist.failedtests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
+import org.eclipse.cdt.ui.tests.text.contentassist.CompletionProposalsBaseTest;
+
+/**
+ * @author hamer
+ *
+ * Testing Argument_Type completion kind , with a prefix
+ * Bug#50642 : Wrong completion kind when declaring an argument type
+ *
+ */
+public class CompletionTest_ArgumentType_Prefix_Bug50642 extends CompletionProposalsBaseTest{
+ private final String fileName = "CompletionTestStart16.cpp";
+ 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; // should be CompletionKind.ARGUMENT_TYPE;
+ private final String expectedPrefix = "a";
+ private final String[] expectedResults = {
+ "aClass",
+ "anotherClass",
+ "aNamespace",
+ "anEnumeration",
+ "AStruct"
+ };
+
+ public CompletionTest_ArgumentType_Prefix_Bug50642(String name) {
+ super(name);
+ }
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite(CompletionTest_ArgumentType_Prefix_Bug50642.class.getName());
+ suite.addTest(new CompletionTest_ArgumentType_Prefix_Bug50642("testCompletionProposals"));
+ return suite;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
+ */
+ protected int getCompletionPosition() {
+ 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()
+ */
+ protected String getExpectedPrefix() {
+ return expectedPrefix;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
+ */
+ protected String[] getExpectedResultsValues() {
+ return expectedResults;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
+ */
+ protected String getFileName() {
+ return fileName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
+ */
+ protected String getFileFullPath() {
+ return fileFullPath;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
+ */
+ protected String getHeaderFileFullPath() {
+ return headerFileFullPath;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
+ */
+ protected String getHeaderFileName() {
+ return headerFileName;
+ }
+
+}

Back to the top