forked from qt-creator/qt-creator
QuickFix: Fix generate function definition with unsigned type
Fixes: QTCREATORBUG-28378 Change-Id: Ic94901e430d08aab22c8f4c394eda1f8a93398bc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -4713,6 +4713,95 @@ void QuickfixTest::testInsertDefFromDeclTemplateFunction()
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
}
|
||||
|
||||
void QuickfixTest::testInsertDefFromDeclFunctionWithSignedUnsignedArgument()
|
||||
{
|
||||
QByteArray original;
|
||||
QByteArray expected;
|
||||
InsertDefFromDecl factory;
|
||||
|
||||
original =R"--(
|
||||
class myclass
|
||||
{
|
||||
myc@lass(QVector<signed> g);
|
||||
myclass(QVector<unsigned> g);
|
||||
}
|
||||
)--";
|
||||
expected =R"--(
|
||||
class myclass
|
||||
{
|
||||
myclass(QVector<signed> g);
|
||||
myclass(QVector<unsigned> g);
|
||||
}
|
||||
|
||||
myclass::myclass(QVector<signed int> g)
|
||||
{
|
||||
|
||||
}
|
||||
)--";
|
||||
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
|
||||
original =R"--(
|
||||
class myclass
|
||||
{
|
||||
myclass(QVector<signed> g);
|
||||
myc@lass(QVector<unsigned> g);
|
||||
}
|
||||
)--";
|
||||
expected =R"--(
|
||||
class myclass
|
||||
{
|
||||
myclass(QVector<signed> g);
|
||||
myclass(QVector<unsigned> g);
|
||||
}
|
||||
|
||||
myclass::myclass(QVector<unsigned int> g)
|
||||
{
|
||||
|
||||
}
|
||||
)--";
|
||||
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
|
||||
original =R"--(
|
||||
class myclass
|
||||
{
|
||||
unsigned f@oo(unsigned);
|
||||
}
|
||||
)--";
|
||||
expected =R"--(
|
||||
class myclass
|
||||
{
|
||||
unsigned foo(unsigned);
|
||||
}
|
||||
|
||||
unsigned int myclass::foo(unsigned int)
|
||||
{
|
||||
|
||||
}
|
||||
)--";
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
|
||||
original =R"--(
|
||||
class myclass
|
||||
{
|
||||
signed f@oo(signed);
|
||||
}
|
||||
)--";
|
||||
expected =R"--(
|
||||
class myclass
|
||||
{
|
||||
signed foo(signed);
|
||||
}
|
||||
|
||||
signed int myclass::foo(signed int)
|
||||
{
|
||||
|
||||
}
|
||||
)--";
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
}
|
||||
|
||||
void QuickfixTest::testInsertDefFromDeclNotTriggeredForFriendFunc()
|
||||
{
|
||||
const QByteArray contents =
|
||||
|
||||
Reference in New Issue
Block a user