Skip to content

Commit

Permalink
Test case for graceful handling of long file names on Windows. Patch …
Browse files Browse the repository at this point in the history
…thanks to Paul Robinson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177223 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
AaronBallman committed Mar 16, 2013
1 parent 8647750 commit 551152f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions unittests/Support/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,18 @@ TEST_F(FileSystemTest, TempFiles) {
// Make sure Temp1 doesn't exist.
ASSERT_NO_ERROR(fs::exists(Twine(TempPath), TempFileExists));
EXPECT_FALSE(TempFileExists);

#ifdef LLVM_ON_WIN32
// Path name > 260 chars should get an error.
const char *Path270 =
"abcdefghijklmnopqrstuvwxyz9abcdefghijklmnopqrstuvwxyz8"
"abcdefghijklmnopqrstuvwxyz7abcdefghijklmnopqrstuvwxyz6"
"abcdefghijklmnopqrstuvwxyz5abcdefghijklmnopqrstuvwxyz4"
"abcdefghijklmnopqrstuvwxyz3abcdefghijklmnopqrstuvwxyz2"
"abcdefghijklmnopqrstuvwxyz1abcdefghijklmnopqrstuvwxyz0";
EXPECT_EQ(fs::unique_file(Twine(Path270), FileDescriptor, TempPath),
windows_error::path_not_found);
#endif
}

TEST_F(FileSystemTest, DirectoryIteration) {
Expand Down

0 comments on commit 551152f

Please sign in to comment.