summaryrefslogtreecommitdiff
path: root/test/storage/cache_shared.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/storage/cache_shared.cpp')
-rw-r--r--test/storage/cache_shared.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/test/storage/cache_shared.cpp b/test/storage/cache_shared.cpp
deleted file mode 100644
index 89ef3bfb84..0000000000
--- a/test/storage/cache_shared.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "storage.hpp"
-
-#include <mbgl/storage/sqlite_cache.hpp>
-#include <mbgl/storage/resource.hpp>
-#include <mbgl/util/run_loop.hpp>
-
-TEST_F(Storage, CacheShared) {
- SCOPED_TEST(CacheShared)
- using namespace mbgl;
-
- util::RunLoop loop;
-
- // Check that we're getting two different caches when we request different paths.
- auto memory = SQLiteCache::getShared();
- auto file = SQLiteCache::getShared("test/fixtures/database/cache.db");
- EXPECT_NE(memory.get(), file.get());
- EXPECT_EQ(memory.get(), SQLiteCache::getShared().get());
-
- // Store a response into the memory file cache, then delete the last reference.
- const Resource resource { Resource::Kind::Unknown, "http://example.com" };
- memory->put(resource, Response());
- memory.reset();
-
- // Now check that the original memory file cache has been destructed and that it doesn't contain
- // the information we put into it.
- memory = SQLiteCache::getShared();
- auto req = memory->get(resource, [&](std::unique_ptr<Response> res) {
- EXPECT_FALSE(res.get());
- CacheShared.finish();
- loop.stop();
- });
-
- loop.run();
-}