forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.8'
Conflicts: src/plugins/cpptools/cppcompletion_test.cpp src/plugins/cpptools/cpptoolsplugin.h src/plugins/projectexplorer/customtoolchain.cpp src/plugins/vcsbase/command.cpp Change-Id: Ie7b3c9e136c0748b41320227c757471259339b48
This commit is contained in:
@@ -1161,6 +1161,63 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_findRightImplementationFil
|
||||
data.run(&factory);
|
||||
}
|
||||
|
||||
/// Ignore generated functions declarations when looking at the surrounding
|
||||
/// functions declarations in order to find the right implementation file.
|
||||
void CppEditorPlugin::test_quickfix_InsertDefFromDecl_ignoreSurroundingGeneratedDeclarations()
|
||||
{
|
||||
QList<TestDocumentPtr> testFiles;
|
||||
|
||||
QByteArray original;
|
||||
QByteArray expected;
|
||||
|
||||
// Header File
|
||||
original =
|
||||
"#define DECLARE_HIDDEN_FUNCTION void hidden();\n"
|
||||
"struct Foo\n"
|
||||
"{\n"
|
||||
" void a();\n"
|
||||
" DECLARE_HIDDEN_FUNCTION\n"
|
||||
" void b@();\n"
|
||||
"};\n"
|
||||
"}\n";
|
||||
expected = original + '\n';
|
||||
testFiles << TestDocument::create(original, expected, QLatin1String("file.h"));
|
||||
|
||||
// Source File #1
|
||||
original =
|
||||
"#include \"file.h\"\n"
|
||||
"\n"
|
||||
"void Foo::a()\n"
|
||||
"{\n\n"
|
||||
"}\n";
|
||||
expected =
|
||||
"#include \"file.h\"\n"
|
||||
"\n"
|
||||
"void Foo::a()\n"
|
||||
"{\n\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"void Foo::b()\n"
|
||||
"{\n\n"
|
||||
"}\n"
|
||||
"\n";
|
||||
testFiles << TestDocument::create(original, expected, QLatin1String("file.cpp"));
|
||||
|
||||
// Source File #2
|
||||
original =
|
||||
"#include \"file.h\"\n"
|
||||
"\n"
|
||||
"void Foo::hidden()\n"
|
||||
"{\n\n"
|
||||
"}\n";
|
||||
expected = original + '\n';
|
||||
testFiles << TestDocument::create(original, expected, QLatin1String("file2.cpp"));
|
||||
|
||||
InsertDefFromDecl factory;
|
||||
TestCase data(testFiles);
|
||||
data.run(&factory);
|
||||
}
|
||||
|
||||
/// Check if whitespace is respected for operator functions
|
||||
void CppEditorPlugin::test_quickfix_InsertDefFromDecl_respectWsInOperatorNames1()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user