From aa0c466b9f114cc8b1178ce1612fc3db57a881df Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Fri, 30 Nov 2018 18:36:31 +0000 Subject: [PATCH] [clang] Fix rL348006 for windows git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348015 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Basic/FileManagerTest.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/unittests/Basic/FileManagerTest.cpp b/unittests/Basic/FileManagerTest.cpp index 78c99909b7..21b411c978 100644 --- a/unittests/Basic/FileManagerTest.cpp +++ b/unittests/Basic/FileManagerTest.cpp @@ -361,7 +361,14 @@ TEST_F(FileManagerTest, getVirtualFileFillsRealPathName) { const FileEntry *file = manager.getVirtualFile("/tmp/test", 123, 1); ASSERT_TRUE(file != nullptr); ASSERT_TRUE(file->isValid()); - EXPECT_EQ(file->tryGetRealPathName(), "/tmp/test"); + SmallString<64> ExpectedResult; +#ifdef _WIN32 + ExpectedResult = "C:"; +#else + ExpectedResult = "/"; +#endif + llvm::sys::path::append(ExpectedResult, "tmp", "test"); + EXPECT_EQ(file->tryGetRealPathName(), ExpectedResult); } } // anonymous namespace -- 2.50.1