diff options
| author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2014-11-11 10:44:06 +0100 |
|---|---|---|
| committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2014-11-11 11:50:46 +0100 |
| commit | cefd1832ce8cdc294ab4005ecfa31c1ffd9fb82a (patch) | |
| tree | 5df5959c2b2b1e94bdf06a56e86381a89dc6e949 /tests | |
| parent | 682a348b7bc22f9ada992ea5bd6495836d834cd5 (diff) | |
| download | qt-creator-cefd1832ce8cdc294ab4005ecfa31c1ffd9fb82a.tar.gz | |
C++: Include class name for inline functions in functionAt
The code that constructed the fully qualified name used
enclosingNamespace() which skips classes.
Use LookupContext::fullyQualifiedName() instead.
Change-Id: Ic03a91c0fe120c52dc69f3e78e82a574458d8314
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/auto/cplusplus/lookup/tst_lookup.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/auto/cplusplus/lookup/tst_lookup.cpp b/tests/auto/cplusplus/lookup/tst_lookup.cpp index 10275002a3..9dd5c81d53 100644 --- a/tests/auto/cplusplus/lookup/tst_lookup.cpp +++ b/tests/auto/cplusplus/lookup/tst_lookup.cpp @@ -164,20 +164,33 @@ void tst_Lookup::document_functionAt_data() QTest::addColumn<int>("column"); QTest::addColumn<QString>("expectedFunction"); - const QByteArray source = "\n" + QByteArray source = "\n" "void Foo::Bar() {\n" // line 1 - " \n" // line 2 - " for (int i=0; i < 10; ++i) {\n" - " \n" // line 4 - " }\n" - "}\n"; // line 7 - const QString expectedFunction = QString::fromLatin1("Foo::Bar"); + " \n" + " for (int i=0; i < 10; ++i) {\n" // line 3 + " \n" + " }\n" // line 5 + "}\n"; + QString expectedFunction = QString::fromLatin1("Foo::Bar"); QTest::newRow("nonInline1") << source << 1 << 2 << QString(); QTest::newRow("nonInline2") << source << 1 << 11 << expectedFunction; QTest::newRow("nonInline3") << source << 2 << 2 << expectedFunction; QTest::newRow("nonInline4") << source << 3 << 10 << expectedFunction; QTest::newRow("nonInline5") << source << 4 << 3 << expectedFunction; QTest::newRow("nonInline6") << source << 6 << 1 << expectedFunction; + + source = "\n" + "namespace N {\n" // line 1 + "class C {\n" + " void f()\n" // line 3 + " {\n" + " }\n" // line 5 + "};\n" + "}\n"; // line 7 + expectedFunction = QString::fromLatin1("N::C::f"); + QTest::newRow("inline1") << source << 1 << 2 << QString(); + QTest::newRow("inline2") << source << 2 << 10 << QString(); + QTest::newRow("inline2") << source << 3 << 10 << expectedFunction; } void tst_Lookup::document_functionAt() |
