forked from qt-creator/qt-creator
C++ indenter: Don't add continuation indent after function return type.
Task-number: QTCREATORBUG-1816
This commit is contained in:
@@ -43,6 +43,7 @@ private Q_SLOTS:
|
||||
void gnuStyle();
|
||||
void whitesmithsStyle();
|
||||
void singleLineEnum();
|
||||
void functionReturnType();
|
||||
};
|
||||
|
||||
struct Line {
|
||||
@@ -758,7 +759,6 @@ void tst_CodeFormatter::whitesmithsStyle()
|
||||
|
||||
void tst_CodeFormatter::singleLineEnum()
|
||||
{
|
||||
enum { a, b};
|
||||
QList<Line> data;
|
||||
data << Line("enum { foo, bar, car = 2 };")
|
||||
<< Line("void blah() {")
|
||||
@@ -769,6 +769,23 @@ void tst_CodeFormatter::singleLineEnum()
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::functionReturnType()
|
||||
{
|
||||
QList<Line> data;
|
||||
data
|
||||
<< Line("void")
|
||||
<< Line("foo(int) {}")
|
||||
<< Line("")
|
||||
<< Line("const QList<int> &")
|
||||
<< Line("A::foo() {}")
|
||||
<< Line("")
|
||||
<< Line("template <class T>")
|
||||
<< Line("const QList<QMap<T, T> > &")
|
||||
<< Line("A::B::foo() {}")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_CodeFormatter)
|
||||
#include "tst_codeformatter.moc"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user