From 25e44e7c33a639b3c5266901ba109fefa39ca8c4 Mon Sep 17 00:00:00 2001 From: Matthew Voss Date: Tue, 20 Nov 2018 03:30:28 +0000 Subject: [PATCH] Ensure FileManagerTest expects "\\" as path separator on Windows platforms llvm-svn: 347284 --- clang/unittests/Basic/FileManagerTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp index b5855eeff7e0..7e1e37f3c4c0 100644 --- a/clang/unittests/Basic/FileManagerTest.cpp +++ b/clang/unittests/Basic/FileManagerTest.cpp @@ -240,7 +240,11 @@ TEST_F(FileManagerTest, getFileDefersOpen) { file = manager.getFile("/tmp/test", /*OpenFile=*/true); ASSERT_TRUE(file != nullptr); ASSERT_TRUE(file->isValid()); +#ifdef _WIN32 + EXPECT_EQ("/tmp\\test", file->tryGetRealPathName()); +#else EXPECT_EQ("/tmp/test", file->tryGetRealPathName()); +#endif // However we should never try to open a file previously opened as virtual. ASSERT_TRUE(manager.getVirtualFile("/tmp/testv", 5, 0));