]> granicus.if.org Git - clang/commitdiff
Changed the test to avoid EXPECT_EQ(false, ...), which leads to
authorAlexander Kornienko <alexfh@google.com>
Mon, 30 Dec 2013 16:11:28 +0000 (16:11 +0000)
committerAlexander Kornienko <alexfh@google.com>
Mon, 30 Dec 2013 16:11:28 +0000 (16:11 +0000)
-Wconversion-null warning in GCC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198214 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Format/FormatTest.cpp

index d721f0d09d7d494d61346d49ce9180083a541b56..7032f90b0b00adc437fbc1af39cd516227bec294 100644 (file)
@@ -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);