From: Kadir Cetinkaya Date: Fri, 30 Nov 2018 18:36:31 +0000 (+0000) Subject: [clang] Fix rL348006 for windows X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa0c466b9f114cc8b1178ce1612fc3db57a881df;p=clang [clang] Fix rL348006 for windows git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348015 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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