Skip to content
Snippets Groups Projects
Commit e20391ef authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

CppEditor: Add failing tests for virtual destructor lookup


Change-Id: I2fdf1c72b3e5ffe25b5184c1161a803c4427945b
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent 49b9cc98
No related branches found
No related tags found
No related merge requests found
...@@ -387,6 +387,9 @@ void CppEditorPlugin::test_functionhelper_virtualFunctions() ...@@ -387,6 +387,9 @@ void CppEditorPlugin::test_functionhelper_virtualFunctions()
else else
QCOMPARE(virtuality, Virtual); QCOMPARE(virtuality, Virtual);
} else { } 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); QCOMPARE(virtuality, NotVirtual);
} }
if (firstVirtualIndex == -1) if (firstVirtualIndex == -1)
...@@ -464,6 +467,19 @@ void CppEditorPlugin::test_functionhelper_virtualFunctions_data() ...@@ -464,6 +467,19 @@ void CppEditorPlugin::test_functionhelper_virtualFunctions_data()
<< _("struct Base { Base() {} virtual ~Base() {} };\n") << _("struct Base { Base() {} virtual ~Base() {} };\n")
<< (VirtualityList() << NotVirtual << Virtual) << (VirtualityList() << NotVirtual << Virtual)
<< (QList<int>() << -1 << 1); << (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 } // namespace Internal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment