aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/queue/ut_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'library/cpp/threading/queue/ut_helpers.h')
-rw-r--r--library/cpp/threading/queue/ut_helpers.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/library/cpp/threading/queue/ut_helpers.h b/library/cpp/threading/queue/ut_helpers.h
new file mode 100644
index 0000000000..2756b52601
--- /dev/null
+++ b/library/cpp/threading/queue/ut_helpers.h
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "mpsc_read_as_filled.h"
+#include "mpsc_htswap.h"
+#include "mpsc_vinfarr_obstructive.h"
+#include "mpsc_intrusive_unordered.h"
+#include "mpmc_unordered_ring.h"
+
+struct TBasicHTSwap: public NThreading::THTSwapQueue<> {
+};
+
+struct TBasicReadAsFilled: public NThreading::TReadAsFilledQueue<> {
+};
+
+struct TBasicObstructiveConsumer
+ : public NThreading::TObstructiveConsumerQueue<> {
+};
+
+struct TBasicMPSCIntrusiveUnordered
+ : public NThreading::TMPSCIntrusiveUnordered {
+};
+
+struct TIntrusiveLink: public NThreading::TIntrusiveNode {
+};
+
+struct TMPMCUnorderedRing: public NThreading::TMPMCUnorderedRing {
+ TMPMCUnorderedRing()
+ : NThreading::TMPMCUnorderedRing(10000000)
+ {
+ }
+};
+
+#define REGISTER_TESTS_FOR_ALL_ORDERED_QUEUES(TestTemplate) \
+ UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicHTSwap>); \
+ UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicReadAsFilled>); \
+ UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicObstructiveConsumer>)
+
+#define REGISTER_TESTS_FOR_ALL_UNORDERED_QUEUES(TestTemplate) \
+ UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicMPSCIntrusiveUnordered>); \
+ UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TMPMCUnorderedRing>);