mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[Support][Unittests] Add unittest for recursive_directory_iterator::level()
llvm-svn: 269488
This commit is contained in:
parent
e7c1345927
commit
8b294ba100
@ -716,6 +716,20 @@ TEST_F(FileSystemTest, DirectoryIteration) {
|
||||
ASSERT_NO_ERROR(fs::remove(Twine(TestDirectory) + "/recursive/z0/za1"));
|
||||
ASSERT_NO_ERROR(fs::remove(Twine(TestDirectory) + "/recursive/z0"));
|
||||
ASSERT_NO_ERROR(fs::remove(Twine(TestDirectory) + "/recursive"));
|
||||
|
||||
// Test recursive_directory_iterator level()
|
||||
ASSERT_NO_ERROR(
|
||||
fs::create_directories(Twine(TestDirectory) + "/reclevel/a/b/c"));
|
||||
fs::recursive_directory_iterator I(Twine(TestDirectory) + "/reclevel", ec), E;
|
||||
for (int l = 0; I != E; I.increment(ec), ++l) {
|
||||
ASSERT_NO_ERROR(ec);
|
||||
EXPECT_EQ(I.level(), l);
|
||||
}
|
||||
EXPECT_EQ(I, E);
|
||||
ASSERT_NO_ERROR(fs::remove(Twine(TestDirectory) + "/reclevel/a/b/c"));
|
||||
ASSERT_NO_ERROR(fs::remove(Twine(TestDirectory) + "/reclevel/a/b"));
|
||||
ASSERT_NO_ERROR(fs::remove(Twine(TestDirectory) + "/reclevel/a"));
|
||||
ASSERT_NO_ERROR(fs::remove(Twine(TestDirectory) + "/reclevel"));
|
||||
}
|
||||
|
||||
const char archive[] = "!<arch>\x0A";
|
||||
|
Loading…
x
Reference in New Issue
Block a user