Commit 6e23885e authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

CppEditor: Add a failing test for virtual overrides



When function has a different return type

Change-Id: I1178e7e2c6b7e074a3737aaef597ebeff8d776dc
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent f78e981c
......@@ -458,6 +458,7 @@ void TestCase::run()
expectedImmediate << OverrideItem(QLatin1String("...searching overrides"));
}
QCOMPARE(immediateVirtualSymbolResults, expectedImmediate);
QEXPECT_FAIL("differentReturnTypes", "Doesn't work", Abort);
QCOMPARE(finalVirtualSymbolResults, m_expectedVirtualFunctionProposal);
}
......@@ -1304,6 +1305,14 @@ void CppEditorPlugin::test_FollowSymbolUnderCursor_virtualFunctionCall_data()
"\n"
"void client(B b) { b.@virt(); }\n")
<< OverrideItemList();
QTest::newRow("differentReturnTypes") << _(
"struct Base { virtual Base *virt() { return this; } };\n"
"struct Derived : public Base { Derived *virt() { return this; } };\n"
"void client(Base *b) { b->$@virt(); }\n")
<< (OverrideItemList()
<< OverrideItem(QLatin1String("Base::virt"), 1)
<< OverrideItem(QLatin1String("Derived::virt"), 2));
}
void CppEditorPlugin::test_FollowSymbolUnderCursor_virtualFunctionCall()
......
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