summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-12-28 21:48:41 +0200
committerOrgad Shaneh <orgads@gmail.com>2014-01-24 11:34:50 +0100
commitfbecf2f3fd4f81e751a63c16121b5e4dd796c08a (patch)
tree10907ab6c684aa31b2d0ce9733a16d3d40d30465 /src/plugins/cpptools/cppcompletion_test.cpp
parent94266398bef54d7f9d110d5f2cc1522bb6601305 (diff)
downloadqt-creator-fbecf2f3fd4f81e751a63c16121b5e4dd796c08a.tar.gz
CppTools: Add tests for nested enums
Discarded during merge from 3.0 Task-number: QTCREATORBUG-5456 Change-Id: I0bb4756e3cdf3c87a4c2b0fbfe6953faaa5e1c52 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
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"