diff options
author | Molly Lloyd <mollymerp@users.noreply.github.com> | 2016-09-20 11:43:00 -0400 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2016-09-20 17:43:00 +0200 |
commit | 598f7c6ad5147417c7241514f1fdece348a9b997 (patch) | |
tree | 0e238b65c58cd0cd3cb5b9f10a12c35715ae9969 /test/storage | |
parent | 97da3872737ea08bdb2f50a22baf08aab123fafb (diff) | |
download | qtlocation-mapboxgl-598f7c6ad5147417c7241514f1fdece348a9b997.tar.gz |
[core] allow offline region metadata to be updated (#6338)
Diffstat (limited to 'test/storage')
-rw-r--r-- | test/storage/offline_database.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/storage/offline_database.cpp b/test/storage/offline_database.cpp index 656fc2878a..bcc9784b35 100644 --- a/test/storage/offline_database.cpp +++ b/test/storage/offline_database.cpp @@ -274,6 +274,19 @@ TEST(OfflineDatabase, CreateRegion) { EXPECT_EQ(metadata, region.getMetadata()); } +TEST(OfflineDatabase, UpdateMetadata) { + using namespace mbgl; + + OfflineDatabase db(":memory:"); + OfflineRegionDefinition definition { "http://example.com/style", LatLngBounds::hull({1, 2}, {3, 4}), 5, 6, 2.0 }; + OfflineRegionMetadata metadata {{ 1, 2, 3 }}; + OfflineRegion region = db.createRegion(definition, metadata); + + OfflineRegionMetadata newmetadata {{ 4, 5, 6 }}; + db.updateMetadata(region.getID(), newmetadata); + EXPECT_EQ(db.listRegions().at(0).getMetadata(), newmetadata); +} + TEST(OfflineDatabase, ListRegions) { using namespace mbgl; |