diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-27 17:19:35 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-27 17:49:10 -0700 |
commit | 4ef2bcc01a6c5b00c1cdeea6b95773fb78a13c4d (patch) | |
tree | d19699e2aa544a3caf34dac82ed65bcfd01644b3 /test | |
parent | bd0f5ae5e26ec70d4db35f24c8e2902d66af2291 (diff) | |
download | qtlocation-mapboxgl-4ef2bcc01a6c5b00c1cdeea6b95773fb78a13c4d.tar.gz |
Don't create libuv objects on the stack
Diffstat (limited to 'test')
-rw-r--r-- | test/storage/http_retry_network_status.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/storage/http_retry_network_status.cpp b/test/storage/http_retry_network_status.cpp index 238108153d..14cdae02c7 100644 --- a/test/storage/http_retry_network_status.cpp +++ b/test/storage/http_retry_network_status.cpp @@ -1,6 +1,6 @@ #include "storage.hpp" -#include <uv.h> +#include <mbgl/util/uv_detail.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/storage/network_status.hpp> @@ -36,17 +36,15 @@ TEST_F(Storage, HTTPNetworkStatusChange) { }); // After 50 milliseconds, we're going to trigger a NetworkStatus change. - uv_timer_t reachableTimer; - uv_timer_init(uv_default_loop(), &reachableTimer); - uv_timer_start(&reachableTimer, [] (uv_timer_t*) { + uv::timer reachableTimer(uv_default_loop()); + reachableTimer.start(50, 0, [] () { mbgl::NetworkStatus::Reachable(); - }, 50, 0); + }); // This timer will keep the loop alive to make sure we would be getting a response in caes the // network status change triggered another change (which it shouldn't). - uv_timer_t delayTimer; - uv_timer_init(uv_default_loop(), &delayTimer); - uv_timer_start(&delayTimer, [] (uv_timer_t*) {}, 300, 0); + uv::timer delayTimer(uv_default_loop()); + delayTimer.start(300, 0, [] () {}); uv_run(uv_default_loop(), UV_RUN_DEFAULT); } |