diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-05-19 13:19:08 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2011-05-19 13:23:50 +0200 |
commit | c5ce20c5f74d3ee6d665b3aedd9822a5ff204bc4 (patch) | |
tree | b8613a3f3be7fb7f08140eefd8e41062e965dd80 /tests | |
parent | 86d5df063cda54c6eb2e32fb6496a23c8ef0de81 (diff) | |
download | qt-creator-c5ce20c5f74d3ee6d665b3aedd9822a5ff204bc4.tar.gz |
C++ indenter: Treat extern "C" like namespace.
Change-Id: Ib0553d35fbd83aada2b8809aa008b1f75ca77c32
Done-with: Erik Verbruggen
Reviewed-on: http://codereview.qt.nokia.com/14
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp b/tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp index d0c3ee811a..ade32d8c2e 100644 --- a/tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp +++ b/tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp @@ -92,6 +92,7 @@ private Q_SLOTS: void indentToNextToken(); void labels(); void functionsWithExtraSpecifier(); + void externSpec(); }; struct Line { @@ -1192,6 +1193,22 @@ void tst_CodeFormatter::functionsWithExtraSpecifier() checkIndent(data); } +void tst_CodeFormatter::externSpec() +{ + QList<Line> data; + data << Line("extern void foo() {}") + << Line("extern \"C\" {") + << Line("void foo() {}") + << Line("int a;") + << Line("class C {") + << Line(" int a;") + << Line("}") + << Line("}") + << Line("int a;") + ; + checkIndent(data); +} + QTEST_APPLESS_MAIN(tst_CodeFormatter) #include "tst_codeformatter.moc" |