1
/*******************************************************************************
2
* Copyright (c) 2004, 2007 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Rational Software - Initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.cdt.ui.tests.text.contentassist2;
12
import junit.framework.Test;
13
import junit.framework.TestSuite;
18
* Testing statement start, with no prefix
22
public class CompletionTest_SingleName_Method_NoPrefix extends CompletionProposalsBaseTest{
23
private final String fileName = "CompletionTestStart5.cpp";
24
private final String fileFullPath ="resources/contentassist/" + fileName;
25
private final String headerFileName = "CompletionTestStart.h";
26
private final String headerFileFullPath ="resources/contentassist/" + headerFileName;
27
private final String expectedPrefix = "";
29
private final String[] expectedResults = {
34
"aFunction(void) bool",
42
"anotherFunction(void) void",
43
"anotherMethod(void) void",
46
"xFunction(void) bool",
49
"xOtherFunction(void) void",
53
"~anotherClass(void) "
55
// "operator =(const anotherClass &) anotherClass &",
58
public CompletionTest_SingleName_Method_NoPrefix(String name) {
60
// operators should not be proposed
61
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=172304
62
setExpectFailure(172304);
65
public static Test suite() {
66
TestSuite suite= new TestSuite(CompletionTest_SingleName_Method_NoPrefix.class.getName());
67
suite.addTest(new CompletionTest_SingleName_Method_NoPrefix("testCompletionProposals"));
71
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
73
protected int getCompletionPosition() {
74
return getBuffer().indexOf(" ") + 2;
78
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
80
protected String getExpectedPrefix() {
81
return expectedPrefix;
85
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
87
protected String[] getExpectedResultsValues() {
88
return expectedResults;
92
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
94
protected String getFileName() {
99
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
101
protected String getFileFullPath() {
105
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
107
protected String getHeaderFileFullPath() {
108
return headerFileFullPath;
112
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
114
protected String getHeaderFileName() {
115
return headerFileName;