r198214 - Changed the test to avoid EXPECT_EQ(false, ...), which leads to
Alexander Kornienko
alexfh at google.com
Mon Dec 30 08:11:28 PST 2013
Author: alexfh
Date: Mon Dec 30 10:11:28 2013
New Revision: 198214
URL: http://llvm.org/viewvc/llvm-project?rev=198214&view=rev
Log:
Changed the test to avoid EXPECT_EQ(false, ...), which leads to
-Wconversion-null warning in GCC.
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=198214&r1=198213&r2=198214&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Mon Dec 30 10:11:28 2013
@@ -7433,26 +7433,28 @@ TEST_F(FormatTest, ParsesConfigurationWi
EXPECT_EQ(FormatStyle::LK_Cpp, Style.Language);
}
+#undef CHECK_PARSE
+#undef CHECK_PARSE_BOOL
+
TEST_F(FormatTest, UsesLanguageForBasedOnStyle) {
FormatStyle Style = {};
Style.Language = FormatStyle::LK_JavaScript;
Style.BreakBeforeTernaryOperators = true;
- CHECK_PARSE("BasedOnStyle: Google", BreakBeforeTernaryOperators, false);
+ EXPECT_EQ(0, parseConfiguration("BasedOnStyle: Google", &Style).value());
+ EXPECT_FALSE(Style.BreakBeforeTernaryOperators);
+
Style.BreakBeforeTernaryOperators = true;
- CHECK_PARSE("---\n"
+ EXPECT_EQ(0, parseConfiguration("---\n"
"BasedOnStyle: Google\n"
"---\n"
"Language: JavaScript\n"
"IndentWidth: 76\n"
- "...\n",
- BreakBeforeTernaryOperators, false);
+ "...\n", &Style).value());
+ EXPECT_FALSE(Style.BreakBeforeTernaryOperators);
EXPECT_EQ(76u, Style.IndentWidth);
EXPECT_EQ(FormatStyle::LK_JavaScript, Style.Language);
}
-#undef CHECK_PARSE
-#undef CHECK_PARSE_BOOL
-
TEST_F(FormatTest, ConfigurationRoundTripTest) {
FormatStyle Style = getLLVMStyle();
std::string YAML = configurationAsText(Style);
More information about the cfe-commits
mailing list