r210768 - Fix msvc unittest build.

Rafael Espindola rafael.espindola at gmail.com
Thu Jun 12 04:35:17 PDT 2014


Author: rafael
Date: Thu Jun 12 06:35:17 2014
New Revision: 210768

URL: http://llvm.org/viewvc/llvm-project?rev=210768&view=rev
Log:
Fix msvc unittest build.

Looks like msvc has an asymmetrical operator ==.

Modified:
    cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
    cfe/trunk/unittests/Format/FormatTest.cpp

Modified: cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp?rev=210768&r1=210767&r2=210768&view=diff
==============================================================================
--- cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp (original)
+++ cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp Thu Jun 12 06:35:17 2014
@@ -35,7 +35,7 @@ public:
     std::map<std::string, vfs::Status>::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,

Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=210768&r1=210767&r2=210768&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Thu Jun 12 06:35:17 2014
@@ -8181,9 +8181,10 @@ TEST_F(FormatTest, ParsesConfigurationWi
   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, ParsesConfigurationWi
               "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, ParsesConfigurationWi
   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);
 }





More information about the cfe-commits mailing list