25 using namespace folly;
28 using std::chrono::steady_clock;
29 using std::chrono::system_clock;
34 run_basic_test<true, std::atomic>();
35 run_basic_test<true, EmulatedFutexAtomic>();
36 run_basic_test<true, DeterministicAtomic>();
40 run_basic_test<false, std::atomic>();
41 run_basic_test<false, EmulatedFutexAtomic>();
42 run_basic_test<false, DeterministicAtomic>();
50 run_pingpong_test<true, DeterministicAtomic>(1000);
56 run_pingpong_test<false, DeterministicAtomic>(1000);
61 TEST(
Baton, timed_wait_basic_system_clock_blocking) {
62 run_basic_timed_wait_tests<true, std::atomic, system_clock>();
63 run_basic_timed_wait_tests<true, EmulatedFutexAtomic, system_clock>();
64 run_basic_timed_wait_tests<true, DeterministicAtomic, system_clock>();
67 TEST(
Baton, timed_wait_basic_system_clock_nonblocking) {
68 run_basic_timed_wait_tests<false, std::atomic, system_clock>();
69 run_basic_timed_wait_tests<false, EmulatedFutexAtomic, system_clock>();
70 run_basic_timed_wait_tests<false, DeterministicAtomic, system_clock>();
75 TEST(
Baton, timed_wait_timeout_system_clock_blocking) {
77 run_timed_wait_tmo_tests<true, std::atomic, system_clock>();
78 run_timed_wait_tmo_tests<true, EmulatedFutexAtomic, system_clock>();
79 run_timed_wait_tmo_tests<true, DeterministicAtomic, system_clock>();
82 TEST(
Baton, timed_wait_timeout_system_clock_nonblocking) {
84 run_timed_wait_tmo_tests<false, std::atomic, system_clock>();
85 run_timed_wait_tmo_tests<false, EmulatedFutexAtomic, system_clock>();
86 run_timed_wait_tmo_tests<false, DeterministicAtomic, system_clock>();
93 run_timed_wait_regular_test<true, std::atomic, system_clock>();
94 run_timed_wait_regular_test<true, EmulatedFutexAtomic, system_clock>();
95 run_timed_wait_regular_test<true, DeterministicAtomic, system_clock>();
100 run_timed_wait_regular_test<false, std::atomic, system_clock>();
101 run_timed_wait_regular_test<false, EmulatedFutexAtomic, system_clock>();
102 run_timed_wait_regular_test<false, DeterministicAtomic, system_clock>();
109 run_basic_timed_wait_tests<true, std::atomic, steady_clock>();
110 run_basic_timed_wait_tests<true, EmulatedFutexAtomic, steady_clock>();
111 run_basic_timed_wait_tests<true, DeterministicAtomic, steady_clock>();
114 TEST(
Baton, timed_wait_basic_steady_clock_nonblocking) {
116 run_basic_timed_wait_tests<false, std::atomic, steady_clock>();
117 run_basic_timed_wait_tests<false, EmulatedFutexAtomic, steady_clock>();
118 run_basic_timed_wait_tests<false, DeterministicAtomic, steady_clock>();
125 run_timed_wait_tmo_tests<true, std::atomic, steady_clock>();
126 run_timed_wait_tmo_tests<true, EmulatedFutexAtomic, steady_clock>();
127 run_timed_wait_tmo_tests<true, DeterministicAtomic, steady_clock>();
130 TEST(
Baton, timed_wait_timeout_steady_clock_nonblocking) {
132 run_timed_wait_tmo_tests<false, std::atomic, steady_clock>();
133 run_timed_wait_tmo_tests<false, EmulatedFutexAtomic, steady_clock>();
134 run_timed_wait_tmo_tests<false, DeterministicAtomic, steady_clock>();
141 run_timed_wait_regular_test<true, std::atomic, steady_clock>();
142 run_timed_wait_regular_test<true, EmulatedFutexAtomic, steady_clock>();
143 run_timed_wait_regular_test<true, DeterministicAtomic, steady_clock>();
148 run_timed_wait_regular_test<false, std::atomic, steady_clock>();
149 run_timed_wait_regular_test<false, EmulatedFutexAtomic, steady_clock>();
150 run_timed_wait_regular_test<false, DeterministicAtomic, steady_clock>();
156 run_try_wait_tests<true, std::atomic>();
157 run_try_wait_tests<true, EmulatedFutexAtomic>();
158 run_try_wait_tests<true, DeterministicAtomic>();
162 run_try_wait_tests<false, std::atomic>();
163 run_try_wait_tests<false, EmulatedFutexAtomic>();
164 run_try_wait_tests<false, DeterministicAtomic>();
—— Concurrent Priority Queue Implementation ——
static std::function< size_t(size_t)> uniform(uint64_t seed)
TEST(ProgramOptionsTest, Errors)