diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-01-08 23:17:43 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-01-09 01:26:29 +0200 |
commit | d7fdcc73bfcab39f63e547ce2af8435a9859cb08 (patch) | |
tree | 223b8f6bb663fff22ea5f65e487c40d280630cb2 /test | |
parent | e7b0b31d58997ce0c849129d07a97cb0740beb7e (diff) | |
download | qtlocation-mapboxgl-d7fdcc73bfcab39f63e547ce2af8435a9859cb08.tar.gz |
[core] Get rid of ::unref() for Timer and AsyncTask
Not need, legacy from libuv. The RunLoop keep the main
loop running until is explicitly no longer needed.
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/mock_file_source.cpp | 1 | ||||
-rw-r--r-- | test/miscellaneous/async_task.cpp | 3 | ||||
-rw-r--r-- | test/miscellaneous/timer.cpp | 10 | ||||
-rw-r--r-- | test/style/pending_resources.cpp | 1 |
4 files changed, 0 insertions, 15 deletions
diff --git a/test/fixtures/mock_file_source.cpp b/test/fixtures/mock_file_source.cpp index 22c906c173..791e5d314a 100644 --- a/test/fixtures/mock_file_source.cpp +++ b/test/fixtures/mock_file_source.cpp @@ -18,7 +18,6 @@ public: MockFileSource::MockFileSource(Type type_, const std::string& match_) : type(type_), match(match_) { - timer.unref(); timer.start(std::chrono::milliseconds(10), std::chrono::milliseconds(10), [this] { // Explicit move to avoid iterator invalidation if ~MockFileRequest gets called within the loop. auto pending_ = std::move(pending); diff --git a/test/miscellaneous/async_task.cpp b/test/miscellaneous/async_task.cpp index c32c2396fb..8073670fe1 100644 --- a/test/miscellaneous/async_task.cpp +++ b/test/miscellaneous/async_task.cpp @@ -40,7 +40,6 @@ TEST(AsyncTask, RequestCoalescing) { unsigned count = 0; AsyncTask async([&count] { ++count; }); - async.unref(); async.send(); async.send(); @@ -70,7 +69,6 @@ TEST(AsyncTask, RequestCoalescingMultithreaded) { unsigned count = 0; AsyncTask async([&count] { ++count; }); - async.unref(); std::vector<std::unique_ptr<Thread<TestWorker>>> threads; ThreadContext context = {"Test", ThreadType::Map, ThreadPriority::Regular}; @@ -97,7 +95,6 @@ TEST(AsyncTask, ThreadSafety) { unsigned count = 0; AsyncTask async([&count] { ++count; }); - async.unref(); unsigned numThreads = 25; diff --git a/test/miscellaneous/timer.cpp b/test/miscellaneous/timer.cpp index 7e5928406e..521d0e8cc4 100644 --- a/test/miscellaneous/timer.cpp +++ b/test/miscellaneous/timer.cpp @@ -12,7 +12,6 @@ TEST(Timer, Basic) { RunLoop loop; Timer timer; - timer.unref(); auto callback = [&loop] { loop.stop(); }; @@ -38,7 +37,6 @@ TEST(Timer, Repeat) { RunLoop loop; Timer timer; - timer.unref(); unsigned count = 10; auto callback = [&] { @@ -66,10 +64,7 @@ TEST(Timer, Stop) { RunLoop loop; Timer timer1; - timer1.unref(); - Timer timer2; - timer2.unref(); auto interval1 = std::chrono::milliseconds(50); auto interval2 = std::chrono::milliseconds(250); @@ -106,10 +101,7 @@ TEST(Timer, DestroyShouldStop) { RunLoop loop; auto timer1 = std::make_unique<Timer>(); - timer1->unref(); - Timer timer2; - timer2.unref(); auto interval1 = std::chrono::milliseconds(50); auto interval2 = std::chrono::milliseconds(250); @@ -146,7 +138,6 @@ TEST(Timer, StartOverrides) { RunLoop loop; Timer timer; - timer.unref(); auto interval1 = std::chrono::milliseconds(50); auto interval2 = std::chrono::milliseconds(250); @@ -182,6 +173,5 @@ TEST(Timer, CanStopNonStartedTimer) { RunLoop loop; Timer timer; - timer.unref(); timer.stop(); } diff --git a/test/style/pending_resources.cpp b/test/style/pending_resources.cpp index 62aee032da..1115274227 100644 --- a/test/style/pending_resources.cpp +++ b/test/style/pending_resources.cpp @@ -33,7 +33,6 @@ TEST_P(PendingResources, DeleteMapObjectWithPendingRequest) { loop.stop(); }); - endTest.unref(); fileSource.requestEnqueuedCallback = [&endTest] { endTest.send(); }; const std::string style = util::read_file("test/fixtures/resources/style.json"); |