From: Alexander Kornienko Date: Mon, 30 Dec 2013 16:11:28 +0000 (+0000) Subject: Changed the test to avoid EXPECT_EQ(false, ...), which leads to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=445938035707b9c4accb6234b8da706fd7861911;p=clang Changed the test to avoid EXPECT_EQ(false, ...), which leads to -Wconversion-null warning in GCC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198214 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index d721f0d09d..7032f90b0b 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -7433,26 +7433,28 @@ TEST_F(FormatTest, ParsesConfigurationWithLanguages) { 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);