@@ -158,8 +158,7 @@ typedef CCheckQueue<FrozenCleanupCheck> FrozenCleanup_Queue;
158
158
*/
159
159
static void Correct_Queue_range (std::vector<size_t > range)
160
160
{
161
- auto small_queue = std::make_unique<Correct_Queue>(QUEUE_BATCH_SIZE);
162
- small_queue->StartWorkerThreads (SCRIPT_CHECK_THREADS);
161
+ auto small_queue = std::make_unique<Correct_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS);
163
162
// Make vChecks here to save on malloc (this test can be slow...)
164
163
std::vector<FakeCheckCheckCompletion> vChecks;
165
164
vChecks.reserve (9 );
@@ -217,9 +216,7 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_Random)
217
216
/* * Test that failing checks are caught */
218
217
BOOST_AUTO_TEST_CASE (test_CheckQueue_Catches_Failure)
219
218
{
220
- auto fail_queue = std::make_unique<Failing_Queue>(QUEUE_BATCH_SIZE);
221
- fail_queue->StartWorkerThreads (SCRIPT_CHECK_THREADS);
222
-
219
+ auto fail_queue = std::make_unique<Failing_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS);
223
220
for (size_t i = 0 ; i < 1001 ; ++i) {
224
221
CCheckQueueControl<FailingCheck> control (fail_queue.get ());
225
222
size_t remaining = i;
@@ -244,9 +241,7 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_Catches_Failure)
244
241
// future blocks, ie, the bad state is cleared.
245
242
BOOST_AUTO_TEST_CASE (test_CheckQueue_Recovers_From_Failure)
246
243
{
247
- auto fail_queue = std::make_unique<Failing_Queue>(QUEUE_BATCH_SIZE);
248
- fail_queue->StartWorkerThreads (SCRIPT_CHECK_THREADS);
249
-
244
+ auto fail_queue = std::make_unique<Failing_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS);
250
245
for (auto times = 0 ; times < 10 ; ++times) {
251
246
for (const bool end_fails : {true , false }) {
252
247
CCheckQueueControl<FailingCheck> control (fail_queue.get ());
@@ -267,9 +262,7 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_Recovers_From_Failure)
267
262
// more than once as well
268
263
BOOST_AUTO_TEST_CASE (test_CheckQueue_UniqueCheck)
269
264
{
270
- auto queue = std::make_unique<Unique_Queue>(QUEUE_BATCH_SIZE);
271
- queue->StartWorkerThreads (SCRIPT_CHECK_THREADS);
272
-
265
+ auto queue = std::make_unique<Unique_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS);
273
266
size_t COUNT = 100000 ;
274
267
size_t total = COUNT;
275
268
{
@@ -301,8 +294,7 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_UniqueCheck)
301
294
// time could leave the data hanging across a sequence of blocks.
302
295
BOOST_AUTO_TEST_CASE (test_CheckQueue_Memory)
303
296
{
304
- auto queue = std::make_unique<Memory_Queue>(QUEUE_BATCH_SIZE);
305
- queue->StartWorkerThreads (SCRIPT_CHECK_THREADS);
297
+ auto queue = std::make_unique<Memory_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS);
306
298
for (size_t i = 0 ; i < 1000 ; ++i) {
307
299
size_t total = i;
308
300
{
@@ -327,9 +319,8 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_Memory)
327
319
// have been destructed
328
320
BOOST_AUTO_TEST_CASE (test_CheckQueue_FrozenCleanup)
329
321
{
330
- auto queue = std::make_unique<FrozenCleanup_Queue>(QUEUE_BATCH_SIZE);
322
+ auto queue = std::make_unique<FrozenCleanup_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS );
331
323
bool fails = false ;
332
- queue->StartWorkerThreads (SCRIPT_CHECK_THREADS);
333
324
std::thread t0 ([&]() {
334
325
CCheckQueueControl<FrozenCleanupCheck> control (queue.get ());
335
326
std::vector<FrozenCleanupCheck> vChecks (1 );
@@ -362,7 +353,7 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)
362
353
/* * Test that CCheckQueueControl is threadsafe */
363
354
BOOST_AUTO_TEST_CASE (test_CheckQueueControl_Locks)
364
355
{
365
- auto queue = std::make_unique<Standard_Queue>(QUEUE_BATCH_SIZE);
356
+ auto queue = std::make_unique<Standard_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS );
366
357
{
367
358
std::vector<std::thread> tg;
368
359
std::atomic<int > nThreads {0 };
0 commit comments