[cfe-commits] r172377 - /cfe/trunk/unittests/Format/FormatTest.cpp

Nico Weber nicolasweber at gmx.de
Sun Jan 13 21:49:49 PST 2013


Author: nico
Date: Sun Jan 13 23:49:49 2013
New Revision: 172377

URL: http://llvm.org/viewvc/llvm-project?rev=172377&view=rev
Log:
Formatter: Add a test for bitfields.

They work fine, but this fifth use of colons (after labels, in ?:,
in initalizer lists in constructors, in objc method expressions, and in
bitfields) wasn't covered by tests yet.


Modified:
    cfe/trunk/unittests/Format/FormatTest.cpp

Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=172377&r1=172376&r2=172377&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Sun Jan 13 23:49:49 2013
@@ -369,6 +369,13 @@
                "};");
 }
 
+TEST_F(FormatTest, FormatsBitfields) {
+  verifyFormat("struct Bitfields {\n"
+               "  unsigned sClass : 8;\n"
+               "  unsigned ValueKind : 2;\n"
+               "};");
+}
+
 TEST_F(FormatTest, FormatsNamespaces) {
   verifyFormat("namespace some_namespace {\n"
                "class A {};\n"





More information about the cfe-commits mailing list