32 #define CATCH_CONFIG_MAIN
33 #include <catch2/catch_amalgamated.hpp>
82 std::vector<TrivialType> array(capacity);
110 std::vector<TrivialType> array(len);
141 std::vector<TrivialType> data = createIntArray(len, startValue);
151 INFO_STR(
"\n\ntest01a_Read1Write1\n");
157 std::thread getThread01(&TestRingbuffer12::getThreadType01,
this,
"test01a.get01", &rb, capacity);
158 std::thread putThread01(&TestRingbuffer12::putThreadType01,
this,
"test01a.put01", &rb, capacity, 0);
167 INFO_STR(
"\n\ntest01b_Read1Write1_Range\n");
173 std::thread getThread01(&TestRingbuffer12::getRangeThreadType02,
this,
"test01b.getR01", &rb, capacity);
174 std::thread putThread01(&TestRingbuffer12::putRangeThreadType02,
this,
"test01b.putR01", &rb, capacity, 0);
183 INFO_STR(
"\n\ntest02a_Read4Write1\n");
189 std::thread getThread01(&TestRingbuffer12::getThreadType01,
this,
"test02a.get01", &rb, capacity/4);
190 std::thread getThread02(&TestRingbuffer12::getThreadType01,
this,
"test02a.get02", &rb, capacity/4);
191 std::thread putThread01(&TestRingbuffer12::putThreadType01,
this,
"test02a.put01", &rb, capacity, 0);
192 std::thread getThread03(&TestRingbuffer12::getThreadType01,
this,
"test02a.get03", &rb, capacity/4);
193 std::thread getThread04(&TestRingbuffer12::getThreadType01,
this,
"test02a.get04", &rb, capacity/4);
205 INFO_STR(
"\n\ntest02b_Read4Write1_Range\n");
211 std::thread getThread01(&TestRingbuffer12::getRangeThreadType02,
this,
"test02b.getR01", &rb, capacity/4);
212 std::thread getThread02(&TestRingbuffer12::getRangeThreadType02,
this,
"test02b.getR02", &rb, capacity/4);
213 std::thread putThread01(&TestRingbuffer12::putRangeThreadType02,
this,
"test02b.putR01", &rb, capacity, 0);
214 std::thread getThread03(&TestRingbuffer12::getRangeThreadType02,
this,
"test02b.getR03", &rb, capacity/4);
215 std::thread getThread04(&TestRingbuffer12::getRangeThreadType02,
this,
"test02b.getR04", &rb, capacity/4);
227 INFO_STR(
"\n\ntest03a_Read8Write2\n");
233 std::thread getThread01(&TestRingbuffer12::getThreadType01,
this,
"test03a.get01", &rb, capacity/8);
234 std::thread getThread02(&TestRingbuffer12::getThreadType01,
this,
"test03a.get02", &rb, capacity/8);
235 std::thread putThread01(&TestRingbuffer12::putThreadType01,
this,
"test03a.put01", &rb, capacity/2, 0);
236 std::thread getThread03(&TestRingbuffer12::getThreadType01,
this,
"test03a.get03", &rb, capacity/8);
237 std::thread getThread04(&TestRingbuffer12::getThreadType01,
this,
"test03a.get04", &rb, capacity/8);
239 std::thread getThread05(&TestRingbuffer12::getThreadType01,
this,
"test03a.get05", &rb, capacity/8);
240 std::thread getThread06(&TestRingbuffer12::getThreadType01,
this,
"test03a.get06", &rb, capacity/8);
241 std::thread putThread02(&TestRingbuffer12::putThreadType01,
this,
"test03a.put02", &rb, capacity/2, 400);
242 std::thread getThread07(&TestRingbuffer12::getThreadType01,
this,
"test03a.get07", &rb, capacity/8);
243 std::thread getThread08(&TestRingbuffer12::getThreadType01,
this,
"test03a.get08", &rb, capacity/8);
261 INFO_STR(
"\n\ntest03b_Read8Write2_Range\n");
267 std::thread getThread01(&TestRingbuffer12::getRangeThreadType02,
this,
"test03b.getR01", &rb, capacity/8);
268 std::thread getThread02(&TestRingbuffer12::getRangeThreadType02,
this,
"test03b.getR02", &rb, capacity/8);
269 std::thread putThread01(&TestRingbuffer12::putRangeThreadType02,
this,
"test03b.putR01", &rb, capacity/2, 0);
270 std::thread getThread03(&TestRingbuffer12::getRangeThreadType02,
this,
"test03b.getR03", &rb, capacity/8);
271 std::thread getThread04(&TestRingbuffer12::getRangeThreadType02,
this,
"test03b.getR04", &rb, capacity/8);
273 std::thread getThread05(&TestRingbuffer12::getRangeThreadType02,
this,
"test03b.getR05", &rb, capacity/8);
274 std::thread getThread06(&TestRingbuffer12::getRangeThreadType02,
this,
"test03b.getR06", &rb, capacity/8);
275 std::thread putThread02(&TestRingbuffer12::putRangeThreadType02,
this,
"test03b.putR02", &rb, capacity/2, 400);
276 std::thread getThread07(&TestRingbuffer12::getRangeThreadType02,
this,
"test03b.getR07", &rb, capacity/8);
277 std::thread getThread08(&TestRingbuffer12::getRangeThreadType02,
this,
"test03b.getR08", &rb, capacity/8);
295 test01a_Read1Write1();
296 test02a_Read4Write1();
297 test03a_Read8Write2();
299 test01a_Read1Write1();
300 test02a_Read4Write1();
301 test03a_Read8Write2();
303 test03a_Read8Write2();
304 test03a_Read8Write2();
305 test03a_Read8Write2();
309 test01b_Read1Write1_Range();
310 test02b_Read4Write1_Range();
311 test03b_Read8Write2_Range();
313 test01b_Read1Write1_Range();
314 test02b_Read4Write1_Range();
315 test03b_Read8Write2_Range();
317 test01b_Read1Write1_Range();
318 test02b_Read4Write1_Range();
319 test03b_Read8Write2_Range();