Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2006-11-08 09:42:22 +0000
committerMarkus Schorn2006-11-08 09:42:22 +0000
commite6a0b48500f595791d2089057a43426d08efd3d5 (patch)
tree74c57ff45bde1eb195d49116ec638606c30be304 /core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinCommonHeaderTests.java
parent4c73232e1ce6b1d2e461b22bb13c3bf53f84e124 (diff)
downloadorg.eclipse.cdt-e6a0b48500f595791d2089057a43426d08efd3d5.tar.gz
org.eclipse.cdt-e6a0b48500f595791d2089057a43426d08efd3d5.tar.xz
org.eclipse.cdt-e6a0b48500f595791d2089057a43426d08efd3d5.zip
Patch for 162581, by Andrew Ferguson, stack overflow in AST/PDOM.
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinCommonHeaderTests.java')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinCommonHeaderTests.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinCommonHeaderTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinCommonHeaderTests.java
index 415bd437954..550488335f2 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinCommonHeaderTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinCommonHeaderTests.java
@@ -75,7 +75,7 @@ public class OverloadsWithinCommonHeaderTests extends PDOMTestBase {
public void testOverloadedInCommonHeader_FileScope() throws CoreException {
Pattern[] QuuxPath = makePatternArray(new String[] {"quux"});
- IBinding[] Quux = pdom.findBindings(QuuxPath, false, IndexFilter.getFilter(Linkage.CPP_LINKAGE), new NullProgressMonitor());
+ IBinding[] Quux = pdom.findBindings(QuuxPath, true, IndexFilter.getFilter(Linkage.CPP_LINKAGE), new NullProgressMonitor());
assertEquals(5,Quux.length);
@@ -112,10 +112,31 @@ public class OverloadsWithinCommonHeaderTests extends PDOMTestBase {
// corge::grault(ManyOverloaded*)
assertFunctionRefCount(new Class[] {IPointerType.class}, Grault, 12);
- // (corge::grault(ManyOverloaded)
+ // corge::grault(ManyOverloaded)
assertFunctionRefCount(new Class[] {ICPPClassType.class}, Grault, 14);
}
+ public void testOverloadedInCommonHeader_NamespaceScope_Collides_With_Filescope() throws CoreException {
+ Pattern[] ns2Path = makePatternArray(new String[] {"ns2","quux"});
+ IBinding[] ns2 = pdom.findBindings(ns2Path, true, IndexFilter.getFilter(Linkage.CPP_LINKAGE), new NullProgressMonitor());
+ assertEquals(5,ns2.length);
+
+ // ns2::quux()
+ assertFunctionRefCount(new Class[0], ns2, 16);
+
+ // ns2::quux(int,char)
+ assertFunctionRefCount(new Class[] {IBasicType.class}, ns2, 20);
+
+ // ns2::quux(int,char)
+ assertFunctionRefCount(new Class[] {IBasicType.class, IBasicType.class}, ns2, 24);
+
+ // ns2::quux(ManyOverloaded*)
+ assertFunctionRefCount(new Class[] {IPointerType.class}, ns2, 28);
+
+ // ns2::quux(ManyOverloaded)
+ assertFunctionRefCount(new Class[] {ICPPClassType.class}, ns2, 32);
+ }
+
protected void assertFunctionRefCount(Class[] args, IBinding[] bindingPool, int refCount) throws CoreException {
assertFunctionRefCount(pdom, args, bindingPool, refCount);
}

Back to the top