[Lldb-commits] [lldb] r347725 - [unittest] Fix the FileSystem test on Windows. (Attempt #2)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 27 17:18:10 PST 2018


Author: jdevlieghere
Date: Tue Nov 27 17:18:10 2018
New Revision: 347725

URL: http://llvm.org/viewvc/llvm-project?rev=347725&view=rev
Log:
[unittest] Fix the FileSystem test on Windows. (Attempt #2)

This fixes the double escaping and compares FileSpecs instead of
strings.

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=347725&r1=347724&r2=347725&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/FileSystemTest.cpp (original)
+++ lldb/trunk/unittests/Host/FileSystemTest.cpp Tue Nov 27 17:18:10 2018
@@ -226,7 +226,7 @@ TEST(FileSystemTest, MakeAbsolute) {
     auto EC = fs.MakeAbsolute(foo);
     EXPECT_FALSE(EC);
 #ifdef _WIN32
-    EXPECT_TRUE(foo.equals("\\\\foo"));
+    EXPECT_TRUE(foo.equals("\\foo"));
 #else
     EXPECT_TRUE(foo.equals("/foo"));
 #endif
@@ -236,7 +236,7 @@ TEST(FileSystemTest, MakeAbsolute) {
     FileSpec file_spec("foo");
     auto EC = fs.MakeAbsolute(file_spec);
     EXPECT_FALSE(EC);
-    EXPECT_EQ("/foo", file_spec.GetPath());
+    EXPECT_EQ(FileSpec("/foo"), file_spec);
   }
 }
 
@@ -248,7 +248,7 @@ TEST(FileSystemTest, Resolve) {
     SmallString<16> foo(foo_relative);
     fs.Resolve(foo);
 #ifdef _WIN32
-    EXPECT_TRUE(foo.equals("\\\\foo"));
+    EXPECT_TRUE(foo.equals("\\foo"));
 #else
     EXPECT_TRUE(foo.equals("/foo"));
 #endif
@@ -257,7 +257,7 @@ TEST(FileSystemTest, Resolve) {
   {
     FileSpec file_spec("foo");
     fs.Resolve(file_spec);
-    EXPECT_EQ("/foo", file_spec.GetPath());
+    EXPECT_EQ(FileSpec("/foo"), file_spec);
   }
 
   {
@@ -270,7 +270,7 @@ TEST(FileSystemTest, Resolve) {
   {
     FileSpec file_spec("bogus");
     fs.Resolve(file_spec);
-    EXPECT_EQ("bogus", file_spec.GetPath());
+    EXPECT_EQ(FileSpec("bogus"), file_spec);
   }
 }
 




More information about the lldb-commits mailing list