mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 14:25:37 +02:00
Added another failing test.
This commit is contained in:
parent
dacfc2d9b7
commit
6f7c1b7904
1 changed files with 30 additions and 0 deletions
|
@ -14,6 +14,7 @@ import junit.framework.TestSuite;
|
|||
|
||||
import org.eclipse.cdt.core.dom.ast.IFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable;
|
||||
|
||||
/**
|
||||
* Tests for header files included in multiple variants.
|
||||
|
@ -102,4 +103,33 @@ public class IndexMultiVariantHeaderTest extends IndexBindingResolutionTestBase
|
|||
getBindingFromASTName("f1(NULL)", 2, ICPPFunction.class);
|
||||
getBindingFromASTName("f2(NULL, 1)", 2, ICPPFunction.class);
|
||||
}
|
||||
|
||||
// a.h
|
||||
// external int X;
|
||||
|
||||
// b.h
|
||||
// #define X y
|
||||
// #include "a.h"
|
||||
// #undef X
|
||||
// #define X z
|
||||
// #include "a.h"
|
||||
|
||||
// a.cpp *
|
||||
// #define X x
|
||||
// #include "a.h"
|
||||
// static void test() {
|
||||
// x = 0;
|
||||
// }
|
||||
|
||||
// b.cpp *
|
||||
// #include "b.h"
|
||||
// static void test() {
|
||||
// y = 0;
|
||||
// z = 0;
|
||||
// }
|
||||
public void testSignificantMacroDetection() throws Exception {
|
||||
getBindingFromASTName("x = 0", 1, ICPPVariable.class);
|
||||
getBindingFromASTName("y = 0", 1, ICPPVariable.class);
|
||||
getBindingFromASTName("z = 0", 1, ICPPVariable.class);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue