summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r--src/plugins/cpptools/cppcompletion_test.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index 856f96d004..3eed35b507 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -2070,6 +2070,55 @@ void CppToolsPlugin::test_completion_recursive_using_typedef_declarations()
QCOMPARE(completions.size(), 0);
}
+void CppToolsPlugin::test_completion_recursive_typedefs_in_templates1()
+{
+ const QByteArray source =
+ "template<typename From>\n"
+ "struct simplify_type {\n"
+ " typedef From SimpleType;\n"
+ "};\n"
+ "\n"
+ "template<class To, class From>\n"
+ "struct cast_retty {\n"
+ " typedef typename cast_retty_wrap<To, From,\n"
+ " typename simplify_type<From>::SimpleType>::ret_type ret_type;\n"
+ "};\n"
+ "\n"
+ "template<class To, class From, class SimpleFrom>\n"
+ "struct cast_retty_wrap {\n"
+ " typedef typename cast_retty<To, SimpleFrom>::ret_type ret_type;\n"
+ "};\n"
+ "\n"
+ "void f()\n"
+ "{\n"
+ " @;\n"
+ "}\n"
+ ;
+ CompletionTestCase test(source, "cast_retty<T1, T2>::ret_type.");
+
+ const QStringList completions = test.getCompletions();
+ QCOMPARE(completions.size(), 0);
+}
+
+void CppToolsPlugin::test_completion_recursive_typedefs_in_templates2()
+{
+ const QByteArray source =
+ "template<class T>\n"
+ "struct recursive {\n"
+ " typedef typename recursive<T>::ret_type ret_type;\n"
+ "};\n"
+ "\n"
+ "void f()\n"
+ "{\n"
+ " @;\n"
+ "}\n"
+ ;
+ CompletionTestCase test(source, "recursive<T1>::ret_type.foo");
+
+ const QStringList completions = test.getCompletions();
+ QCOMPARE(completions.size(), 0);
+}
+
void CppToolsPlugin::test_completion_prefix_first_QTCREATORBUG_8737()
{
const QByteArray source =
@@ -2740,55 +2789,6 @@ void CppToolsPlugin::test_completion_template_parameter_defined_inside_scope_of_
QVERIFY(completions.contains(QLatin1String("bar")));
}
-void CppToolsPlugin::test_completion_recursive_typedefs_in_templates1()
-{
- const QByteArray source =
- "template<typename From>\n"
- "struct simplify_type {\n"
- " typedef From SimpleType;\n"
- "};\n"
- "\n"
- "template<class To, class From>\n"
- "struct cast_retty {\n"
- " typedef typename cast_retty_wrap<To, From,\n"
- " typename simplify_type<From>::SimpleType>::ret_type ret_type;\n"
- "};\n"
- "\n"
- "template<class To, class From, class SimpleFrom>\n"
- "struct cast_retty_wrap {\n"
- " typedef typename cast_retty<To, SimpleFrom>::ret_type ret_type;\n"
- "};\n"
- "\n"
- "void f()\n"
- "{\n"
- " @;\n"
- "}\n"
- ;
- CompletionTestCase test(source, "cast_retty<T1, T2>::ret_type.");
-
- const QStringList completions = test.getCompletions();
- QCOMPARE(completions.size(), 0);
-}
-
-void CppToolsPlugin::test_completion_recursive_typedefs_in_templates2()
-{
- const QByteArray source =
- "template<class T>\n"
- "struct recursive {\n"
- " typedef typename recursive<To>::ret_type ret_type;\n"
- "};\n"
- "\n"
- "void f()\n"
- "{\n"
- " @;\n"
- "}\n"
- ;
- CompletionTestCase test(source, "recursive<T1>::ret_type.foo");
-
- const QStringList completions = test.getCompletions();
- QCOMPARE(completions.size(), 0);
-}
-
void CppToolsPlugin::test_completion_signals_hide_QPrivateSignal()
{
const QByteArray source =