summaryrefslogtreecommitdiff
path: root/src/fs/virtfs/virtfs_unittest.cc
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-16 18:10:29 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-16 18:10:29 +0300
commit5844f83998040d4a79dc442151a21dc17de60feb (patch)
tree676268ac999c9009eca96a182f3de9571da24d67 /src/fs/virtfs/virtfs_unittest.cc
parent3cf47056f239f1096590c27c1d401904a54f84fc (diff)
downloadmv-5844f83998040d4a79dc442151a21dc17de60feb.tar.gz
mv-5844f83998040d4a79dc442151a21dc17de60feb.tar.bz2
mv-5844f83998040d4a79dc442151a21dc17de60feb.tar.xz
mv-5844f83998040d4a79dc442151a21dc17de60feb.zip
Add subdir support in VirtFs::getFiles.
Diffstat (limited to 'src/fs/virtfs/virtfs_unittest.cc')
-rw-r--r--src/fs/virtfs/virtfs_unittest.cc41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/fs/virtfs/virtfs_unittest.cc b/src/fs/virtfs/virtfs_unittest.cc
index d6ab42ff4..24b9232fc 100644
--- a/src/fs/virtfs/virtfs_unittest.cc
+++ b/src/fs/virtfs/virtfs_unittest.cc
@@ -778,7 +778,7 @@ TEST_CASE("VirtFs getrealDir3")
delete2(logger);
}
-TEST_CASE("VirtFs permitLinks")
+TEST_CASE("VirtFs permitLinks1")
{
logger = new Logger();
VirtFs::mountDirSilent("data", Append_false);
@@ -811,6 +811,45 @@ TEST_CASE("VirtFs permitLinks")
delete2(logger);
}
+TEST_CASE("VirtFs permitLinks2")
+{
+ logger = new Logger();
+ VirtFs::mountDirSilent2("data",
+ "test",
+ Append_false);
+ VirtFs::mountDirSilent2("../data",
+ "test",
+ Append_false);
+
+ const int cnt1 = VirtFs::exists("test2.txt") ? 26 : 25;
+ const int cnt2 = 26;
+
+ StringVect list;
+ VirtFs::permitLinks(false);
+ VirtFs::getFiles(dirSeparator, list);
+ removeTemp(list);
+ const size_t sz = list.size();
+ REQUIRE(sz == cnt1);
+
+ list.clear();
+ VirtFs::permitLinks(true);
+ VirtFs::getFiles(dirSeparator, list);
+ removeTemp(list);
+ REQUIRE(list.size() == cnt2);
+
+ list.clear();
+ VirtFs::permitLinks(false);
+ VirtFs::getFiles(dirSeparator, list);
+ removeTemp(list);
+ REQUIRE(list.size() == cnt1);
+
+ VirtFs::unmountDirSilent2("data",
+ "test");
+ VirtFs::unmountDirSilent2("../data",
+ "test");
+ delete2(logger);
+}
+
TEST_CASE("VirtFs read1")
{
logger = new Logger();