summaryrefslogtreecommitdiff
path: root/test/util
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-16 11:35:26 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-17 09:28:26 -0700
commit4c26759b69bf1c5ef12b244562784f97d773315f (patch)
tree1dd045f2d8fd33e60a1ab562018a263ce1e16561 /test/util
parentc2f7f48a223a2a3ba7bf6c8eb2f405edd77a9593 (diff)
downloadqtlocation-mapboxgl-4c26759b69bf1c5ef12b244562784f97d773315f.tar.gz
[core] Remove WorkQueue
No longer used as of 5cdf838a387cae446dba500ac49a1c5524bf7949.
Diffstat (limited to 'test/util')
-rw-r--r--test/util/work_queue.test.cpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/test/util/work_queue.test.cpp b/test/util/work_queue.test.cpp
deleted file mode 100644
index 60c72f7358..0000000000
--- a/test/util/work_queue.test.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <mbgl/test/util.hpp>
-
-#include <mbgl/util/run_loop.hpp>
-#include <mbgl/util/thread.hpp>
-#include <mbgl/util/work_queue.hpp>
-
-#include <thread>
-
-using namespace mbgl::util;
-
-class TestThread {
-public:
- TestThread(WorkQueue* queue_) : queue(queue_) {}
-
- void send(std::function<void()>&& fn) {
- queue->push(std::move(fn));
- }
-
-private:
- WorkQueue* queue;
-};
-
-TEST(WorkQueue, push) {
- RunLoop loop;
-
- WorkQueue queue;
- Thread<TestThread> thread({"Test"}, &queue);
-
- uint8_t count = 0;
-
- auto endTest = [&]() {
- if (++count == 4) {
- loop.stop();
- }
- };
-
- thread.invoke(&TestThread::send, endTest);
- thread.invoke(&TestThread::send, endTest);
- thread.invoke(&TestThread::send, endTest);
- thread.invoke(&TestThread::send, endTest);
-
- loop.run();
-}
-
-TEST(WorkQueue, cancel) {
- RunLoop loop;
-
- WorkQueue queue;
-
- auto work = [&]() {
- FAIL() << "Should never be called";
- };
-
- queue.push(work);
- queue.push(work);
- queue.push(work);
- queue.push(work);
- queue.push(work);
-}