[Lldb-commits] [lldb] r347712 - [unittest] Fix the FileSystem test on Windows.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 27 13:20:36 PST 2018


Author: jdevlieghere
Date: Tue Nov 27 13:20:35 2018
New Revision: 347712

URL: http://llvm.org/viewvc/llvm-project?rev=347712&view=rev
Log:
[unittest] Fix the FileSystem test on Windows.

On Windows, when using the VFS without going through FileSpec, the
absolute path to `/foo` is `\\foo`. This updates the unittest to expect
that.

Modified:
    lldb/trunk/unittests/Host/FileSystemTest.cpp

Modified: lldb/trunk/unittests/Host/FileSystemTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/FileSystemTest.cpp?rev=347712&r1=347711&r2=347712&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/FileSystemTest.cpp (original)
+++ lldb/trunk/unittests/Host/FileSystemTest.cpp Tue Nov 27 13:20:35 2018
@@ -225,7 +225,11 @@ TEST(FileSystemTest, MakeAbsolute) {
     SmallString<16> foo(foo_relative);
     auto EC = fs.MakeAbsolute(foo);
     EXPECT_FALSE(EC);
+#ifdef _WIN32
+    EXPECT_TRUE(foo.equals("\\\\foo"));
+#else
     EXPECT_TRUE(foo.equals("/foo"));
+#endif
   }
 
   {
@@ -243,7 +247,11 @@ TEST(FileSystemTest, Resolve) {
     StringRef foo_relative = "foo";
     SmallString<16> foo(foo_relative);
     fs.Resolve(foo);
+#ifdef _WIN32
+    EXPECT_TRUE(foo.equals("\\\\foo"));
+#else
     EXPECT_TRUE(foo.equals("/foo"));
+#endif
   }
 
   {




More information about the lldb-commits mailing list