forked from qt-creator/qt-creator
CplusPlus: Fix minimal name construction
... when using declarations are involved. Fixes: QTCREATORBUG-14524 Change-Id: I0c391b88628f40973b6f601e60c64263f62a88a0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -155,6 +155,7 @@ private slots:
|
||||
void test_quickfix_InsertDefFromDecl_erroneousStatementAtEndOfFile();
|
||||
void test_quickfix_InsertDefFromDecl_rvalueReference();
|
||||
void test_quickfix_InsertDefFromDecl_functionTryBlock();
|
||||
void test_quickfix_InsertDefFromDecl_usingDecl();
|
||||
void test_quickfix_InsertDefFromDecl_findImplementationFile();
|
||||
void test_quickfix_InsertDefFromDecl_unicodeIdentifier();
|
||||
void test_quickfix_InsertDefFromDecl_templateClass();
|
||||
|
||||
@@ -4322,6 +4322,41 @@ void Foo::otherFunc()
|
||||
QuickFixOperationTest(testDocuments, &factory);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::test_quickfix_InsertDefFromDecl_usingDecl()
|
||||
{
|
||||
QList<QuickFixTestDocument::Ptr> testDocuments;
|
||||
|
||||
QByteArray original;
|
||||
QByteArray expected;
|
||||
|
||||
// Header File
|
||||
original = R"(
|
||||
namespace N { struct S; }
|
||||
using N::S;
|
||||
|
||||
void @func(const S &s);
|
||||
)";
|
||||
expected = original;
|
||||
testDocuments << QuickFixTestDocument::create("file.h", original, expected);
|
||||
|
||||
// Source File
|
||||
original = R"(
|
||||
#include "file.h"
|
||||
)";
|
||||
expected = R"(
|
||||
#include "file.h"
|
||||
|
||||
void func(const S &s)
|
||||
{
|
||||
|
||||
}
|
||||
)";
|
||||
testDocuments << QuickFixTestDocument::create("file.cpp", original, expected);
|
||||
|
||||
InsertDefFromDecl factory;
|
||||
QuickFixOperationTest(testDocuments, &factory);
|
||||
}
|
||||
|
||||
/// Find right implementation file. (QTCREATORBUG-10728)
|
||||
void CppEditorPlugin::test_quickfix_InsertDefFromDecl_findImplementationFile()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user