diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-04-13 17:57:45 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-04-13 17:57:45 +0200 |
commit | 16849a341b72c0633be1e3c89498c883d6efb000 (patch) | |
tree | 7450e1c745c8dcd48af809a116bf4899cbc33608 /test/storage/cache_response.cpp | |
parent | 278e6bd556865aa8cad688d4c671d19a1f5e6871 (diff) | |
download | qtlocation-mapboxgl-16849a341b72c0633be1e3c89498c883d6efb000.tar.gz |
hide Thread<> and separate the Implementation object
Diffstat (limited to 'test/storage/cache_response.cpp')
-rw-r--r-- | test/storage/cache_response.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/storage/cache_response.cpp b/test/storage/cache_response.cpp index 46083e2f93..e37899a86f 100644 --- a/test/storage/cache_response.cpp +++ b/test/storage/cache_response.cpp @@ -4,20 +4,19 @@ #include <mbgl/storage/default_file_source.hpp> #include <mbgl/storage/default/sqlite_cache.hpp> -#include <mbgl/util/thread.hpp> TEST_F(Storage, CacheResponse) { SCOPED_TEST(CacheResponse); using namespace mbgl; - util::Thread<SQLiteCache> cache(":memory:"); - util::Thread<DefaultFileSource> fs(cache); + SQLiteCache cache(":memory:"); + DefaultFileSource fs(&cache); const Resource resource { Resource::Unknown, "http://127.0.0.1:3000/cache" }; auto &env = *static_cast<const Environment *>(nullptr); - fs->request(resource, uv_default_loop(), env, [&](const Response &res) { + fs.request(resource, uv_default_loop(), env, [&](const Response &res) { EXPECT_EQ(Response::Successful, res.status); EXPECT_EQ("Response 1", res.data); EXPECT_LT(0, res.expires); @@ -25,7 +24,7 @@ TEST_F(Storage, CacheResponse) { EXPECT_EQ("", res.etag); EXPECT_EQ("", res.message); - fs->request(resource, uv_default_loop(), env, [&, res](const Response &res2) { + fs.request(resource, uv_default_loop(), env, [&, res](const Response &res2) { EXPECT_EQ(res.status, res2.status); EXPECT_EQ(res.data, res2.data); EXPECT_EQ(res.expires, res2.expires); |