summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2016-04-20 12:54:28 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2016-04-20 13:03:32 +0000
commit11836a14cf704eea7e24a462100ff5aa346cf7f1 (patch)
treec24769e1bedfb2570d9335b42f65caa3ab5f5788 /tests
parent474b8ec5c088555fc2d85bd577db98e1a936b7cc (diff)
downloadqt-creator-11836a14cf704eea7e24a462100ff5aa346cf7f1.tar.gz
Clang: Fix SOFT ASSERT: "!m_functionName.isEmpty()"
...that ocurred for e.g. "foo (<COMPLETE HERE>". We did not handle the following cases: 1) white space after the function name 2) nothing before parenthesis Change-Id: If6aedd2cc938df30516e13a860d07d7a509633ae Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/unittest/clangcompletioncontextanalyzertest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/unittest/clangcompletioncontextanalyzertest.cpp b/tests/unit/unittest/clangcompletioncontextanalyzertest.cpp
index f7046b00e2..ceff9440c2 100644
--- a/tests/unit/unittest/clangcompletioncontextanalyzertest.cpp
+++ b/tests/unit/unittest/clangcompletioncontextanalyzertest.cpp
@@ -258,6 +258,20 @@ TEST_F(ClangCompletionContextAnalyzer, ParameteTwoWithSpaceAtCall)
ASSERT_THAT(analyzer, HasResult(CCA::PassThroughToLibClangAfterLeftParen, -5, -3, positionInText));
}
+TEST_F(ClangCompletionContextAnalyzer, WhitespaceAfterFunctionName)
+{
+ auto analyzer = runAnalyzer("foo (@");
+
+ ASSERT_THAT(analyzer, HasResult(CCA::PassThroughToLibClangAfterLeftParen, -5, 0, positionInText));
+}
+
+TEST_F(ClangCompletionContextAnalyzer, AfterOpeningParenthesis)
+{
+ auto analyzer = runAnalyzer("(@");
+
+ ASSERT_THAT(analyzer, HasResult(CCA::PassThroughToLibClang, 0, 0, positionInText));
+}
+
TEST_F(ClangCompletionContextAnalyzer, ParameteOneAtSignal)
{
auto analyzer = runAnalyzer("SIGNAL(@");