diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-11-13 17:47:22 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-12-01 11:49:02 +0200 |
commit | cb06526b10d9ef44b3606c36aec498822884251e (patch) | |
tree | 822be48cb08a3cb51074689fbef4f92578a556ed /test/sprite | |
parent | ae3f1c79faa34337628d671d071a82ac97a66081 (diff) | |
download | qtlocation-mapboxgl-cb06526b10d9ef44b3606c36aec498822884251e.tar.gz |
[tests] Remove libuv dependency from the tests
Diffstat (limited to 'test/sprite')
-rw-r--r-- | test/sprite/sprite_store.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/sprite/sprite_store.cpp b/test/sprite/sprite_store.cpp index 14ea6c957b..fd8f3616f5 100644 --- a/test/sprite/sprite_store.cpp +++ b/test/sprite/sprite_store.cpp @@ -4,6 +4,7 @@ #include <mbgl/sprite/sprite_store.hpp> +#include <mbgl/util/async_task.hpp> #include <mbgl/util/run_loop.hpp> #include <mbgl/util/thread.hpp> @@ -186,9 +187,9 @@ private: class SpriteTest : public testing::Test { protected: void runTest(const SpriteParams& params, FileSource* fileSource, SpriteTestCallback callback) { - util::RunLoop loop(uv_default_loop()); + util::RunLoop loop; - async_ = std::make_unique<uv::async>(loop.get(), [&] { loop.stop(); }); + async_ = std::make_unique<util::AsyncTask>([&] { loop.stop(); }); async_->unref(); const util::ThreadContext context = {"Map", util::ThreadType::Map, util::ThreadPriority::Regular}; @@ -196,7 +197,7 @@ protected: util::Thread<SpriteThread> tester(context, fileSource, callback); tester.invoke(&SpriteThread::loadSprite, params); - uv_run(loop.get(), UV_RUN_DEFAULT); + loop.run(); tester.invoke(&SpriteThread::unloadSprite); } @@ -206,7 +207,7 @@ protected: } private: - std::unique_ptr<uv::async> async_; + std::unique_ptr<util::AsyncTask> async_; }; TEST_F(SpriteTest, LoadingSuccess) { |