From 1f24317d87b31f6561be7167447b26ac476ecab9 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 12 Jun 2014 11:35:17 +0000 Subject: [PATCH] Fix msvc unittest build. Looks like msvc has an asymmetrical operator ==. llvm-svn: 210768 --- clang/unittests/Basic/VirtualFileSystemTest.cpp | 2 +- clang/unittests/Format/FormatTest.cpp | 46 ++++++++++++++----------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/clang/unittests/Basic/VirtualFileSystemTest.cpp b/clang/unittests/Basic/VirtualFileSystemTest.cpp index 27d5e4c..6d05049 100644 --- a/clang/unittests/Basic/VirtualFileSystemTest.cpp +++ b/clang/unittests/Basic/VirtualFileSystemTest.cpp @@ -35,7 +35,7 @@ public: std::map::iterator I = FilesAndDirs.find(Path.str()); if (I == FilesAndDirs.end()) - return make_error_code(std::errc::no_such_file_or_directory); + return std::make_error_code(std::errc::no_such_file_or_directory); return I->second; } error_code openFileForRead(const Twine &Path, diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index d7aeb30..ecccc70 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -8181,9 +8181,10 @@ TEST_F(FormatTest, ParsesConfigurationWithLanguages) { CHECK_PARSE("Language: Cpp\n" "IndentWidth: 12", IndentWidth, 12u); - EXPECT_EQ(ParseError::Unsuitable, parseConfiguration("Language: JavaScript\n" - "IndentWidth: 34", - &Style)); + EXPECT_EQ(parseConfiguration("Language: JavaScript\n" + "IndentWidth: 34", + &Style), + ParseError::Unsuitable); EXPECT_EQ(12u, Style.IndentWidth); CHECK_PARSE("IndentWidth: 56", IndentWidth, 56u); EXPECT_EQ(FormatStyle::LK_Cpp, Style.Language); @@ -8193,9 +8194,10 @@ TEST_F(FormatTest, ParsesConfigurationWithLanguages) { "IndentWidth: 12", IndentWidth, 12u); CHECK_PARSE("IndentWidth: 23", IndentWidth, 23u); - EXPECT_EQ(ParseError::Unsuitable, parseConfiguration("Language: Cpp\n" - "IndentWidth: 34", - &Style)); + EXPECT_EQ(parseConfiguration("Language: Cpp\n" + "IndentWidth: 34", + &Style), + ParseError::Unsuitable); EXPECT_EQ(23u, Style.IndentWidth); CHECK_PARSE("IndentWidth: 56", IndentWidth, 56u); EXPECT_EQ(FormatStyle::LK_JavaScript, Style.Language); @@ -8252,21 +8254,23 @@ TEST_F(FormatTest, ParsesConfigurationWithLanguages) { EXPECT_EQ(FormatStyle::BS_Stroustrup, Style.BreakBeforeBraces); EXPECT_EQ(789u, Style.TabWidth); - 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(parseConfiguration("---\n" + "Language: JavaScript\n" + "IndentWidth: 56\n" + "---\n" + "IndentWidth: 78\n" + "...\n", + &Style), + ParseError::Error); + EXPECT_EQ(parseConfiguration("---\n" + "Language: JavaScript\n" + "IndentWidth: 56\n" + "---\n" + "Language: JavaScript\n" + "IndentWidth: 78\n" + "...\n", + &Style), + ParseError::Error); EXPECT_EQ(FormatStyle::LK_Cpp, Style.Language); } -- 2.7.4