summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-12 02:50:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-12 02:50:04 +0000
commitd0136707a97b379680210f29e5caa2092fe80668 (patch)
tree75fe65efee09825e9e4d5456a08b837ab09e7b00 /clang/unittests/Format/FormatTest.cpp
parent2456cea2e18e070b0019b11d9f47338244f01d0d (diff)
downloadbcm5719-llvm-d0136707a97b379680210f29e5caa2092fe80668.tar.gz
bcm5719-llvm-d0136707a97b379680210f29e5caa2092fe80668.zip
Give clang-format its own error category.
The posix errno values are probably to the best thing to use for describing parse errors. This should also fix the mingw build. llvm-svn: 210739
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index f8bf85bdbab..d7aeb30fbf2 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -8181,10 +8181,9 @@ TEST_F(FormatTest, ParsesConfigurationWithLanguages) {
CHECK_PARSE("Language: Cpp\n"
"IndentWidth: 12",
IndentWidth, 12u);
- EXPECT_EQ(std::errc::not_supported,
- parseConfiguration("Language: JavaScript\n"
- "IndentWidth: 34",
- &Style));
+ EXPECT_EQ(ParseError::Unsuitable, parseConfiguration("Language: JavaScript\n"
+ "IndentWidth: 34",
+ &Style));
EXPECT_EQ(12u, Style.IndentWidth);
CHECK_PARSE("IndentWidth: 56", IndentWidth, 56u);
EXPECT_EQ(FormatStyle::LK_Cpp, Style.Language);
@@ -8194,9 +8193,9 @@ TEST_F(FormatTest, ParsesConfigurationWithLanguages) {
"IndentWidth: 12",
IndentWidth, 12u);
CHECK_PARSE("IndentWidth: 23", IndentWidth, 23u);
- EXPECT_EQ(std::errc::not_supported, parseConfiguration("Language: Cpp\n"
- "IndentWidth: 34",
- &Style));
+ EXPECT_EQ(ParseError::Unsuitable, parseConfiguration("Language: Cpp\n"
+ "IndentWidth: 34",
+ &Style));
EXPECT_EQ(23u, Style.IndentWidth);
CHECK_PARSE("IndentWidth: 56", IndentWidth, 56u);
EXPECT_EQ(FormatStyle::LK_JavaScript, Style.Language);
@@ -8253,24 +8252,21 @@ TEST_F(FormatTest, ParsesConfigurationWithLanguages) {
EXPECT_EQ(FormatStyle::BS_Stroustrup, Style.BreakBeforeBraces);
EXPECT_EQ(789u, Style.TabWidth);
-
- EXPECT_EQ(std::errc::invalid_argument,
- parseConfiguration("---\n"
- "Language: JavaScript\n"
- "IndentWidth: 56\n"
- "---\n"
- "IndentWidth: 78\n"
- "...\n",
- &Style));
- EXPECT_EQ(std::errc::invalid_argument,
- parseConfiguration("---\n"
- "Language: JavaScript\n"
- "IndentWidth: 56\n"
- "---\n"
- "Language: JavaScript\n"
- "IndentWidth: 78\n"
- "...\n",
- &Style));
+ EXPECT_EQ(ParseError::Error, parseConfiguration("---\n"
+ "Language: JavaScript\n"
+ "IndentWidth: 56\n"
+ "---\n"
+ "IndentWidth: 78\n"
+ "...\n",
+ &Style));
+ EXPECT_EQ(ParseError::Error, parseConfiguration("---\n"
+ "Language: JavaScript\n"
+ "IndentWidth: 56\n"
+ "---\n"
+ "Language: JavaScript\n"
+ "IndentWidth: 78\n"
+ "...\n",
+ &Style));
EXPECT_EQ(FormatStyle::LK_Cpp, Style.Language);
}
OpenPOWER on IntegriCloud