summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/tdutils/test/MpscLinkQueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/tdlib/td/tdutils/test/MpscLinkQueue.cpp')
-rw-r--r--protocols/Telegram/tdlib/td/tdutils/test/MpscLinkQueue.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/protocols/Telegram/tdlib/td/tdutils/test/MpscLinkQueue.cpp b/protocols/Telegram/tdlib/td/tdutils/test/MpscLinkQueue.cpp
index 629e5b7223..43b0ccf086 100644
--- a/protocols/Telegram/tdlib/td/tdutils/test/MpscLinkQueue.cpp
+++ b/protocols/Telegram/tdlib/td/tdutils/test/MpscLinkQueue.cpp
@@ -1,16 +1,17 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2018
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
+#include "td/utils/common.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/MpscLinkQueue.h"
#include "td/utils/port/thread.h"
#include "td/utils/tests.h"
-class NodeX : public td::MpscLinkQueueImpl::Node {
+class NodeX final : public td::MpscLinkQueueImpl::Node {
public:
explicit NodeX(int value) : value_(value) {
}
@@ -29,8 +30,8 @@ class NodeX : public td::MpscLinkQueueImpl::Node {
};
using QueueNode = td::MpscLinkQueueUniquePtrNode<NodeX>;
-QueueNode create_node(int value) {
- return QueueNode(std::make_unique<NodeX>(value));
+static QueueNode create_node(int value) {
+ return QueueNode(td::make_unique<NodeX>(value));
}
TEST(MpscLinkQueue, one_thread) {
@@ -48,7 +49,7 @@ TEST(MpscLinkQueue, one_thread) {
while (auto node = reader.read()) {
v.push_back(node.value().value());
}
- CHECK((v == std::vector<int>{1, 2, 3, 4})) << td::format::as_array(v);
+ LOG_CHECK((v == std::vector<int>{1, 2, 3, 4})) << td::format::as_array(v);
v.clear();
queue.push(create_node(5));
@@ -56,7 +57,7 @@ TEST(MpscLinkQueue, one_thread) {
while (auto node = reader.read()) {
v.push_back(node.value().value());
}
- CHECK((v == std::vector<int>{5})) << td::format::as_array(v);
+ LOG_CHECK((v == std::vector<int>{5})) << td::format::as_array(v);
}
{
@@ -70,7 +71,7 @@ TEST(MpscLinkQueue, one_thread) {
while (auto node = reader.read()) {
v.push_back(node.value().value());
}
- CHECK((v == std::vector<int>{3, 2, 1, 0})) << td::format::as_array(v);
+ LOG_CHECK((v == std::vector<int>{3, 2, 1, 0})) << td::format::as_array(v);
}
}
@@ -112,4 +113,4 @@ TEST(MpscLinkQueue, multi_thread) {
thread.join();
}
}
-#endif //!TD_THREAD_UNSUPPORTED
+#endif