ut_helpers.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "mpsc_read_as_filled.h"
  3. #include "mpsc_htswap.h"
  4. #include "mpsc_vinfarr_obstructive.h"
  5. #include "mpsc_intrusive_unordered.h"
  6. #include "mpmc_unordered_ring.h"
  7. struct TBasicHTSwap: public NThreading::THTSwapQueue<> {
  8. };
  9. struct TBasicReadAsFilled: public NThreading::TReadAsFilledQueue<> {
  10. };
  11. struct TBasicObstructiveConsumer
  12. : public NThreading::TObstructiveConsumerQueue<> {
  13. };
  14. struct TBasicMPSCIntrusiveUnordered
  15. : public NThreading::TMPSCIntrusiveUnordered {
  16. };
  17. struct TIntrusiveLink: public NThreading::TIntrusiveNode {
  18. };
  19. struct TMPMCUnorderedRing: public NThreading::TMPMCUnorderedRing {
  20. TMPMCUnorderedRing()
  21. : NThreading::TMPMCUnorderedRing(10000000)
  22. {
  23. }
  24. };
  25. #define REGISTER_TESTS_FOR_ALL_ORDERED_QUEUES(TestTemplate) \
  26. UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicHTSwap>); \
  27. UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicReadAsFilled>); \
  28. UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicObstructiveConsumer>)
  29. #define REGISTER_TESTS_FOR_ALL_UNORDERED_QUEUES(TestTemplate) \
  30. UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicMPSCIntrusiveUnordered>); \
  31. UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TMPMCUnorderedRing>);