From 6052d09c05f7aeec8e70ee12728753bb5823ebcc Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 27 Nov 2018 21:20:35 +0000 Subject: [PATCH] [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. llvm-svn: 347712 --- lldb/unittests/Host/FileSystemTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lldb/unittests/Host/FileSystemTest.cpp b/lldb/unittests/Host/FileSystemTest.cpp index 76ac83f..62e2c6aff 100644 --- a/lldb/unittests/Host/FileSystemTest.cpp +++ b/lldb/unittests/Host/FileSystemTest.cpp @@ -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 } { -- 2.7.4