summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>2013-05-16 10:15:02 +0200
committerErik Verbruggen <erik.verbruggen@digia.com>2013-05-24 14:23:14 +0200
commitf93758b8e1d68ed28dc1a84b71c906d58784cb70 (patch)
tree89850b9c04008a24d010e09bd489a8c8a276b3f5 /tests
parentfeff33827cbe54a39863ef7a5a1e954556ed4302 (diff)
downloadqt-creator-f93758b8e1d68ed28dc1a84b71c906d58784cb70.tar.gz
C++: fix used template function parameters
It was missing colorizing and follow symbol template function parameters in case of: * returning value * use it as qualified name Task-number: QTCREATORBUG-6861 Change-Id: I4226199e1f296cfe5a373783ebbc633e32fc9bcd Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp
index 7924cfbbb1..ba889c0ee7 100644
--- a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp
+++ b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp
@@ -195,6 +195,7 @@ private slots:
void test_checksymbols_highlightingTypeWhenUsingNamespaceClass_QTCREATORBUG7903_namespace();
void test_checksymbols_highlightingTypeWhenUsingNamespaceClass_QTCREATORBUG7903_insideFunction();
void test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORBUG9323_globalNamespace();
+ void test_checksymbols_highlightingUsedTemplateFunctionParameter_QTCREATORBUG6861();
void test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORBUG9323_namespace();
void test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORBUG9323_insideFunction();
};
@@ -1702,6 +1703,7 @@ void tst_CheckSymbols::test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORB
TestData::check(source, expectedUses);
}
+
void tst_CheckSymbols::test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORBUG9323_insideFunction()
{
const QByteArray source =
@@ -1725,5 +1727,30 @@ void tst_CheckSymbols::test_checksymbols_crashWhenUsingNamespaceClass_QTCREATORB
TestData::check(source, expectedUses);
}
+void tst_CheckSymbols::test_checksymbols_highlightingUsedTemplateFunctionParameter_QTCREATORBUG6861()
+{
+ const QByteArray source =
+ "template<class TEMP>\n"
+ "TEMP \n"
+ "foo(TEMP in)\n"
+ "{\n"
+ " typename TEMP::type type;\n"
+ "}\n"
+ ;
+
+ const QList<Use> expectedUses = QList<Use>()
+ << Use(1, 16, 4, CppHighlightingSupport::TypeUse)
+ << Use(2, 1, 4, CppHighlightingSupport::TypeUse)
+ << Use(3, 1, 3, CppHighlightingSupport::FunctionUse)
+ << Use(3, 5, 4, CppHighlightingSupport::TypeUse)
+ << Use(3, 10, 2, CppHighlightingSupport::LocalUse)
+ << Use(5, 14, 4, CppHighlightingSupport::TypeUse)
+ << Use(5, 20, 4, CppHighlightingSupport::TypeUse)
+ << Use(5, 25, 4, CppHighlightingSupport::LocalUse)
+ ;
+
+ TestData::check(source, expectedUses);
+}
+
QTEST_APPLESS_MAIN(tst_CheckSymbols)
#include "tst_checksymbols.moc"