summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java28
1 files changed, 28 insertions, 0 deletions
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 088fc7b..e47de9c 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());
+ }
}