32 #define CATCH_CONFIG_MAIN
33 #include <catch2/catch_amalgamated.hpp>
63 std::vector<TrivialType> array(capacity);
91 std::vector<TrivialType> array(len);
122 std::vector<TrivialType> data = createIntArray(len, startValue);
132 INFO_STR(
"\n\ntest01a_Read1Write1\n");
138 std::thread getThread01(&TestRingbuffer11::getThreadType01,
this,
"test01a.get01", &rb, capacity);
139 std::thread putThread01(&TestRingbuffer11::putThreadType01,
this,
"test01a.put01", &rb, capacity, 0);
148 INFO_STR(
"\n\ntest01b_Read1Write1_Range\n");
154 std::thread getThread01(&TestRingbuffer11::getRangeThreadType02,
this,
"test01b.getR01", &rb, capacity);
155 std::thread putThread01(&TestRingbuffer11::putRangeThreadType02,
this,
"test01b.putR01", &rb, capacity, 0);
164 INFO_STR(
"\n\ntest02a_Read4Write1\n");
170 std::thread getThread01(&TestRingbuffer11::getThreadType01,
this,
"test02a.get01", &rb, capacity/4);
171 std::thread getThread02(&TestRingbuffer11::getThreadType01,
this,
"test02a.get02", &rb, capacity/4);
172 std::thread putThread01(&TestRingbuffer11::putThreadType01,
this,
"test02a.put01", &rb, capacity, 0);
173 std::thread getThread03(&TestRingbuffer11::getThreadType01,
this,
"test02a.get03", &rb, capacity/4);
174 std::thread getThread04(&TestRingbuffer11::getThreadType01,
this,
"test02a.get04", &rb, capacity/4);
186 INFO_STR(
"\n\ntest02b_Read4Write1_Range\n");
192 std::thread getThread01(&TestRingbuffer11::getRangeThreadType02,
this,
"test02b.getR01", &rb, capacity/4);
193 std::thread getThread02(&TestRingbuffer11::getRangeThreadType02,
this,
"test02b.getR02", &rb, capacity/4);
194 std::thread putThread01(&TestRingbuffer11::putRangeThreadType02,
this,
"test02b.putR01", &rb, capacity, 0);
195 std::thread getThread03(&TestRingbuffer11::getRangeThreadType02,
this,
"test02b.getR03", &rb, capacity/4);
196 std::thread getThread04(&TestRingbuffer11::getRangeThreadType02,
this,
"test02b.getR04", &rb, capacity/4);
208 INFO_STR(
"\n\ntest03a_Read8Write2\n");
214 std::thread getThread01(&TestRingbuffer11::getThreadType01,
this,
"test03a.get01", &rb, capacity/8);
215 std::thread getThread02(&TestRingbuffer11::getThreadType01,
this,
"test03a.get02", &rb, capacity/8);
216 std::thread putThread01(&TestRingbuffer11::putThreadType01,
this,
"test03a.put01", &rb, capacity/2, 0);
217 std::thread getThread03(&TestRingbuffer11::getThreadType01,
this,
"test03a.get03", &rb, capacity/8);
218 std::thread getThread04(&TestRingbuffer11::getThreadType01,
this,
"test03a.get04", &rb, capacity/8);
220 std::thread getThread05(&TestRingbuffer11::getThreadType01,
this,
"test03a.get05", &rb, capacity/8);
221 std::thread getThread06(&TestRingbuffer11::getThreadType01,
this,
"test03a.get06", &rb, capacity/8);
222 std::thread putThread02(&TestRingbuffer11::putThreadType01,
this,
"test03a.put02", &rb, capacity/2, 400);
223 std::thread getThread07(&TestRingbuffer11::getThreadType01,
this,
"test03a.get07", &rb, capacity/8);
224 std::thread getThread08(&TestRingbuffer11::getThreadType01,
this,
"test03a.get08", &rb, capacity/8);
242 INFO_STR(
"\n\ntest03b_Read8Write2_Range\n");
248 std::thread getThread01(&TestRingbuffer11::getRangeThreadType02,
this,
"test03b.getR01", &rb, capacity/8);
249 std::thread getThread02(&TestRingbuffer11::getRangeThreadType02,
this,
"test03b.getR02", &rb, capacity/8);
250 std::thread putThread01(&TestRingbuffer11::putRangeThreadType02,
this,
"test03b.putR01", &rb, capacity/2, 0);
251 std::thread getThread03(&TestRingbuffer11::getRangeThreadType02,
this,
"test03b.getR03", &rb, capacity/8);
252 std::thread getThread04(&TestRingbuffer11::getRangeThreadType02,
this,
"test03b.getR04", &rb, capacity/8);
254 std::thread getThread05(&TestRingbuffer11::getRangeThreadType02,
this,
"test03b.getR05", &rb, capacity/8);
255 std::thread getThread06(&TestRingbuffer11::getRangeThreadType02,
this,
"test03b.getR06", &rb, capacity/8);
256 std::thread putThread02(&TestRingbuffer11::putRangeThreadType02,
this,
"test03b.putR02", &rb, capacity/2, 400);
257 std::thread getThread07(&TestRingbuffer11::getRangeThreadType02,
this,
"test03b.getR07", &rb, capacity/8);
258 std::thread getThread08(&TestRingbuffer11::getRangeThreadType02,
this,
"test03b.getR08", &rb, capacity/8);
276 test01a_Read1Write1();
277 test02a_Read4Write1();
278 test03a_Read8Write2();
280 test01a_Read1Write1();
281 test02a_Read4Write1();
282 test03a_Read8Write2();
284 test03a_Read8Write2();
285 test03a_Read8Write2();
286 test03a_Read8Write2();
290 test01b_Read1Write1_Range();
291 test02b_Read4Write1_Range();
292 test03b_Read8Write2_Range();
294 test01b_Read1Write1_Range();
295 test02b_Read4Write1_Range();
296 test03b_Read8Write2_Range();
298 test01b_Read1Write1_Range();
299 test02b_Read4Write1_Range();
300 test03b_Read8Write2_Range();