mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
bc30d29351
commit
7b3c5d43f3
1 changed files with 112 additions and 116 deletions
|
@ -75,25 +75,24 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
public ProjectWithDepProj() {setStrategy(new ReferencedProject(true));}
|
public ProjectWithDepProj() {setStrategy(new ReferencedProject(true));}
|
||||||
public static TestSuite suite() {return suite(ProjectWithDepProj.class);}
|
public static TestSuite suite() {return suite(ProjectWithDepProj.class);}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addTests(TestSuite suite) {
|
public static void addTests(TestSuite suite) {
|
||||||
suite.addTest(IndexCPPBindingResolutionBugsSingleProjectFirstAST.suite());
|
suite.addTest(IndexCPPBindingResolutionBugsSingleProjectFirstAST.suite());
|
||||||
suite.addTest(SingleProject.suite());
|
suite.addTest(SingleProject.suite());
|
||||||
suite.addTest(ProjectWithDepProj.suite());
|
suite.addTest(ProjectWithDepProj.suite());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TestSuite suite() {
|
public static TestSuite suite() {
|
||||||
return suite(IndexCPPBindingResolutionBugs.class);
|
return suite(IndexCPPBindingResolutionBugs.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IndexCPPBindingResolutionBugs() {
|
public IndexCPPBindingResolutionBugs() {
|
||||||
setStrategy(new SinglePDOMTestStrategy(true));
|
setStrategy(new SinglePDOMTestStrategy(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
// #define OBJ void foo()
|
// #define OBJ void foo()
|
||||||
// #define FUNC() void bar()
|
// #define FUNC() void bar()
|
||||||
// #define FUNC2(A) void baz()
|
// #define FUNC2(A) void baz()
|
||||||
|
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
//
|
//
|
||||||
|
@ -102,43 +101,43 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// FUNC2(1) {}
|
// FUNC2(1) {}
|
||||||
public void testBug208558() throws CoreException {
|
public void testBug208558() throws CoreException {
|
||||||
IIndex index= getIndex();
|
IIndex index= getIndex();
|
||||||
|
|
||||||
IIndexMacro[] macrosA= index.findMacros("OBJ".toCharArray(), IndexFilter.ALL, npm());
|
IIndexMacro[] macrosA= index.findMacros("OBJ".toCharArray(), IndexFilter.ALL, npm());
|
||||||
IIndexMacro[] macrosB= index.findMacros("FUNC".toCharArray(), IndexFilter.ALL, npm());
|
IIndexMacro[] macrosB= index.findMacros("FUNC".toCharArray(), IndexFilter.ALL, npm());
|
||||||
IIndexMacro[] macrosC= index.findMacros("FUNC2".toCharArray(), IndexFilter.ALL, npm());
|
IIndexMacro[] macrosC= index.findMacros("FUNC2".toCharArray(), IndexFilter.ALL, npm());
|
||||||
|
|
||||||
assertEquals(1, macrosA.length);
|
assertEquals(1, macrosA.length);
|
||||||
assertEquals(1, macrosB.length);
|
assertEquals(1, macrosB.length);
|
||||||
assertEquals(1, macrosC.length);
|
assertEquals(1, macrosC.length);
|
||||||
IIndexMacro obj= macrosA[0];
|
IIndexMacro obj= macrosA[0];
|
||||||
IIndexMacro func= macrosB[0];
|
IIndexMacro func= macrosB[0];
|
||||||
IIndexMacro func2= macrosC[0];
|
IIndexMacro func2= macrosC[0];
|
||||||
|
|
||||||
assertEquals("OBJ", new String(obj.getName()));
|
assertEquals("OBJ", new String(obj.getName()));
|
||||||
assertEquals("FUNC", new String(func.getName()));
|
assertEquals("FUNC", new String(func.getName()));
|
||||||
assertEquals("FUNC2", new String(func2.getName()));
|
assertEquals("FUNC2", new String(func2.getName()));
|
||||||
|
|
||||||
assertEquals("void foo()", new String(obj.getExpansionImage()));
|
assertEquals("void foo()", new String(obj.getExpansionImage()));
|
||||||
assertEquals("void bar()", new String(func.getExpansionImage()));
|
assertEquals("void bar()", new String(func.getExpansionImage()));
|
||||||
assertEquals("void baz()", new String(func2.getExpansionImage()));
|
assertEquals("void baz()", new String(func2.getExpansionImage()));
|
||||||
|
|
||||||
assertEquals("OBJ", new String(obj.getName()));
|
assertEquals("OBJ", new String(obj.getName()));
|
||||||
assertNull(obj.getParameterList());
|
assertNull(obj.getParameterList());
|
||||||
|
|
||||||
assertEquals("FUNC", new String(func.getName()));
|
assertEquals("FUNC", new String(func.getName()));
|
||||||
assertEquals(0, func.getParameterList().length);
|
assertEquals(0, func.getParameterList().length);
|
||||||
|
|
||||||
assertEquals("FUNC2", new String(func2.getName()));
|
assertEquals("FUNC2", new String(func2.getName()));
|
||||||
assertEquals(1, func2.getParameterList().length);
|
assertEquals(1, func2.getParameterList().length);
|
||||||
assertEquals("A", new String(func2.getParameterList()[0]));
|
assertEquals("A", new String(func2.getParameterList()[0]));
|
||||||
|
|
||||||
IIndexBinding[] bindings= index.findBindings(Pattern.compile(".*"), false, IndexFilter.ALL, npm());
|
IIndexBinding[] bindings= index.findBindings(Pattern.compile(".*"), false, IndexFilter.ALL, npm());
|
||||||
assertEquals(3, bindings.length);
|
assertEquals(3, bindings.length);
|
||||||
|
|
||||||
IIndexBinding foo= index.findBindings("foo".toCharArray(), IndexFilter.ALL, npm())[0];
|
IIndexBinding foo= index.findBindings("foo".toCharArray(), IndexFilter.ALL, npm())[0];
|
||||||
IIndexBinding bar= index.findBindings("bar".toCharArray(), IndexFilter.ALL, npm())[0];
|
IIndexBinding bar= index.findBindings("bar".toCharArray(), IndexFilter.ALL, npm())[0];
|
||||||
IIndexBinding baz= index.findBindings("baz".toCharArray(), IndexFilter.ALL, npm())[0];
|
IIndexBinding baz= index.findBindings("baz".toCharArray(), IndexFilter.ALL, npm())[0];
|
||||||
|
|
||||||
assertEquals("foo", foo.getName());
|
assertEquals("foo", foo.getName());
|
||||||
assertEquals("bar", bar.getName());
|
assertEquals("bar", bar.getName());
|
||||||
assertEquals("baz", baz.getName());
|
assertEquals("baz", baz.getName());
|
||||||
|
@ -146,7 +145,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertInstance(bar, ICPPFunction.class);
|
assertInstance(bar, ICPPFunction.class);
|
||||||
assertInstance(baz, ICPPFunction.class);
|
assertInstance(baz, ICPPFunction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// template <class T>
|
// template <class T>
|
||||||
// inline void testTemplate(T& aRef);
|
// inline void testTemplate(T& aRef);
|
||||||
//
|
//
|
||||||
|
@ -162,7 +161,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertInstance(b0, ICPPFunction.class);
|
assertInstance(b0, ICPPFunction.class);
|
||||||
assertInstance(b0, ICPPTemplateInstance.class);
|
assertInstance(b0, ICPPTemplateInstance.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class testdef{
|
// class testdef{
|
||||||
//
|
//
|
||||||
// public:
|
// public:
|
||||||
|
@ -175,7 +174,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
//
|
//
|
||||||
// testdef* global_cBase;
|
// testdef* global_cBase;
|
||||||
// testdef*& global_cBaseRef = global_cBase;
|
// testdef*& global_cBaseRef = global_cBase;
|
||||||
|
|
||||||
// #include "typedefHeader.h"
|
// #include "typedefHeader.h"
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -183,7 +182,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// {
|
// {
|
||||||
// testdef* local_cBase;
|
// testdef* local_cBase;
|
||||||
// testdef*& local_cBaseRef = local_cBase;
|
// testdef*& local_cBaseRef = local_cBase;
|
||||||
//
|
//
|
||||||
// testCall( /*1*/ (void *) local_cBase);
|
// testCall( /*1*/ (void *) local_cBase);
|
||||||
// testCall( /*2*/ local_cBase);
|
// testCall( /*2*/ local_cBase);
|
||||||
//
|
//
|
||||||
|
@ -206,18 +205,17 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
IBinding b7= getBindingFromASTName("testCall( /*7*/", 8);
|
IBinding b7= getBindingFromASTName("testCall( /*7*/", 8);
|
||||||
IBinding b8= getBindingFromASTName("testCall( /*8*/", 8);
|
IBinding b8= getBindingFromASTName("testCall( /*8*/", 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// template<typename T1>
|
// template<typename T1>
|
||||||
// class A {};
|
// class A {};
|
||||||
//
|
//
|
||||||
// template<typename T2>
|
// template<typename T2>
|
||||||
// class B : public A<T2> {};
|
// class B : public A<T2> {};
|
||||||
//
|
//
|
||||||
// class C {};
|
// class C {};
|
||||||
//
|
//
|
||||||
// B<C> b;
|
// B<C> b;
|
||||||
|
|
||||||
// void foo() {C c; B<int> b;}
|
// void foo() {C c; B<int> b;}
|
||||||
public void testBug188274() throws Exception {
|
public void testBug188274() throws Exception {
|
||||||
IBinding b0= getBindingFromASTName("C", 1);
|
IBinding b0= getBindingFromASTName("C", 1);
|
||||||
|
@ -226,7 +224,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertInstance(b1, ICPPClassType.class);
|
assertInstance(b1, ICPPClassType.class);
|
||||||
assertInstance(b1, ICPPClassTemplate.class);
|
assertInstance(b1, ICPPClassTemplate.class);
|
||||||
assertInstance(b1, ICPPInstanceCache.class);
|
assertInstance(b1, ICPPInstanceCache.class);
|
||||||
|
|
||||||
ICPPInstanceCache ct= (ICPPInstanceCache) b1;
|
ICPPInstanceCache ct= (ICPPInstanceCache) b1;
|
||||||
ICPPSpecialization inst= ct.getInstance(new ICPPTemplateArgument[]{new CPPTemplateTypeArgument((IType)b0)});
|
ICPPSpecialization inst= ct.getInstance(new ICPPTemplateArgument[]{new CPPTemplateTypeArgument((IType)b0)});
|
||||||
assertInstance(inst, ICPPClassType.class);
|
assertInstance(inst, ICPPClassType.class);
|
||||||
|
@ -235,9 +233,9 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertEquals(1, bases.length);
|
assertEquals(1, bases.length);
|
||||||
assertInstance(bases[0].getBaseClass(), ICPPClassType.class);
|
assertInstance(bases[0].getBaseClass(), ICPPClassType.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace ns {class A{};}
|
// namespace ns {class A{};}
|
||||||
|
|
||||||
// ns::A a;
|
// ns::A a;
|
||||||
// class B {};
|
// class B {};
|
||||||
public void testBug188324() throws Exception {
|
public void testBug188324() throws Exception {
|
||||||
|
@ -247,41 +245,41 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
ICPPNamespace ns= (ICPPNamespace) b0;
|
ICPPNamespace ns= (ICPPNamespace) b0;
|
||||||
assertEquals(0, ns.getNamespaceScope().getBindings(name, false, false).length);
|
assertEquals(0, ns.getNamespaceScope().getBindings(name, false, false).length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// template<typename T>
|
// template<typename T>
|
||||||
// class C : public C<T> {};
|
// class C : public C<T> {};
|
||||||
|
|
||||||
// void foo() {
|
// void foo() {
|
||||||
// C<int>::unresolvable();
|
// C<int>::unresolvable();
|
||||||
// };
|
// };
|
||||||
public void testBug185828() throws Exception {
|
public void testBug185828() throws Exception {
|
||||||
// Bug 185828 reports a StackOverflowException is thrown before we get here.
|
// Bug 185828 reports a StackOverflowException is thrown before we get here.
|
||||||
// That the SOE is thrown is detected in BaseTestCase via an Error IStatus
|
// That the SOE is thrown is detected in BaseTestCase via an Error IStatus
|
||||||
|
|
||||||
IBinding b0= getBindingFromASTName("C<int>", 1);
|
IBinding b0= getBindingFromASTName("C<int>", 1);
|
||||||
IBinding b1= getBindingFromASTName("C<int>", 6);
|
IBinding b1= getBindingFromASTName("C<int>", 6);
|
||||||
IBinding b2= getProblemFromASTName("unresolvable", 12);
|
IBinding b2= getProblemFromASTName("unresolvable", 12);
|
||||||
|
|
||||||
assertInstance(b0, ICPPClassType.class);
|
assertInstance(b0, ICPPClassType.class);
|
||||||
assertInstance(b0, ICPPClassTemplate.class);
|
assertInstance(b0, ICPPClassTemplate.class);
|
||||||
|
|
||||||
assertInstance(b1, ICPPClassType.class);
|
assertInstance(b1, ICPPClassType.class);
|
||||||
assertInstance(b1, ICPPSpecialization.class);
|
assertInstance(b1, ICPPSpecialization.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class MyClass {
|
// class MyClass {
|
||||||
// public:
|
// public:
|
||||||
// template<class T>
|
// template<class T>
|
||||||
// T* MopGetObject(T*& aPtr)
|
// T* MopGetObject(T*& aPtr)
|
||||||
// { return 0; }
|
// { return 0; }
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// template<class T>
|
// template<class T>
|
||||||
// T* MopGetObjectNoChaining(T*& aPtr)
|
// T* MopGetObjectNoChaining(T*& aPtr)
|
||||||
// { return 0; }
|
// { return 0; }
|
||||||
//
|
//
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// int main() {
|
// int main() {
|
||||||
// MyClass* cls= new MyClass();
|
// MyClass* cls= new MyClass();
|
||||||
// }
|
// }
|
||||||
|
@ -294,12 +292,12 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertInstance(ms[0], ICPPTemplateDefinition.class);
|
assertInstance(ms[0], ICPPTemplateDefinition.class);
|
||||||
assertInstance(ms[1], ICPPTemplateDefinition.class);
|
assertInstance(ms[1], ICPPTemplateDefinition.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // header file
|
// // header file
|
||||||
// class cl;
|
// class cl;
|
||||||
// typedef cl* t1;
|
// typedef cl* t1;
|
||||||
// typedef t1 t2;
|
// typedef t1 t2;
|
||||||
|
|
||||||
//// referencing content
|
//// referencing content
|
||||||
// void func(t2 a);
|
// void func(t2 a);
|
||||||
// void func(int b);
|
// void func(int b);
|
||||||
|
@ -310,10 +308,10 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
public void testBug166954() {
|
public void testBug166954() {
|
||||||
IBinding b0 = getBindingFromASTName("func(a)", 4);
|
IBinding b0 = getBindingFromASTName("func(a)", 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // header
|
// // header
|
||||||
// class Base {
|
// class Base {
|
||||||
// public:
|
// public:
|
||||||
// void foo(int i);
|
// void foo(int i);
|
||||||
// int fooint();
|
// int fooint();
|
||||||
// char* fooovr();
|
// char* fooovr();
|
||||||
|
@ -351,10 +349,9 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
getBindingFromASTName("fooovr('", 6);
|
getBindingFromASTName("fooovr('", 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// // header
|
// // header
|
||||||
// class Base {
|
// class Base {
|
||||||
// public:
|
// public:
|
||||||
// void foo(int i);
|
// void foo(int i);
|
||||||
// int foo2(int i);
|
// int foo2(int i);
|
||||||
// };
|
// };
|
||||||
|
@ -382,9 +379,9 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
getBindingFromASTName("k=2", 1);
|
getBindingFromASTName("k=2", 1);
|
||||||
getBindingFromASTName("l=2", 1);
|
getBindingFromASTName("l=2", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace X {}
|
// namespace X {}
|
||||||
|
|
||||||
// namespace Y {
|
// namespace Y {
|
||||||
// class Ambiguity {};
|
// class Ambiguity {};
|
||||||
// enum Ambiguity {A1,A2,A3};
|
// enum Ambiguity {A1,A2,A3};
|
||||||
|
@ -400,9 +397,9 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertNotNull(name);
|
assertNotNull(name);
|
||||||
IBinding binding2= adapted.getNamespaceScope().getBinding(name, true);
|
IBinding binding2= adapted.getNamespaceScope().getBinding(name, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace X {int i;}
|
// namespace X {int i;}
|
||||||
|
|
||||||
// // references
|
// // references
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
// int a= X::i;
|
// int a= X::i;
|
||||||
|
@ -411,10 +408,10 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(binding instanceof ICPPVariable);
|
assertTrue(binding instanceof ICPPVariable);
|
||||||
IScope scope= binding.getScope();
|
IScope scope= binding.getScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
// template<class T, class U, class V>
|
// template<class T, class U, class V>
|
||||||
// class A {};
|
// class A {};
|
||||||
|
|
||||||
// template<>
|
// template<>
|
||||||
// class A<int, bool, double> {};
|
// class A<int, bool, double> {};
|
||||||
public void testBug180784() throws Exception {
|
public void testBug180784() throws Exception {
|
||||||
|
@ -432,7 +429,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertNotNull(map.get(ps[1]));
|
assertNotNull(map.get(ps[1]));
|
||||||
assertNotNull(map.get(ps[2]));
|
assertNotNull(map.get(ps[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// class A{};
|
// class A{};
|
||||||
//
|
//
|
||||||
// template<typename T>
|
// template<typename T>
|
||||||
|
@ -442,7 +439,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// A id (A a) {return a;}
|
// A id (A a) {return a;}
|
||||||
//
|
//
|
||||||
// int id(int x) {return x;}
|
// int id(int x) {return x;}
|
||||||
|
|
||||||
// void foo() {
|
// void foo() {
|
||||||
// id(*new A());
|
// id(*new A());
|
||||||
// id(6);
|
// id(6);
|
||||||
|
@ -453,10 +450,9 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
IBinding b0= getBindingFromASTName("id(*", 2);
|
IBinding b0= getBindingFromASTName("id(*", 2);
|
||||||
IBinding b1= getBindingFromASTName("id(6", 2);
|
IBinding b1= getBindingFromASTName("id(6", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// void func1(void);
|
// void func1(void);
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
//
|
//
|
||||||
// int main(void)
|
// int main(void)
|
||||||
|
@ -467,7 +463,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
IBinding b0 = getBindingFromASTName("func1;", 5);
|
IBinding b0 = getBindingFromASTName("func1;", 5);
|
||||||
assertTrue(b0 instanceof IFunction);
|
assertTrue(b0 instanceof IFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class B {
|
// class B {
|
||||||
// public:
|
// public:
|
||||||
// class BB {
|
// class BB {
|
||||||
|
@ -477,9 +473,9 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// };
|
// };
|
||||||
//
|
//
|
||||||
// class A : public B::BB {};
|
// class A : public B::BB {};
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
//
|
//
|
||||||
// void foo() {
|
// void foo() {
|
||||||
// A c;
|
// A c;
|
||||||
// c.field;//comment
|
// c.field;//comment
|
||||||
|
@ -488,7 +484,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
IBinding b0 = getBindingFromASTName("field;//", 5);
|
IBinding b0 = getBindingFromASTName("field;//", 5);
|
||||||
assertTrue(b0 instanceof ICPPField);
|
assertTrue(b0 instanceof ICPPField);
|
||||||
}
|
}
|
||||||
|
|
||||||
// typedef struct {
|
// typedef struct {
|
||||||
// int utm;
|
// int utm;
|
||||||
// } usertype;
|
// } usertype;
|
||||||
|
@ -532,9 +528,9 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
type= ((ITypedef) type).getType();
|
type= ((ITypedef) type).getType();
|
||||||
assertTrue(type instanceof IEnumeration);
|
assertTrue(type instanceof IEnumeration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // no header needed
|
// // no header needed
|
||||||
|
|
||||||
// typedef class {
|
// typedef class {
|
||||||
// int member;
|
// int member;
|
||||||
// } t_class;
|
// } t_class;
|
||||||
|
@ -570,7 +566,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(tdIndex instanceof IIndexBinding);
|
assertTrue(tdIndex instanceof IIndexBinding);
|
||||||
assertTrue(tdAST instanceof ITypedef);
|
assertTrue(tdAST instanceof ITypedef);
|
||||||
assertTrue(tdIndex instanceof ITypedef);
|
assertTrue(tdIndex instanceof ITypedef);
|
||||||
|
|
||||||
tAST= ((ITypedef) tdAST).getType();
|
tAST= ((ITypedef) tdAST).getType();
|
||||||
tIndex= ((ITypedef) tdIndex).getType();
|
tIndex= ((ITypedef) tdIndex).getType();
|
||||||
assertTrue(tAST instanceof ICompositeType);
|
assertTrue(tAST instanceof ICompositeType);
|
||||||
|
@ -585,7 +581,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(tdIndex instanceof IIndexBinding);
|
assertTrue(tdIndex instanceof IIndexBinding);
|
||||||
assertTrue(tdAST instanceof ITypedef);
|
assertTrue(tdAST instanceof ITypedef);
|
||||||
assertTrue(tdIndex instanceof ITypedef);
|
assertTrue(tdIndex instanceof ITypedef);
|
||||||
|
|
||||||
tAST= ((ITypedef) tdAST).getType();
|
tAST= ((ITypedef) tdAST).getType();
|
||||||
tIndex= ((ITypedef) tdIndex).getType();
|
tIndex= ((ITypedef) tdIndex).getType();
|
||||||
assertTrue(tAST instanceof ICompositeType);
|
assertTrue(tAST instanceof ICompositeType);
|
||||||
|
@ -600,7 +596,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(tdIndex instanceof IIndexBinding);
|
assertTrue(tdIndex instanceof IIndexBinding);
|
||||||
assertTrue(tdAST instanceof ITypedef);
|
assertTrue(tdAST instanceof ITypedef);
|
||||||
assertTrue(tdIndex instanceof ITypedef);
|
assertTrue(tdIndex instanceof ITypedef);
|
||||||
|
|
||||||
tAST= ((ITypedef) tdAST).getType();
|
tAST= ((ITypedef) tdAST).getType();
|
||||||
tIndex= ((ITypedef) tdIndex).getType();
|
tIndex= ((ITypedef) tdIndex).getType();
|
||||||
assertTrue(tAST instanceof IEnumeration);
|
assertTrue(tAST instanceof IEnumeration);
|
||||||
|
@ -610,7 +606,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
}
|
}
|
||||||
|
|
||||||
// // no header needed
|
// // no header needed
|
||||||
|
|
||||||
// namespace ns {
|
// namespace ns {
|
||||||
// typedef class {
|
// typedef class {
|
||||||
// int member;
|
// int member;
|
||||||
|
@ -648,7 +644,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(tdIndex instanceof IIndexBinding);
|
assertTrue(tdIndex instanceof IIndexBinding);
|
||||||
assertTrue(tdAST instanceof ITypedef);
|
assertTrue(tdAST instanceof ITypedef);
|
||||||
assertTrue(tdIndex instanceof ITypedef);
|
assertTrue(tdIndex instanceof ITypedef);
|
||||||
|
|
||||||
tAST= ((ITypedef) tdAST).getType();
|
tAST= ((ITypedef) tdAST).getType();
|
||||||
tIndex= ((ITypedef) tdIndex).getType();
|
tIndex= ((ITypedef) tdIndex).getType();
|
||||||
assertTrue(tAST instanceof ICompositeType);
|
assertTrue(tAST instanceof ICompositeType);
|
||||||
|
@ -663,7 +659,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(tdIndex instanceof IIndexBinding);
|
assertTrue(tdIndex instanceof IIndexBinding);
|
||||||
assertTrue(tdAST instanceof ITypedef);
|
assertTrue(tdAST instanceof ITypedef);
|
||||||
assertTrue(tdIndex instanceof ITypedef);
|
assertTrue(tdIndex instanceof ITypedef);
|
||||||
|
|
||||||
tAST= ((ITypedef) tdAST).getType();
|
tAST= ((ITypedef) tdAST).getType();
|
||||||
tIndex= ((ITypedef) tdIndex).getType();
|
tIndex= ((ITypedef) tdIndex).getType();
|
||||||
assertTrue(tAST instanceof ICompositeType);
|
assertTrue(tAST instanceof ICompositeType);
|
||||||
|
@ -678,7 +674,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(tdIndex instanceof IIndexBinding);
|
assertTrue(tdIndex instanceof IIndexBinding);
|
||||||
assertTrue(tdAST instanceof ITypedef);
|
assertTrue(tdAST instanceof ITypedef);
|
||||||
assertTrue(tdIndex instanceof ITypedef);
|
assertTrue(tdIndex instanceof ITypedef);
|
||||||
|
|
||||||
tAST= ((ITypedef) tdAST).getType();
|
tAST= ((ITypedef) tdAST).getType();
|
||||||
tIndex= ((ITypedef) tdIndex).getType();
|
tIndex= ((ITypedef) tdIndex).getType();
|
||||||
assertTrue(tAST instanceof IEnumeration);
|
assertTrue(tAST instanceof IEnumeration);
|
||||||
|
@ -686,7 +682,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(tAST.isSameType(tIndex));
|
assertTrue(tAST.isSameType(tIndex));
|
||||||
assertTrue(tIndex.isSameType(tAST));
|
assertTrue(tIndex.isSameType(tAST));
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace FOO {
|
// namespace FOO {
|
||||||
// namespace BAR {
|
// namespace BAR {
|
||||||
// class Bar;
|
// class Bar;
|
||||||
|
@ -699,7 +695,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
// namespace FOO {
|
// namespace FOO {
|
||||||
// using BAR::Bar;
|
// using BAR::Bar;
|
||||||
//
|
//
|
||||||
// Bar* Foo::Test(Bar* pBar) {
|
// Bar* Foo::Test(Bar* pBar) {
|
||||||
// return pBar;
|
// return pBar;
|
||||||
// }
|
// }
|
||||||
|
@ -716,13 +712,13 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(cl instanceof ICPPClassType);
|
assertTrue(cl instanceof ICPPClassType);
|
||||||
assertEquals("BAR", cl.getScope().getScopeName().toString());
|
assertEquals("BAR", cl.getScope().getScopeName().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// struct outer {
|
// struct outer {
|
||||||
// union {
|
// union {
|
||||||
// int var1;
|
// int var1;
|
||||||
// };
|
// };
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
// void test() {
|
// void test() {
|
||||||
// struct outer x;
|
// struct outer x;
|
||||||
|
@ -746,7 +742,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// int var2;
|
// int var2;
|
||||||
// } hide;
|
// } hide;
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
// void test() {
|
// void test() {
|
||||||
// union outer x;
|
// union outer x;
|
||||||
|
@ -761,15 +757,15 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
IScope outer= f.getCompositeTypeOwner().getScope();
|
IScope outer= f.getCompositeTypeOwner().getScope();
|
||||||
assertTrue(outer instanceof ICPPClassScope);
|
assertTrue(outer instanceof ICPPClassScope);
|
||||||
assertEquals("outer", outer.getScopeName().toString());
|
assertEquals("outer", outer.getScopeName().toString());
|
||||||
|
|
||||||
getProblemFromASTName("var2=", 4);
|
getProblemFromASTName("var2=", 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace ns {
|
// namespace ns {
|
||||||
// int v;
|
// int v;
|
||||||
// };
|
// };
|
||||||
// using namespace ns;
|
// using namespace ns;
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
// void test() {
|
// void test() {
|
||||||
// v=1;
|
// v=1;
|
||||||
|
@ -781,8 +777,8 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
IScope scope= v.getScope();
|
IScope scope= v.getScope();
|
||||||
assertTrue(scope instanceof ICPPNamespaceScope);
|
assertTrue(scope instanceof ICPPNamespaceScope);
|
||||||
assertEquals("ns", scope.getScopeName().toString());
|
assertEquals("ns", scope.getScopeName().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace NSA {
|
// namespace NSA {
|
||||||
// int a;
|
// int a;
|
||||||
// }
|
// }
|
||||||
|
@ -813,7 +809,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertTrue(scope instanceof ICPPNamespaceScope);
|
assertTrue(scope instanceof ICPPNamespaceScope);
|
||||||
assertEquals("NSB", scope.getScopeName().toString());
|
assertEquals("NSB", scope.getScopeName().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace N { namespace M {}}
|
// namespace N { namespace M {}}
|
||||||
|
|
||||||
// namespace N {using namespace N::M;}
|
// namespace N {using namespace N::M;}
|
||||||
|
@ -822,9 +818,9 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
public void testEndlessLoopWithUsingDeclaration_Bug209813() throws DOMException {
|
public void testEndlessLoopWithUsingDeclaration_Bug209813() throws DOMException {
|
||||||
getProblemFromASTName("x;", 1);
|
getProblemFromASTName("x;", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class MyClass {};
|
// class MyClass {};
|
||||||
|
|
||||||
// void test(MyClass* ptr);
|
// void test(MyClass* ptr);
|
||||||
// class MyClass;
|
// class MyClass;
|
||||||
public void testClassRedeclarationAfterReference_Bug229571() throws Exception {
|
public void testClassRedeclarationAfterReference_Bug229571() throws Exception {
|
||||||
|
@ -835,7 +831,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
type= ((IPointerType) type).getType();
|
type= ((IPointerType) type).getType();
|
||||||
assertSame(type, cl);
|
assertSame(type, cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class A {
|
// class A {
|
||||||
// public:
|
// public:
|
||||||
// void foo() const volatile;
|
// void foo() const volatile;
|
||||||
|
@ -847,7 +843,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// void bar() const;
|
// void bar() const;
|
||||||
// void bar();
|
// void bar();
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// void A::foo() const volatile { bar();/*1*/ }
|
// void A::foo() const volatile { bar();/*1*/ }
|
||||||
// void A::foo() volatile { bar();/*2*/ }
|
// void A::foo() volatile { bar();/*2*/ }
|
||||||
// void A::foo() const { bar();/*3*/ }
|
// void A::foo() const { bar();/*3*/ }
|
||||||
|
@ -871,12 +867,12 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
ICPPFunctionType bar_v_ft= bar_v.getType();
|
ICPPFunctionType bar_v_ft= bar_v.getType();
|
||||||
ICPPFunctionType bar_c_ft= bar_c.getType();
|
ICPPFunctionType bar_c_ft= bar_c.getType();
|
||||||
ICPPFunctionType bar_ft= bar.getType();
|
ICPPFunctionType bar_ft= bar.getType();
|
||||||
|
|
||||||
assertTrue(bar_cv_ft.isConst()); assertTrue(bar_cv_ft.isVolatile());
|
assertTrue(bar_cv_ft.isConst()); assertTrue(bar_cv_ft.isVolatile());
|
||||||
assertTrue(!bar_v_ft.isConst()); assertTrue(bar_v_ft.isVolatile());
|
assertTrue(!bar_v_ft.isConst()); assertTrue(bar_v_ft.isVolatile());
|
||||||
assertTrue(bar_c_ft.isConst()); assertTrue(!bar_c_ft.isVolatile());
|
assertTrue(bar_c_ft.isConst()); assertTrue(!bar_c_ft.isVolatile());
|
||||||
assertTrue(!bar_ft.isConst()); assertTrue(!bar_ft.isVolatile());
|
assertTrue(!bar_ft.isConst()); assertTrue(!bar_ft.isVolatile());
|
||||||
|
|
||||||
bar_cv= getBindingFromASTName("bar();/*5*/", 3, ICPPMethod.class);
|
bar_cv= getBindingFromASTName("bar();/*5*/", 3, ICPPMethod.class);
|
||||||
bar_v= getBindingFromASTName("bar();/*6*/", 3, ICPPMethod.class);
|
bar_v= getBindingFromASTName("bar();/*6*/", 3, ICPPMethod.class);
|
||||||
bar_c= getBindingFromASTName("bar();/*7*/", 3, ICPPMethod.class);
|
bar_c= getBindingFromASTName("bar();/*7*/", 3, ICPPMethod.class);
|
||||||
|
@ -885,18 +881,18 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
bar_v_ft= bar_v.getType();
|
bar_v_ft= bar_v.getType();
|
||||||
bar_c_ft= bar_c.getType();
|
bar_c_ft= bar_c.getType();
|
||||||
bar_ft= bar.getType();
|
bar_ft= bar.getType();
|
||||||
|
|
||||||
assertTrue(bar_cv_ft.isConst()); assertTrue(bar_cv_ft.isVolatile());
|
assertTrue(bar_cv_ft.isConst()); assertTrue(bar_cv_ft.isVolatile());
|
||||||
assertTrue(!bar_v_ft.isConst()); assertTrue(bar_v_ft.isVolatile());
|
assertTrue(!bar_v_ft.isConst()); assertTrue(bar_v_ft.isVolatile());
|
||||||
assertTrue(bar_c_ft.isConst()); assertTrue(!bar_c_ft.isVolatile());
|
assertTrue(bar_c_ft.isConst()); assertTrue(!bar_c_ft.isVolatile());
|
||||||
assertTrue(!bar_ft.isConst()); assertTrue(!bar_ft.isVolatile());
|
assertTrue(!bar_ft.isConst()); assertTrue(!bar_ft.isVolatile());
|
||||||
}
|
}
|
||||||
|
|
||||||
// typedef char t[12];
|
// typedef char t[12];
|
||||||
// void test1(char *);
|
// void test1(char *);
|
||||||
// void test2(char []);
|
// void test2(char []);
|
||||||
// void test3(t);
|
// void test3(t);
|
||||||
|
|
||||||
// void xx() {
|
// void xx() {
|
||||||
// char* x= 0;
|
// char* x= 0;
|
||||||
// test1(x);
|
// test1(x);
|
||||||
|
@ -908,7 +904,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
getBindingFromASTName("test2(x)", 5, ICPPFunction.class);
|
getBindingFromASTName("test2(x)", 5, ICPPFunction.class);
|
||||||
getBindingFromASTName("test3(x)", 5, ICPPFunction.class);
|
getBindingFromASTName("test3(x)", 5, ICPPFunction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class A {
|
// class A {
|
||||||
// A();
|
// A();
|
||||||
// void l();
|
// void l();
|
||||||
|
@ -965,7 +961,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// int h;
|
// int h;
|
||||||
// class P {};
|
// class P {};
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// C c;
|
// C c;
|
||||||
// CT<int> ct;
|
// CT<int> ct;
|
||||||
// CT<char> ctinst;
|
// CT<char> ctinst;
|
||||||
|
@ -1044,7 +1040,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
assertBindings(new String[] {"f", "g"}, ClassTypeHelper.getFields(ct, null));
|
assertBindings(new String[] {"f", "g"}, ClassTypeHelper.getFields(ct, null));
|
||||||
assertBindings(new String[] {"m", "n", "CT", "CT", "~CT", "B", "B", "~B", "operator =", "operator ="}, ClassTypeHelper.getMethods(ct, null));
|
assertBindings(new String[] {"m", "n", "CT", "CT", "~CT", "B", "B", "~B", "operator =", "operator ="}, ClassTypeHelper.getMethods(ct, null));
|
||||||
assertBindings(new String[] {"O"}, ClassTypeHelper.getNestedClasses(ct, null));
|
assertBindings(new String[] {"O"}, ClassTypeHelper.getNestedClasses(ct, null));
|
||||||
|
|
||||||
// explicit class specialization
|
// explicit class specialization
|
||||||
ct= getBindingFromASTName("C espec", 1);
|
ct= getBindingFromASTName("C espec", 1);
|
||||||
assertInstance(ct, ICPPClassSpecialization.class);
|
assertInstance(ct, ICPPClassSpecialization.class);
|
||||||
|
@ -1071,7 +1067,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
}
|
}
|
||||||
|
|
||||||
// void func(const int* x) {}
|
// void func(const int* x) {}
|
||||||
|
|
||||||
// void func(int* p) {
|
// void func(int* p) {
|
||||||
// const int* q = p;
|
// const int* q = p;
|
||||||
// func(q);
|
// func(q);
|
||||||
|
@ -1124,12 +1120,12 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
String[] actual= new String[binding.length];
|
String[] actual= new String[binding.length];
|
||||||
for (int i = 0; i < actual.length; i++) {
|
for (int i = 0; i < actual.length; i++) {
|
||||||
actual[i]= binding[i].getName();
|
actual[i]= binding[i].getName();
|
||||||
}
|
}
|
||||||
Arrays.sort(actual);
|
Arrays.sort(actual);
|
||||||
Arrays.sort(expected);
|
Arrays.sort(expected);
|
||||||
assertEquals(toString(expected), toString(actual));
|
assertEquals(toString(expected), toString(actual));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String toString(String[] actual) {
|
private String toString(String[] actual) {
|
||||||
StringBuilder buf= new StringBuilder();
|
StringBuilder buf= new StringBuilder();
|
||||||
buf.append('{');
|
buf.append('{');
|
||||||
|
@ -1144,14 +1140,14 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
buf.append('}');
|
buf.append('}');
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// class Derived;
|
// class Derived;
|
||||||
// class X {
|
// class X {
|
||||||
// Derived* d;
|
// Derived* d;
|
||||||
// };
|
// };
|
||||||
// class Base {};
|
// class Base {};
|
||||||
// void useBase(Base* b);
|
// void useBase(Base* b);
|
||||||
|
|
||||||
// class Derived: Base {};
|
// class Derived: Base {};
|
||||||
// void test() {
|
// void test() {
|
||||||
// X x;
|
// X x;
|
||||||
|
@ -1160,7 +1156,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
public void testLateDefinitionOfInheritance_Bug292749() throws Exception {
|
public void testLateDefinitionOfInheritance_Bug292749() throws Exception {
|
||||||
getBindingFromASTName("useBase(x.d", 7, ICPPFunction.class);
|
getBindingFromASTName("useBase(x.d", 7, ICPPFunction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace one {
|
// namespace one {
|
||||||
// void fx();
|
// void fx();
|
||||||
// void fx(int);
|
// void fx(int);
|
||||||
|
@ -1169,7 +1165,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// namespace two {
|
// namespace two {
|
||||||
// using one::fx;
|
// using one::fx;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
// void test() {
|
// void test() {
|
||||||
// two::fx();
|
// two::fx();
|
||||||
|
@ -1181,7 +1177,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
getBindingFromASTName("fx(1);", 2, ICPPFunction.class);
|
getBindingFromASTName("fx(1);", 2, ICPPFunction.class);
|
||||||
getBindingFromASTName("fx(1,1);", 2, ICPPFunction.class);
|
getBindingFromASTName("fx(1,1);", 2, ICPPFunction.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// struct YetAnotherTest {
|
// struct YetAnotherTest {
|
||||||
// void test();
|
// void test();
|
||||||
// friend class InnerClass3;
|
// friend class InnerClass3;
|
||||||
|
@ -1201,10 +1197,10 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
public void testElaboratedTypeSpecifier_Bug303739() throws Exception {
|
public void testElaboratedTypeSpecifier_Bug303739() throws Exception {
|
||||||
getBindingFromASTName("member=0", -2, ICPPField.class);
|
getBindingFromASTName("member=0", -2, ICPPField.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// typedef int xxx::* MBR_PTR;
|
// typedef int xxx::* MBR_PTR;
|
||||||
|
|
||||||
// void test() {
|
// void test() {
|
||||||
// MBR_PTR x;
|
// MBR_PTR x;
|
||||||
// }
|
// }
|
||||||
public void testProblemInIndexBinding_Bug317146() throws Exception {
|
public void testProblemInIndexBinding_Bug317146() throws Exception {
|
||||||
|
@ -1248,8 +1244,8 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int,
|
// int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int,
|
||||||
// int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int,
|
// int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int,
|
||||||
// int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int);
|
// int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int);
|
||||||
|
|
||||||
// void test() {
|
// void test() {
|
||||||
// f255(
|
// f255(
|
||||||
// 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
// 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
// 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
// 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
@ -1272,11 +1268,11 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
public void testFunctionsWithManyParameters_Bug319186() throws Exception {
|
public void testFunctionsWithManyParameters_Bug319186() throws Exception {
|
||||||
getBindingFromASTName("f255", 0);
|
getBindingFromASTName("f255", 0);
|
||||||
getBindingFromASTName("f256", 0);
|
getBindingFromASTName("f256", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void f(char16_t x);
|
// void f(char16_t x);
|
||||||
// void f(char32_t x);
|
// void f(char32_t x);
|
||||||
|
|
||||||
// void test() {
|
// void test() {
|
||||||
// char16_t c16;
|
// char16_t c16;
|
||||||
// char32_t c32;
|
// char32_t c32;
|
||||||
|
@ -1285,11 +1281,11 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
public void testChar16_Bug319186() throws Exception {
|
public void testChar16_Bug319186() throws Exception {
|
||||||
IFunction f= getBindingFromASTName("f(c16)", 1);
|
IFunction f= getBindingFromASTName("f(c16)", 1);
|
||||||
assertEquals("char16_t", ASTTypeUtil.getType(f.getType().getParameterTypes()[0]));
|
assertEquals("char16_t", ASTTypeUtil.getType(f.getType().getParameterTypes()[0]));
|
||||||
|
|
||||||
f= getBindingFromASTName("f(c32)", 1);
|
f= getBindingFromASTName("f(c32)", 1);
|
||||||
assertEquals("char32_t", ASTTypeUtil.getType(f.getType().getParameterTypes()[0]));
|
assertEquals("char32_t", ASTTypeUtil.getType(f.getType().getParameterTypes()[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace ns {
|
// namespace ns {
|
||||||
// extern int* var;
|
// extern int* var;
|
||||||
// void fun();
|
// void fun();
|
||||||
|
@ -1298,7 +1294,7 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// using ns::var;
|
// using ns::var;
|
||||||
// using ns::fun;
|
// using ns::fun;
|
||||||
// using ns::Type;
|
// using ns::Type;
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
// using namespace ::ns;
|
// using namespace ::ns;
|
||||||
// void sabel() {
|
// void sabel() {
|
||||||
|
@ -1311,12 +1307,12 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
IFunction f= getBindingFromASTName("fun", 0);
|
IFunction f= getBindingFromASTName("fun", 0);
|
||||||
ITypedef t= getBindingFromASTName("Type", 0);
|
ITypedef t= getBindingFromASTName("Type", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// struct base {
|
// struct base {
|
||||||
// virtual void operator+(base const &) { }
|
// virtual void operator+(base const &) { }
|
||||||
// virtual void operator-(base const &) { }
|
// virtual void operator-(base const &) { }
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// #include "header.h"
|
// #include "header.h"
|
||||||
// struct inter : public base {
|
// struct inter : public base {
|
||||||
// virtual void operator+(base const &){}
|
// virtual void operator+(base const &){}
|
||||||
|
@ -1326,14 +1322,14 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// base *left, *right;
|
// base *left, *right;
|
||||||
//
|
//
|
||||||
// *left + *right;
|
// *left + *right;
|
||||||
// *left - *right;
|
// *left - *right;
|
||||||
// }
|
// }
|
||||||
// };
|
// };
|
||||||
public void test_Bug356982() throws Exception {
|
public void test_Bug356982() throws Exception {
|
||||||
IASTName name= findName("+ ", 1);
|
IASTName name= findName("+ ", 1);
|
||||||
assertTrue(name instanceof IASTImplicitName);
|
assertTrue(name instanceof IASTImplicitName);
|
||||||
assertEquals("base", name.resolveBinding().getOwner().getName());
|
assertEquals("base", name.resolveBinding().getOwner().getName());
|
||||||
|
|
||||||
name= findName("- ", 1);
|
name= findName("- ", 1);
|
||||||
assertTrue(name instanceof IASTImplicitName);
|
assertTrue(name instanceof IASTImplicitName);
|
||||||
assertEquals("base", name.resolveBinding().getOwner().getName());
|
assertEquals("base", name.resolveBinding().getOwner().getName());
|
||||||
|
|
Loading…
Add table
Reference in a new issue