Commit d08af150 authored by Przemyslaw Gorszkowski's avatar Przemyslaw Gorszkowski Committed by hjk
Browse files

C++: unit test for code completion

Added unit test for code completion when pointer's type is a typedef

Change-Id: I408be8d9364a4b48824238dcc44175167ae653f4
Reviewed-by: default avatarhjk <>
parent 45cd2d1e
......@@ -533,6 +533,34 @@ void CppToolsPlugin::test_completion_template_7()
void CppToolsPlugin::test_completion_type_of_pointer_is_typedef()
TestData data;
data.srcText = "\n"
"typedef struct Foo\n"
" int foo;\n"
"} Foo;\n"
"Foo *bar;\n"
Utils::ChangeSet change;
QString txt = QLatin1String("bar->");
change.insert(data.pos, txt);
QTextCursor cursor(data.doc);
data.pos += txt.length();
QStringList completions = getCompletions(data);
QCOMPARE(completions.size(), 2);
void CppToolsPlugin::test_completion()
QFETCH(QByteArray, code);
......@@ -100,6 +100,7 @@ private slots:
void test_completion_template_5();
void test_completion_template_6();
void test_completion_template_7();
void test_completion_type_of_pointer_is_typedef();
void test_completion_template_as_base();
void test_completion_template_as_base_data();
void test_completion_use_global_identifier_as_base_class();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment