diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-15 15:56:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-15 17:12:19 +0300 |
commit | d6bf14eebdfb9939e0fa1f61f81fa1046ff9ea27 (patch) | |
tree | a48d3d2cf16e347e18a65020d755371eb0cabcfe /src/utils/virtfs_unittest.cc | |
parent | 42b05f92d4466aa49806ab7d1e6985ad943ae1ea (diff) | |
download | mv-d6bf14eebdfb9939e0fa1f61f81fa1046ff9ea27.tar.gz mv-d6bf14eebdfb9939e0fa1f61f81fa1046ff9ea27.tar.bz2 mv-d6bf14eebdfb9939e0fa1f61f81fa1046ff9ea27.tar.xz mv-d6bf14eebdfb9939e0fa1f61f81fa1046ff9ea27.zip |
Fix unit tests if unpack from tarball. Here soft links replaced to actual files.
Diffstat (limited to 'src/utils/virtfs_unittest.cc')
-rw-r--r-- | src/utils/virtfs_unittest.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/utils/virtfs_unittest.cc b/src/utils/virtfs_unittest.cc index b35d31215..af2c22dee 100644 --- a/src/utils/virtfs_unittest.cc +++ b/src/utils/virtfs_unittest.cc @@ -110,26 +110,26 @@ TEST_CASE("VirtFs enumerateFiles") VirtList *list = nullptr; + const int cnt1 = VirtFs::exists("test/test2.txt") ? 23 : 22; + const int cnt2 = 23; + VirtFs::permitLinks(false); list = VirtFs::enumerateFiles("test"); removeTemp(list->names); const size_t sz = list->names.size(); - REQUIRE(sz == 22); + REQUIRE(sz == cnt1); VirtFs::freeList(list); VirtFs::permitLinks(true); list = VirtFs::enumerateFiles("test"); removeTemp(list->names); - REQUIRE(list->names.size() > sz); - REQUIRE(list->names.size() - sz == 1); - REQUIRE(list->names.size() == 23); + REQUIRE(list->names.size() == cnt2); VirtFs::freeList(list); VirtFs::permitLinks(false); list = VirtFs::enumerateFiles("test"); removeTemp(list->names); - REQUIRE(list->names.size() == sz); - REQUIRE(list->names.size() == 22); + REQUIRE(list->names.size() == cnt1); VirtFs::freeList(list); VirtFs::removeDirFromSearchPath("data"); @@ -331,27 +331,27 @@ TEST_CASE("VirtFs permitLinks") VirtFs::addDirToSearchPath("data", Append_false); VirtFs::addDirToSearchPath("../data", Append_false); + const int cnt1 = VirtFs::exists("test/test2.txt") ? 22 : 21; + const int cnt2 = 22; + StringVect list; VirtFs::permitLinks(false); VirtFs::getFiles("test", list); removeTemp(list); const size_t sz = list.size(); - REQUIRE(sz == 21); + REQUIRE(sz == cnt1); list.clear(); VirtFs::permitLinks(true); VirtFs::getFiles("test", list); removeTemp(list); - REQUIRE(list.size() > sz); - REQUIRE(list.size() - sz == 1); - REQUIRE(list.size() == 22); + REQUIRE(list.size() == cnt2); list.clear(); VirtFs::permitLinks(false); VirtFs::getFiles("test", list); removeTemp(list); - REQUIRE(list.size() == sz); - REQUIRE(list.size() == 21); + REQUIRE(list.size() == cnt1); VirtFs::removeDirFromSearchPath("data"); VirtFs::removeDirFromSearchPath("../data"); |