clang-format: Fix GCC warning about implicit bool pointer conversion.

Introduced in r217880.

llvm-svn: 218597
This commit is contained in:
Daniel Jasper 2014-09-29 08:07:46 +00:00
parent f03e6d84bc
commit 91881d99f7
1 changed files with 6 additions and 6 deletions

View File

@ -8353,13 +8353,15 @@ TEST_F(FormatTest, GetsCorrectBasedOnStyle) {
EXPECT_ALL_STYLES_EQUAL(Styles);
}
#define CHECK_PARSE_BOOL(FIELD) \
#define CHECK_PARSE_BOOL_FIELD(FIELD, CONFIG_NAME) \
Style.FIELD = false; \
EXPECT_EQ(0, parseConfiguration(#FIELD ": true", &Style).value()); \
EXPECT_EQ(0, parseConfiguration(CONFIG_NAME ": true", &Style).value()); \
EXPECT_TRUE(Style.FIELD); \
EXPECT_EQ(0, parseConfiguration(#FIELD ": false", &Style).value()); \
EXPECT_EQ(0, parseConfiguration(CONFIG_NAME ": false", &Style).value()); \
EXPECT_FALSE(Style.FIELD);
#define CHECK_PARSE_BOOL(FIELD) CHECK_PARSE_BOOL_FIELD(FIELD, #FIELD)
#define CHECK_PARSE(TEXT, FIELD, VALUE) \
EXPECT_NE(VALUE, Style.FIELD); \
EXPECT_EQ(0, parseConfiguration(TEXT, &Style).value()); \
@ -8382,9 +8384,7 @@ TEST_F(FormatTest, ParsesConfigurationBools) {
CHECK_PARSE_BOOL(BreakConstructorInitializersBeforeComma);
CHECK_PARSE_BOOL(ConstructorInitializerAllOnOneLineOrOnePerLine);
CHECK_PARSE_BOOL(DerivePointerAlignment);
// For backward compatibility:
CHECK_PARSE("DerivePointerBinding: true", DerivePointerAlignment, true);
CHECK_PARSE("DerivePointerBinding: false", DerivePointerAlignment, false);
CHECK_PARSE_BOOL_FIELD(DerivePointerAlignment, "DerivePointerBinding");
CHECK_PARSE_BOOL(IndentCaseLabels);
CHECK_PARSE_BOOL(IndentWrappedFunctionNames);
CHECK_PARSE_BOOL(KeepEmptyLinesAtTheStartOfBlocks);