summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-05-19 13:19:08 +0200
committerErik Verbruggen <erik.verbruggen@nokia.com>2011-05-19 13:23:50 +0200
commitc5ce20c5f74d3ee6d665b3aedd9822a5ff204bc4 (patch)
treeb8613a3f3be7fb7f08140eefd8e41062e965dd80 /tests
parent86d5df063cda54c6eb2e32fb6496a23c8ef0de81 (diff)
downloadqt-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.cpp17
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"