diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-12-09 23:20:03 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-12-09 23:20:03 +0000 |
commit | 52ee230f6e06c4ec38b1953e1182d22431b88ddb (patch) | |
tree | 870dd861953584cd76cd3c3b61ee69a50751ad04 /unittests | |
parent | f4374e46fd9f5267d650bbcd04b10c3df0f21177 (diff) |
unittests/Support/Path.cpp: [recursive_directory_iterator] Work around for end iterator.
FIXME: It should be more robust.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Support/Path.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp index 51c62f25d6..c791184c83 100644 --- a/unittests/Support/Path.cpp +++ b/unittests/Support/Path.cpp @@ -241,8 +241,11 @@ TEST_F(FileSystemTest, DirectoryIteration) { for (fs::recursive_directory_iterator i(Twine(TestDirectory) + "/recursive", ec), e; i != e; i.increment(ec)){ ASSERT_NO_ERROR(ec); - if (path::filename(i->path()) == "p1") + if (path::filename(i->path()) == "p1") { i.pop(); + // FIXME: recursive_directory_iterator should be more robust. + if (i == e) break; + } if (path::filename(i->path()) == "dontlookhere") i.no_push(); visited.push_back(path::filename(i->path())); |