Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java17
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java28
2 files changed, 42 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java
index 19bf1599cdf..8be5291ac3f 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java
@@ -6,9 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * QNX - Initial API and implementation
- * Markus Schorn (Wind River Systems)
- * IBM Corporation
+ * QNX - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * IBM Corporation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
@@ -232,4 +233,14 @@ public class ClassTests extends PDOMTestBase {
assertTrue(bindings[0] instanceof ICPPClassType);
return (ICPPClassType) bindings[0];
}
+
+ public void testFinalClass() throws Exception {
+ char[][] name = {"E".toCharArray()};
+ IBinding[] bindings = pdom.findBindings(name, IndexFilter.ALL, npm());
+ assertEquals(1, bindings.length);
+ assertInstance(bindings[0], ICPPClassType.class);
+ ICPPClassType classBinding = (ICPPClassType) bindings[0];
+
+ assertTrue(classBinding.isFinal());
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java
index 088fc7b816a..e47de9c7eaa 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.pdom.tests;
@@ -302,4 +303,31 @@ public class MethodTests extends PDOMTestBase {
assertEquals(IBasicType.t_int, Math.min(t1, t2));
assertEquals(IBasicType.t_double, Math.max(t1, t2));
}
+
+ public void testVirtualMemberFunction() throws Exception {
+ IBinding[] bindings = findQualifiedName(pdom, "E::virtualMemberFunction");
+ assertEquals(1, bindings.length);
+ assertInstance(bindings[0], ICPPMethod.class);
+ ICPPMethod virtMemFun = (ICPPMethod) bindings[0];
+ assertFalse(virtMemFun.isOverride());
+ assertFalse(virtMemFun.isFinal());
+ }
+
+ public void testOverrideVirtualMemberFunction() throws Exception {
+ IBinding[] bindings = findQualifiedName(pdom, "F::virtualMemberFunction");
+ assertEquals(1, bindings.length);
+ assertInstance(bindings[0], ICPPMethod.class);
+ ICPPMethod virtMemFun = (ICPPMethod) bindings[0];
+ assertTrue(virtMemFun.isOverride());
+ assertFalse(virtMemFun.isFinal());
+ }
+
+ public void testOverrideFinalVirtualMemberFunction() throws Exception {
+ IBinding[] bindings = findQualifiedName(pdom, "G::virtualMemberFunction");
+ assertEquals(1, bindings.length);
+ assertInstance(bindings[0], ICPPMethod.class);
+ ICPPMethod virtMemFun = (ICPPMethod) bindings[0];
+ assertTrue(virtMemFun.isOverride());
+ assertTrue(virtMemFun.isFinal());
+ }
}

Back to the top