summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-12-09 23:20:03 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-12-09 23:20:03 +0000
commit0cfb3675cb00e985a568dd886ad61dfbc7f1cda6 (patch)
tree3d62f540b93bbcbea5afc33cf4fc1f4b0acb37c6 /llvm/unittests
parent3681d1126c06732d1969611846636be8a644907a (diff)
downloadbcm5719-llvm-0cfb3675cb00e985a568dd886ad61dfbc7f1cda6.tar.gz
bcm5719-llvm-0cfb3675cb00e985a568dd886ad61dfbc7f1cda6.zip
unittests/Support/Path.cpp: [recursive_directory_iterator] Work around for end iterator.
FIXME: It should be more robust. llvm-svn: 146294
Diffstat (limited to 'llvm/unittests')
-rw-r--r--llvm/unittests/Support/Path.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index 51c62f25d66..c791184c837 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/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()));
OpenPOWER on IntegriCloud