mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
Additional testcase for binding resolution.
This commit is contained in:
parent
94bee24a59
commit
6943fa5a50
2 changed files with 63 additions and 17 deletions
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Andrew Ferguson (Symbian) - Initial implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.index.tests;
|
||||
|
||||
|
@ -348,4 +349,26 @@ public class IndexCBindingResolutionTest extends IndexBindingResolutionTestBase
|
|||
public void _testEnumeratorInStructScope() {fail("todo");}
|
||||
public void _testEnumeratorInUnionScope() {fail("todo");}
|
||||
public void _testMemberAccess() {fail("todo");}
|
||||
|
||||
// // header file
|
||||
// struct myStruct {
|
||||
// int a;
|
||||
// };
|
||||
// union myUnion {
|
||||
// int b;
|
||||
// };
|
||||
|
||||
// // referencing content
|
||||
// struct myStruct;
|
||||
// union myUnion;
|
||||
// void test() {
|
||||
// struct myStruct* u;
|
||||
// union myUnion* v;
|
||||
// u->a= 1; // since we include the definition, we may use the type.
|
||||
// v->b= 1; // since we include the definition, we may use the type.
|
||||
// }
|
||||
public void testTypeDefinitionWithFwdDeclaration() {
|
||||
getBindingFromASTName("a= 1", 1);
|
||||
getBindingFromASTName("b= 1", 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Andrew Ferguson (Symbian) - Initial implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.index.tests;
|
||||
|
||||
|
@ -1136,6 +1137,28 @@ public abstract class IndexCPPBindingResolutionTest extends IndexBindingResoluti
|
|||
assertEquals(1, getIndex().findNames(binding2, IIndex.FIND_DEFINITIONS).length);
|
||||
}
|
||||
|
||||
// // header file
|
||||
// struct myStruct {
|
||||
// int a;
|
||||
// };
|
||||
// union myUnion {
|
||||
// int b;
|
||||
// };
|
||||
|
||||
// // referencing content
|
||||
// struct myStruct;
|
||||
// union myUnion;
|
||||
// void test() {
|
||||
// struct myStruct* u;
|
||||
// union myUnion* v;
|
||||
// u->a= 1; // since we include the definition, we may use the type.
|
||||
// v->b= 1; // since we include the definition, we may use the type.
|
||||
// }
|
||||
public void testTypeDefinitionWithFwdDeclaration() {
|
||||
getBindingFromASTName("a= 1", 1);
|
||||
getBindingFromASTName("b= 1", 1);
|
||||
}
|
||||
|
||||
/* CPP assertion helpers */
|
||||
/* ##################################################################### */
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue