diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-13 16:55:44 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-14 13:46:03 -0800 |
commit | 0066637e58ab47c7c1c9dcec123ff850ae33f8fc (patch) | |
tree | 7217384d6b51a05add8724aa93420a429f37f105 /test | |
parent | 1c887ff728d85d75f77556452386a5ef70eee94f (diff) | |
download | qtlocation-mapboxgl-0066637e58ab47c7c1c9dcec123ff850ae33f8fc.tar.gz |
[core] Let SQLiteCache decide when store or refresh responses
Diffstat (limited to 'test')
-rw-r--r-- | test/storage/cache_response.cpp | 6 | ||||
-rw-r--r-- | test/storage/cache_size.cpp | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/test/storage/cache_response.cpp b/test/storage/cache_response.cpp index df895ab7b4..26f439ea8f 100644 --- a/test/storage/cache_response.cpp +++ b/test/storage/cache_response.cpp @@ -66,7 +66,7 @@ TEST_F(Storage, CacheNotFound) { // Insert existing data into the cache that will be marked as stale. Response response; response.data = std::make_shared<const std::string>("existing data"); - cache.put(resource, response, SQLiteCache::Hint::Full); + cache.put(resource, response); std::unique_ptr<FileRequest> req1; std::unique_ptr<WorkRequest> req2; @@ -124,7 +124,7 @@ TEST_F(Storage, DontCacheConnectionErrors) { // Insert existing data into the cache that will be marked as stale. Response response; response.data = std::make_shared<const std::string>("existing data"); - cache.put(resource, response, SQLiteCache::Hint::Full); + cache.put(resource, response); std::unique_ptr<FileRequest> req1; std::unique_ptr<WorkRequest> req2; @@ -180,7 +180,7 @@ TEST_F(Storage, DontCacheServerErrors) { // Insert existing data into the cache that will be marked as stale. Response response; response.data = std::make_shared<const std::string>("existing data"); - cache.put(resource, response, SQLiteCache::Hint::Full); + cache.put(resource, response); std::unique_ptr<FileRequest> req1; std::unique_ptr<WorkRequest> req2; diff --git a/test/storage/cache_size.cpp b/test/storage/cache_size.cpp index 7cea572139..4ef4371e98 100644 --- a/test/storage/cache_size.cpp +++ b/test/storage/cache_size.cpp @@ -53,7 +53,7 @@ void insertTile(mbgl::SQLiteCache* cache, unsigned id, uint64_t size) { response.data = data; Resource resource{ Resource::Kind::Tile, url }; - cache->put(resource, response, SQLiteCache::Hint::Full); + cache->put(resource, response); } void refreshTile(mbgl::SQLiteCache* cache, unsigned id) { @@ -64,9 +64,10 @@ void refreshTile(mbgl::SQLiteCache* cache, unsigned id) { Response response; response.modified = toSeconds(SystemClock::now()); response.expires = toSeconds(SystemClock::now()) + Seconds(5000); + response.notModified = true; Resource resource{ Resource::Kind::Tile, url }; - cache->put(resource, response, SQLiteCache::Hint::Refresh); + cache->put(resource, response); } uint64_t cacheSize(mbgl::SQLiteCache* cache, unsigned entryCount, uint64_t entrySize) { |