diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-11-25 12:18:32 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-12-02 13:46:51 +0200 |
commit | 4c49f0c9db68fe998e83ac7a0f3d095c3d2ffed1 (patch) | |
tree | 04f7028328f42ca04916c4a4629b4c7038a71640 /test/storage | |
parent | 0ec01356d854caf3159e0eec6d4fbdd3d2200359 (diff) | |
download | qtlocation-mapboxgl-4c49f0c9db68fe998e83ac7a0f3d095c3d2ffed1.tar.gz |
[core] Introduce OfflineDatabase::runPackDatabaseAutomatically() API
- added a unit test
- Updated inline comments in default_file_source.hpp
Diffstat (limited to 'test/storage')
-rw-r--r-- | test/storage/offline_database.test.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/storage/offline_database.test.cpp b/test/storage/offline_database.test.cpp index 9d798d0a62..e9164e7c66 100644 --- a/test/storage/offline_database.test.cpp +++ b/test/storage/offline_database.test.cpp @@ -701,7 +701,8 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(DeleteRegion)) { db.putRegionResources(region2->getID(), generateResources("mapbox://tile_2", "mapbox://style_2"), status); const size_t sizeWithTwoRegions = util::read_file(filename).size(); - db.deleteRegion(std::move(*region1), false /*pack*/); + db.runPackDatabaseAutomatically(false); + db.deleteRegion(std::move(*region1)); ASSERT_EQ(1u, db.listRegions().value().size()); // Region is removed but the size of the database is the same. @@ -711,7 +712,7 @@ TEST(OfflineDatabase, TEST_REQUIRES_WRITE(DeleteRegion)) { // The size of the database has shrunk after pack(). const size_t sizeWithOneRegion = util::read_file(filename).size(); EXPECT_LT(sizeWithOneRegion, sizeWithTwoRegions); - + db.runPackDatabaseAutomatically(true); db.deleteRegion(std::move(*region2)); // The size of the database has shrunk right away. const size_t sizeWithoutRegions = util::read_file(filename).size(); |