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.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index da0ef9fa3e..7b78ac901a 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -303,6 +303,7 @@ void CppToolsPlugin::test_completion()
actualCompletions.sort();
expectedCompletions.sort();
+ QEXPECT_FAIL("enum_in_function_in_struct_in_function", "doesn't work", Abort);
QCOMPARE(actualCompletions, expectedCompletions);
}
@@ -1678,6 +1679,44 @@ void CppToolsPlugin::test_completion_data()
<< QLatin1String("e2")
<< QLatin1String("e3"));
+ QTest::newRow("enum_inside_function") << _(
+ "void foo()\n"
+ "{\n"
+ " enum E { val1, val2, val3 };\n"
+ " @\n"
+ "}\n"
+ ) << _("val") << (QStringList()
+ << QLatin1String("val1")
+ << QLatin1String("val2")
+ << QLatin1String("val3"));
+
+ QTest::newRow("anon_enum_inside_function") << _(
+ "void foo()\n"
+ "{\n"
+ " enum { val1, val2, val3 };\n"
+ " @\n"
+ "}\n"
+ ) << _("val") << (QStringList()
+ << QLatin1String("val1")
+ << QLatin1String("val2")
+ << QLatin1String("val3"));
+
+ QTest::newRow("enum_in_function_in_struct_in_function") << _(
+ "void foo()\n"
+ "{\n"
+ " struct S {\n"
+ " void fun()\n"
+ " {\n"
+ " enum E { val1, val2, val3 };\n"
+ " @\n"
+ " }\n"
+ " };\n"
+ "}\n"
+ ) << _("val") << (QStringList()
+ << QLatin1String("val1")
+ << QLatin1String("val2")
+ << QLatin1String("val3"));
+
QTest::newRow("enum_inside_function_cxx11_QTCREATORBUG5456") << _(
"void foo()\n"
"{\n"