mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
Cosmetics.
This commit is contained in:
parent
a28d05b77c
commit
f70ab948fc
1 changed files with 142 additions and 251 deletions
|
@ -14,7 +14,9 @@
|
||||||
* Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
|
* Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
|
||||||
* Nathan Ridge
|
* Nathan Ridge
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.tests.text.contentassist2;import java.io.File;
|
package org.eclipse.cdt.ui.tests.text.contentassist2;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -27,7 +29,6 @@ import org.eclipse.jface.text.IDocument;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.testplugin.TestScannerProvider;
|
import org.eclipse.cdt.core.testplugin.TestScannerProvider;
|
||||||
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A collection of code completion tests.
|
* A collection of code completion tests.
|
||||||
|
@ -44,7 +45,6 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
private boolean fCheckExtraResults= true;
|
private boolean fCheckExtraResults= true;
|
||||||
private IProject fProject;
|
private IProject fProject;
|
||||||
|
|
||||||
|
|
||||||
// {DisturbWith.cpp}
|
// {DisturbWith.cpp}
|
||||||
// int gTemp;
|
// int gTemp;
|
||||||
// void gFunc();
|
// void gFunc();
|
||||||
|
@ -92,7 +92,6 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// };
|
// };
|
||||||
// typedef C1 T1;
|
// typedef C1 T1;
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// class C2 : public T1 {
|
// class C2 : public T1 {
|
||||||
// public:
|
// public:
|
||||||
// C2* fMySelf;
|
// C2* fMySelf;
|
||||||
|
@ -112,7 +111,6 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// };
|
// };
|
||||||
// typedef C2 T2;
|
// typedef C2 T2;
|
||||||
//
|
//
|
||||||
//
|
|
||||||
// class C3 : public C2 {
|
// class C3 : public C2 {
|
||||||
// public:
|
// public:
|
||||||
// C3* fMySelf;
|
// C3* fMySelf;
|
||||||
|
@ -330,17 +328,13 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
|
|
||||||
//void f() {C2* cLocal1; cLocal1->f/*cursor*/
|
//void f() {C2* cLocal1; cLocal1->f/*cursor*/
|
||||||
public void testDataMembers_GlobalScope() throws Exception {
|
public void testDataMembers_GlobalScope() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "fMySelf" };
|
||||||
"fMySelf"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void C2::f() {while(true) {f/*cursor*/
|
//void C2::f() {while(true) {f/*cursor*/
|
||||||
public void testDataMembers_MethodScope() throws Exception {
|
public void testDataMembers_MethodScope() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "fMySelf" };
|
||||||
"fMySelf"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,9 +373,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
|
|
||||||
//void f() {C/*cursor*/
|
//void f() {C/*cursor*/
|
||||||
public void testTypes_GlobalScope() throws Exception {
|
public void testTypes_GlobalScope() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "C1", "C2", "C3" };
|
||||||
"C1", "C2", "C3"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,284 +405,222 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
|
|
||||||
//void _friend_function(C2* x) { x->m/*cursor*/ // Not a friend due to parameter type mismatch
|
//void _friend_function(C2* x) { x->m/*cursor*/ // Not a friend due to parameter type mismatch
|
||||||
public void testTypes_FakeFriendFunction() throws Exception {
|
public void testTypes_FakeFriendFunction() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "m123(void)", "m12(void)", "m13(void)", "m23(void)" };
|
||||||
"m123(void)", "m12(void)", "m13(void)", "m23(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void C2::f() {T/*cursor*/
|
//void C2::f() {T/*cursor*/
|
||||||
public void testTypes_MethodScope() throws Exception {
|
public void testTypes_MethodScope() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "T1", "T2", "T3", "TClass" };
|
||||||
"T1", "T2", "T3", "TClass"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//namespace ns {void nsfunc(){C/*cursor*/
|
//namespace ns {void nsfunc(){C/*cursor*/
|
||||||
public void testTypes_NamespaceScope() throws Exception {
|
public void testTypes_NamespaceScope() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "C1", "C2", "C3", "CNS" };
|
||||||
"C1", "C2", "C3", "CNS"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//namespace ns {void gfunc(){::C/*cursor*/
|
//namespace ns {void gfunc(){::C/*cursor*/
|
||||||
public void testTypes_GlobalQualification() throws Exception {
|
public void testTypes_GlobalQualification() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "C1", "C2", "C3" };
|
||||||
"C1", "C2", "C3"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {e/*cursor*/
|
//void f() {e/*cursor*/
|
||||||
public void testEnums_GlobalScope() throws Exception {
|
public void testEnums_GlobalScope() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "e11", "e12", "E1" };
|
||||||
"e11", "e12", "E1"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void C3::f() {e/*cursor*/
|
//void C3::f() {e/*cursor*/
|
||||||
public void testEnums_MethodScope() throws Exception {
|
public void testEnums_MethodScope() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "e11", "e12", "e21", "e22", "E1", "E2" };
|
||||||
"e11", "e12", "e21", "e22", "E1", "E2"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C3* l1; l1->C/*cursor*/
|
//void f() {C3* l1; l1->C/*cursor*/
|
||||||
public void testQualificationForAccess1() throws Exception {
|
public void testQualificationForAccess1() throws Exception {
|
||||||
// TLETODO ordering is significant here (currently ignored)
|
// TLETODO ordering is significant here (currently ignored)
|
||||||
final String[] expected= {
|
final String[] expected= { "C3", "C2", "C1" };
|
||||||
"C3", "C2", "C1"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C2* l1; l1->C/*cursor*/
|
//void f() {C2* l1; l1->C/*cursor*/
|
||||||
public void testQualificationForAccess2() throws Exception {
|
public void testQualificationForAccess2() throws Exception {
|
||||||
// TLETODO ordering is significant here (currently ignored)
|
// TLETODO ordering is significant here (currently ignored)
|
||||||
final String[] expected= {
|
final String[] expected= { "C2", "C1" };
|
||||||
"C2", "C1"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C3* l1; l1->C3::fMySelf->iam/*cursor*/
|
//void f() {C3* l1; l1->C3::fMySelf->iam/*cursor*/
|
||||||
public void testQualifiedAccess1() throws Exception {
|
public void testQualifiedAccess1() throws Exception {
|
||||||
// TLETODO ordering is significant here (currently ignored)
|
// TLETODO ordering is significant here (currently ignored)
|
||||||
final String[] expected= {
|
final String[] expected= { "iam3(void)", "iam2(void)", "iam1(void)" };
|
||||||
"iam3(void)", "iam2(void)", "iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C3* l1; l1->C2::fMySelf->iam/*cursor*/
|
//void f() {C3* l1; l1->C2::fMySelf->iam/*cursor*/
|
||||||
public void testQualifiedAccess2() throws Exception {
|
public void testQualifiedAccess2() throws Exception {
|
||||||
// TLETODO ordering is significant here (currently ignored)
|
// TLETODO ordering is significant here (currently ignored)
|
||||||
final String[] expected= {
|
final String[] expected= { "iam2(void)", "iam1(void)" };
|
||||||
"iam2(void)", "iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C3* l1; l1->C1::fMySelf->iam/*cursor*/
|
//void f() {C3* l1; l1->C1::fMySelf->iam/*cursor*/
|
||||||
public void testQualifiedAccess3() throws Exception {
|
public void testQualifiedAccess3() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C3* l1; l1->T3::fMySelf->iam/*cursor*/
|
//void f() {C3* l1; l1->T3::fMySelf->iam/*cursor*/
|
||||||
public void testQualifiedAccess_TypedefAsQualifier1() throws Exception {
|
public void testQualifiedAccess_TypedefAsQualifier1() throws Exception {
|
||||||
// TLETODO ordering is significant here (currently ignored)
|
// TLETODO ordering is significant here (currently ignored)
|
||||||
final String[] expected= {
|
final String[] expected= { "iam3(void)", "iam2(void)", "iam1(void)" };
|
||||||
"iam3(void)", "iam2(void)", "iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C3* l1; l1->T2::fMySelf->iam/*cursor*/
|
//void f() {C3* l1; l1->T2::fMySelf->iam/*cursor*/
|
||||||
public void testQualifiedAccess_TypedefAsQualifier2() throws Exception {
|
public void testQualifiedAccess_TypedefAsQualifier2() throws Exception {
|
||||||
// TLETODO ordering is significant here (currently ignored)
|
// TLETODO ordering is significant here (currently ignored)
|
||||||
final String[] expected= {
|
final String[] expected= { "iam2(void)", "iam1(void)" };
|
||||||
"iam2(void)", "iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C3* l1; l1->T1::fMySelf->iam/*cursor*/
|
//void f() {C3* l1; l1->T1::fMySelf->iam/*cursor*/
|
||||||
public void testQualifiedAccess_TypedefAsQualifier3() throws Exception {
|
public void testQualifiedAccess_TypedefAsQualifier3() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1().iam/*cursor*/
|
//void f() {C1().iam/*cursor*/
|
||||||
public void testTemporaryObject() throws Exception {
|
public void testTemporaryObject() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1 c; (&c)->iam/*cursor*/
|
//void f() {C1 c; (&c)->iam/*cursor*/
|
||||||
public void testAddressOf() throws Exception {
|
public void testAddressOf() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1* c; (*c).iam/*cursor*/
|
//void f() {C1* c; (*c).iam/*cursor*/
|
||||||
public void testDereferencingOperator1() throws Exception {
|
public void testDereferencingOperator1() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1** c; (**c).iam/*cursor*/
|
//void f() {C1** c; (**c).iam/*cursor*/
|
||||||
public void testDereferencingOperator2() throws Exception {
|
public void testDereferencingOperator2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1** c; (*c)->iam/*cursor*/
|
//void f() {C1** c; (*c)->iam/*cursor*/
|
||||||
public void testDereferencingOperator3() throws Exception {
|
public void testDereferencingOperator3() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1* c; c[0].iam/*cursor*/
|
//void f() {C1* c; c[0].iam/*cursor*/
|
||||||
public void testArrayAccessOperator1() throws Exception {
|
public void testArrayAccessOperator1() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1** c; c[0][1].iam/*cursor*/
|
//void f() {C1** c; c[0][1].iam/*cursor*/
|
||||||
public void testArrayAccessOperator2() throws Exception {
|
public void testArrayAccessOperator2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1** c; c[0]->iam/*cursor*/
|
//void f() {C1** c; c[0]->iam/*cursor*/
|
||||||
public void testArrayAccessOperator3() throws Exception {
|
public void testArrayAccessOperator3() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1* c; (&c[0])->iam/*cursor*/
|
//void f() {C1* c; (&c[0])->iam/*cursor*/
|
||||||
public void testArrayAccessOperator4() throws Exception {
|
public void testArrayAccessOperator4() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {void* c; ((C1*)c)->iam/*cursor*/
|
//void f() {void* c; ((C1*)c)->iam/*cursor*/
|
||||||
public void testCasts1() throws Exception {
|
public void testCasts1() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
//void g(int a) {}; void f() {void* c; g(((C1*)c)->iam/*cursor*/
|
//void g(int a) {}; void f() {void* c; g(((C1*)c)->iam/*cursor*/
|
||||||
public void testCasts2() throws Exception {
|
public void testCasts2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1* c; c++->iam/*cursor*/
|
//void f() {C1* c; c++->iam/*cursor*/
|
||||||
public void testPointerArithmetic1() throws Exception {
|
public void testPointerArithmetic1() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1* c; (*++c).iam/*cursor*/
|
//void f() {C1* c; (*++c).iam/*cursor*/
|
||||||
public void testPointerArithmetic2() throws Exception {
|
public void testPointerArithmetic2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1* c; c--->iam/*cursor*/
|
//void f() {C1* c; c--->iam/*cursor*/
|
||||||
public void testPointerArithmetic3() throws Exception {
|
public void testPointerArithmetic3() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1 c; (&c+1)->iam/*cursor*/
|
//void f() {C1 c; (&c+1)->iam/*cursor*/
|
||||||
public void testPointerArithmetic4() throws Exception {
|
public void testPointerArithmetic4() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {C1 c; (&c-1)->iam/*cursor*/
|
//void f() {C1 c; (&c-1)->iam/*cursor*/
|
||||||
public void testPointerArithmetic5() throws Exception {
|
public void testPointerArithmetic5() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "iam1(void)" };
|
||||||
"iam1(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void f() {int localVar=0; if (*cond && somefunc(&local/*cursor*/
|
//void f() {int localVar=0; if (*cond && somefunc(&local/*cursor*/
|
||||||
public void testNestedCalls() throws Exception {
|
public void testNestedCalls() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "localVar" };
|
||||||
"localVar"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//int a[] = {1,2}; void f(int _0306_b) {_0306_b/*cursor*/
|
//int a[] = {1,2}; void f(int _0306_b) {_0306_b/*cursor*/
|
||||||
public void testCuttingInput1() throws Exception {
|
public void testCuttingInput1() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "_0306_b" };
|
||||||
"_0306_b"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//int a[] = {1,2}; void f(int b) {int _0306_b[] = {2,3}; _0306_b/*cursor*/
|
//int a[] = {1,2}; void f(int b) {int _0306_b[] = {2,3}; _0306_b/*cursor*/
|
||||||
public void testCuttingInput2() throws Exception {
|
public void testCuttingInput2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "_0306_b" };
|
||||||
"_0306_b"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//enum EnumType function() {int _031209_v; _031209/*cursor*/
|
//enum EnumType function() {int _031209_v; _031209/*cursor*/
|
||||||
public void testDisturbingMacros() throws Exception {
|
public void testDisturbingMacros() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "_031209_v" };
|
||||||
"_031209_v"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//namespace ns {void x() {NSCO/*cursor*/
|
//namespace ns {void x() {NSCO/*cursor*/
|
||||||
public void testAccessToNamespaceFromClassMember1() throws Exception {
|
public void testAccessToNamespaceFromClassMember1() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "NSCONST" };
|
||||||
"NSCONST"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void ns::CNS::mcns(){NSCO/*cursor*/
|
//void ns::CNS::mcns(){NSCO/*cursor*/
|
||||||
public void testAccessToNamespaceFromClassMember2() throws Exception {
|
public void testAccessToNamespaceFromClassMember2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "NSCONST" };
|
||||||
"NSCONST"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,60 +634,46 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
|
|
||||||
//# d/*cursor*/
|
//# d/*cursor*/
|
||||||
public void testCompletePreprocessorDirective2() throws Exception {
|
public void testCompletePreprocessorDirective2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "define " };
|
||||||
"define "
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected,
|
assertCompletionResults(fCursorOffset, expected,
|
||||||
AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//# if d/*cursor*/
|
//# if d/*cursor*/
|
||||||
public void testCompletePreprocessorDirective3() throws Exception {
|
public void testCompletePreprocessorDirective3() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "defined" };
|
||||||
"defined"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void gfunc(){TClass<int> t(0); t.a/*cursor*/
|
//void gfunc(){TClass<int> t(0); t.a/*cursor*/
|
||||||
public void testTemplateClassMethod() throws Exception {
|
public void testTemplateClassMethod() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=172436
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=172436
|
||||||
final String[] expected= {
|
final String[] expected= { "add(int)" };
|
||||||
"add(int)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void gfunc(){C3 c3; c3.t/*cursor*/
|
//void gfunc(){C3 c3; c3.t/*cursor*/
|
||||||
public void testTemplateMethod() throws Exception {
|
public void testTemplateMethod() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=172436
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=172436
|
||||||
final String[] expected= {
|
final String[] expected= { "tConvert(void)" };
|
||||||
"tConvert(void)"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//using namespace ns;void gfunc(){NSC/*cursor*/
|
//using namespace ns;void gfunc(){NSC/*cursor*/
|
||||||
public void testUsingDirective() throws Exception {
|
public void testUsingDirective() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "NSCONST" };
|
||||||
"NSCONST"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void gfunc(){n/*cursor*/
|
//void gfunc(){n/*cursor*/
|
||||||
public void testAutoColons() throws Exception {
|
public void testAutoColons() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "ns::" };
|
||||||
"ns::"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//using namespace n/*cursor*/
|
//using namespace n/*cursor*/
|
||||||
public void testAutoColons2() throws Exception {
|
public void testAutoColons2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "ns" };
|
||||||
"ns"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -774,9 +690,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// fEditor.doSave(new NullProgressMonitor());
|
// fEditor.doSave(new NullProgressMonitor());
|
||||||
// EditorTestHelper.joinBackgroundActivities((AbstractTextEditor)fEditor);
|
// EditorTestHelper.joinBackgroundActivities((AbstractTextEditor)fEditor);
|
||||||
|
|
||||||
final String[] expected= {
|
final String[] expected= { "aNewGlobalVar" };
|
||||||
"aNewGlobalVar"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,9 +698,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// Printer::/*cursor*/
|
// Printer::/*cursor*/
|
||||||
public void testPrivateStaticMember_Bug109480() throws Exception {
|
public void testPrivateStaticMember_Bug109480() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109480
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=109480
|
||||||
final String[] expected= {
|
final String[] expected= { "InitPrinter()", "port" };
|
||||||
"InitPrinter()", "port"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,9 +709,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// };
|
// };
|
||||||
public void testForwardMembersInInlineMethods_Bug103857a() throws Exception {
|
public void testForwardMembersInInlineMethods_Bug103857a() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=103857
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=103857
|
||||||
final String[] expected= {
|
final String[] expected= { "x" };
|
||||||
"x"
|
|
||||||
};
|
|
||||||
assertMinimumCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertMinimumCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -815,18 +725,14 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// };
|
// };
|
||||||
public void testForwardMembersInInlineMethods_Bug103857b() throws Exception {
|
public void testForwardMembersInInlineMethods_Bug103857b() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=185652
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=185652
|
||||||
final String[] expected= {
|
final String[] expected= { "mem" };
|
||||||
"mem"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void Pri/*cursor*/
|
// void Pri/*cursor*/
|
||||||
public void testMethodDefinitionClassName_Bug190296() throws Exception {
|
public void testMethodDefinitionClassName_Bug190296() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=190296
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=190296
|
||||||
final String[] expected= {
|
final String[] expected= { "Printer::" };
|
||||||
"Printer::"
|
|
||||||
};
|
|
||||||
assertMinimumCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertMinimumCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -840,9 +746,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// fun/*cursor*/
|
// fun/*cursor*/
|
||||||
public void testFunctionWithTypedefToAnonymousType_bug192787() throws Exception {
|
public void testFunctionWithTypedefToAnonymousType_bug192787() throws Exception {
|
||||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=192787
|
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=192787
|
||||||
final String[] expected= {
|
final String[] expected= { "func(my_struct s) : void" };
|
||||||
"func(my_struct s) : void"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_DISP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_DISP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -939,7 +843,6 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #ifdef __cplusplus__
|
// #ifdef __cplusplus__
|
||||||
// extern "C" {
|
// extern "C" {
|
||||||
// #endif
|
// #endif
|
||||||
|
@ -1055,20 +958,15 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// int local;
|
// int local;
|
||||||
// switch(loc/*cursor*/
|
// switch(loc/*cursor*/
|
||||||
public void testSwitchStatement() throws Exception {
|
public void testSwitchStatement() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "local" };
|
||||||
"local"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// void test() {
|
// void test() {
|
||||||
// int local;
|
// int local;
|
||||||
// while(loc/*cursor*/
|
// while(loc/*cursor*/
|
||||||
public void testWhileStatement() throws Exception {
|
public void testWhileStatement() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "local" };
|
||||||
"local"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1076,9 +974,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// int local;
|
// int local;
|
||||||
// for(loc/*cursor*/
|
// for(loc/*cursor*/
|
||||||
public void testForStatement1() throws Exception {
|
public void testForStatement1() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "local" };
|
||||||
"local"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1086,9 +982,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// int local;
|
// int local;
|
||||||
// for(int i=0;i<loc/*cursor*/
|
// for(int i=0;i<loc/*cursor*/
|
||||||
public void testForStatement2() throws Exception {
|
public void testForStatement2() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "local" };
|
||||||
"local"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1096,9 +990,7 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
// int local;
|
// int local;
|
||||||
// for(int i=0;i<local;loc/*cursor*/
|
// for(int i=0;i<local;loc/*cursor*/
|
||||||
public void testForStatement3() throws Exception {
|
public void testForStatement3() throws Exception {
|
||||||
final String[] expected= {
|
final String[] expected= { "local" };
|
||||||
"local"
|
|
||||||
};
|
|
||||||
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
assertCompletionResults(fCursorOffset, expected, AbstractContentAssistTest.COMPARE_REP_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1400,5 +1292,4 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
final String[] expected = { "Cat", "meow(void)" };
|
final String[] expected = { "Cat", "meow(void)" };
|
||||||
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue