C++ indenter: Enable class, struct, enum, namespace, using in functions.

Fixes incorrect indentation we got previously when they were used in a
statement context.
This commit is contained in:
Christian Kamm
2010-07-08 08:35:12 +02:00
parent 870da8e7e3
commit 6078b36c9c
2 changed files with 34 additions and 21 deletions

View File

@@ -42,6 +42,7 @@ private Q_SLOTS:
void operatorOverloads();
void gnuStyle();
void whitesmithsStyle();
void singleLineEnum();
};
struct Line {
@@ -755,6 +756,19 @@ void tst_CodeFormatter::whitesmithsStyle()
checkIndent(data, 2);
}
void tst_CodeFormatter::singleLineEnum()
{
enum { a, b};
QList<Line> data;
data << Line("enum { foo, bar, car = 2 };")
<< Line("void blah() {")
<< Line(" enum { foo, bar, car = 2 };")
<< Line(" int i;")
<< Line("}")
;
checkIndent(data);
}
QTEST_APPLESS_MAIN(tst_CodeFormatter)
#include "tst_codeformatter.moc"