Commit e20391ef authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

CppEditor: Add failing tests for virtual destructor lookup

Change-Id: I2fdf1c72b3e5ffe25b5184c1161a803c4427945b
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent 49b9cc98
......@@ -387,6 +387,9 @@ void CppEditorPlugin::test_functionhelper_virtualFunctions()
else
QCOMPARE(virtuality, Virtual);
} else {
QEXPECT_FAIL("virtual-dtor-dtor", "Not implemented", Abort);
if (allFunctions.size() == 3)
QEXPECT_FAIL("dtor-virtual-dtor-dtor", "Not implemented", Abort);
QCOMPARE(virtuality, NotVirtual);
}
if (firstVirtualIndex == -1)
......@@ -464,6 +467,19 @@ void CppEditorPlugin::test_functionhelper_virtualFunctions_data()
<< _("struct Base { Base() {} virtual ~Base() {} };\n")
<< (VirtualityList() << NotVirtual << Virtual)
<< (QList<int>() << -1 << 1);
QTest::newRow("virtual-dtor-dtor")
<< _("struct Base { virtual ~Base() {} };\n"
"struct Derived : Base { ~Derived() {} };\n")
<< (VirtualityList() << Virtual << Virtual)
<< (QList<int>() << 0 << 0);
QTest::newRow("dtor-virtual-dtor-dtor")
<< _("struct Base { ~Base() {} };\n"
"struct Derived : Base { virtual ~Derived() {} };\n"
"struct Derived2 : Derived { ~Derived2() {} };\n")
<< (VirtualityList() << NotVirtual << Virtual << Virtual)
<< (QList<int>() << -1 << 1 << 1);
}
} // namespace Internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment