C++: Let "Add Definition" quick fix work with free function declarations

It was restricted to member functions declarations, but works well with
free functions, too.

Change-Id: I8513e67e426185e7e08aebc2f1b5bfd08f79887f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-02-20 16:36:29 +01:00
parent 77a66c2639
commit 06b5f62a61
3 changed files with 19 additions and 3 deletions

View File

@@ -882,3 +882,20 @@ void CppPlugin::test_quickfix_InsertDefFromDecl_headerSource_namespace2()
TestCase data(testFiles);
data.run(&factory);
}
void CppPlugin::test_quickfix_InsertDefFromDecl_freeFunction()
{
const QByteArray original = "void free()@;\n";
const QByteArray expected = original +
"\n"
"\n"
"void free()\n"
"{\n"
"}\n"
"\n"
;
InsertDefFromDecl factory;
TestCase data(original, expected);
data.run(&factory);
}