summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-04-11 18:27:52 +0200
committerEike Ziller <eike.ziller@digia.com>2013-04-11 18:27:52 +0200
commit9ff8979da32642e60029cb7cf8536eed6442c270 (patch)
tree4c1bb2288209c4c9b65408d7ec104747b278cd43 /src/plugins/cpptools/cppcompletion_test.cpp
parente6eb061293a63bf52fb34dc39016d0fa8bbbe12b (diff)
parent567098f210a7f73b98f02132a545bd5b5420e5a4 (diff)
downloadqt-creator-9ff8979da32642e60029cb7cf8536eed6442c270.tar.gz
Merge remote-tracking branch 'origin/2.7'
Conflicts: src/plugins/cpptools/cppchecksymbols.h src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp Change-Id: I887ba071fa637ad44e39bcae581738fa078a6612
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index 657b6397aa..0af9130e96 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -1796,3 +1796,50 @@ void CppToolsPlugin::test_completion_typedef_using_templates2()
QVERIFY(completions.contains(QLatin1String("Foo")));
QVERIFY(completions.contains(QLatin1String("bar")));
}
+
+void CppToolsPlugin::test_completion_namespace_alias_with_many_namespace_declarations()
+{
+ TestData data;
+ data.srcText =
+ "namespace NS1\n"
+ "{\n"
+ "namespace NS2\n"
+ "{\n"
+ "struct Foo1\n"
+ "{\n"
+ " int bar1;\n"
+ "};\n"
+ "}\n"
+ "}\n"
+ "namespace NS1\n"
+ "{\n"
+ "namespace NS2\n"
+ "{\n"
+ "struct Foo2\n"
+ "{\n"
+ " int bar2;\n"
+ "};\n"
+ "}\n"
+ "}\n"
+ "namespace NS = NS1::NS2;\n"
+ "int main()\n"
+ "{\n"
+ " @\n"
+ " // padding so we get the scope right\n"
+ "}\n"
+ ;
+ setup(&data);
+
+ Utils::ChangeSet change;
+ QString txt = QLatin1String("NS::");
+ change.insert(data.pos, txt);
+ QTextCursor cursor(data.doc);
+ change.apply(&cursor);
+ data.pos += txt.length();
+
+ QStringList completions = getCompletions(data);
+
+ QCOMPARE(completions.size(), 2);
+ QVERIFY(completions.contains(QLatin1String("Foo1")));
+ QVERIFY(completions.contains(QLatin1String("Foo2")));
+}