summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-12-30 16:11:28 +0000
committerAlexander Kornienko <alexfh@google.com>2013-12-30 16:11:28 +0000
commitd6bd74742be3084ea22fb09ed600068da53b8982 (patch)
tree655b3d4b0097c82addbd78e9cecb18ae9149d76c /clang/unittests/Format/FormatTest.cpp
parent79bb924e17232501bff9d0fd1ccad9425ae39ac2 (diff)
downloadbcm5719-llvm-d6bd74742be3084ea22fb09ed600068da53b8982.tar.gz
bcm5719-llvm-d6bd74742be3084ea22fb09ed600068da53b8982.zip
Changed the test to avoid EXPECT_EQ(false, ...), which leads to
-Wconversion-null warning in GCC. llvm-svn: 198214
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index d721f0d09d7..7032f90b0b0 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud