1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-08-20 20:20:41 -07:00
parent 9ba2f49c40
commit 30ed2ca8c9

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
* Andrew Ferguson (Symbian) * Andrew Ferguson (Symbian)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.index.tests; package org.eclipse.cdt.internal.index.tests;
@ -35,12 +35,12 @@ import org.eclipse.cdt.core.index.IIndexBinding;
public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase { public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase {
public static class SingleProject extends IndexCBindingResolutionBugs { public static class SingleProject extends IndexCBindingResolutionBugs {
public SingleProject() {setStrategy(new SinglePDOMTestStrategy(false));} public SingleProject() { setStrategy(new SinglePDOMTestStrategy(false)); }
public static TestSuite suite() {return suite(SingleProject.class);} public static TestSuite suite() { return suite(SingleProject.class); }
} }
public static class ProjectWithDepProj extends IndexCBindingResolutionBugs { public static class ProjectWithDepProj extends IndexCBindingResolutionBugs {
public ProjectWithDepProj() {setStrategy(new ReferencedProject(false));} public ProjectWithDepProj() { setStrategy(new ReferencedProject(false)); }
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) {
@ -48,24 +48,18 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
suite.addTest(ProjectWithDepProj.suite()); suite.addTest(ProjectWithDepProj.suite());
} }
// #include <stdio.h> // #include <stdio.h>
// void func1(void) // void func1(void) {
// {
// int i = 0; // int i = 0;
// for (i=0; i<10;i++) // for (i=0; i<10;i++) {
// {
// printf("%i", i); // printf("%i", i);
// } // }
//
// } // }
// #include "header.h" // #include "header.h"
// //
// int main(void) // int main(void) {
// { // while (1) {
// while (1)
// {
// func1(); // func1();
// } // }
// return 0; // return 0;
@ -86,8 +80,7 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
// #include "header.h" // #include "header.h"
// //
// int main(void) // int main(void) {
// {
// void* v= func1; // void* v= func1;
// } // }
public void testBug181735() throws DOMException { public void testBug181735() throws DOMException {
@ -151,7 +144,7 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
IVariable v= (IVariable) b0; IVariable v= (IVariable) b0;
IType type= v.getType(); IType type= v.getType();
assertTrue(type instanceof IBasicType); assertTrue(type instanceof IBasicType);
assertTrue(((IBasicType) type).getType() == IBasicType.t_char); assertTrue(((IBasicType) type).getKind() == IBasicType.Kind.eChar);
} }
// int globalFunc(); // int globalFunc();
@ -165,7 +158,7 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
IFunction f= (IFunction) b0; IFunction f= (IFunction) b0;
IType type= f.getType().getReturnType(); IType type= f.getType().getReturnType();
assertTrue(type instanceof IBasicType); assertTrue(type instanceof IBasicType);
assertTrue(((IBasicType) type).getType() == IBasicType.t_char); assertTrue(((IBasicType) type).getKind() == IBasicType.Kind.eChar);
} }
// struct astruct { // struct astruct {
@ -193,7 +186,7 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
assertEquals("additionalMember", additionalMember.getName()); assertEquals("additionalMember", additionalMember.getName());
IType type= member.getType(); IType type= member.getType();
assertTrue(type instanceof IBasicType); assertTrue(type instanceof IBasicType);
assertTrue(((IBasicType) type).getType() == IBasicType.t_char); assertTrue(((IBasicType) type).getKind() == IBasicType.Kind.eChar);
} }
// enum anenum { // enum anenum {
@ -224,7 +217,7 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
ITypedef t= (ITypedef) b0; ITypedef t= (ITypedef) b0;
IType type= t.getType(); IType type= t.getType();
assertTrue(type instanceof IBasicType); assertTrue(type instanceof IBasicType);
assertTrue(((IBasicType) type).getType() == IBasicType.t_char); assertTrue(((IBasicType) type).getKind() == IBasicType.Kind.eChar);
} }
// struct st_20070703 { // struct st_20070703 {
@ -395,7 +388,7 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
IParameter[] params= f.getParameters(); IParameter[] params= f.getParameters();
assertEquals(1, params.length); assertEquals(1, params.length);
assertTrue(params[0].getType() instanceof IBasicType); assertTrue(params[0].getType() instanceof IBasicType);
assertEquals(IBasicType.t_int, ((IBasicType)params[0].getType()).getType()); assertEquals(IBasicType.Kind.eInt, ((IBasicType) params[0].getType()).getKind());
} }
// typedef struct S S; // typedef struct S S;