Skip to content

Commit

Permalink
merging v25
Browse files Browse the repository at this point in the history
  • Loading branch information
coranos committed May 26, 2023
1 parent 292a8fe commit 1a7b21b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nano/core_test/processing_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TEST (processing_queue, process_one)
queue.process_batch = [&] (auto & batch) {
processed += batch.size ();
};
queue.start ();
nano::test::start_stop_guard queue_guard{ queue };

queue.add (1);

Expand All @@ -41,7 +41,7 @@ TEST (processing_queue, process_many)
queue.process_batch = [&] (auto & batch) {
processed += batch.size ();
};
queue.start ();
nano::test::start_stop_guard queue_guard{ queue };

const int count = 1024;
for (int n = 0; n < count; ++n)
Expand Down Expand Up @@ -87,7 +87,7 @@ TEST (processing_queue, max_batch_size)
max_batch = batch.size ();
}
};
queue.start ();
nano::test::start_stop_guard queue_guard{ queue };

ASSERT_TIMELY (5s, max_batch == 128);
ASSERT_ALWAYS (1s, max_batch == 128);
Expand All @@ -104,7 +104,7 @@ TEST (processing_queue, parallel)
std::this_thread::sleep_for (2s);
processed += batch.size ();
};
queue.start ();
nano::test::start_stop_guard queue_guard{ queue };

const int count = 16;
for (int n = 0; n < count; ++n)
Expand All @@ -116,4 +116,4 @@ TEST (processing_queue, parallel)
// If processing is done in parallel it should take ~2 seconds to process every item, but keep some margin for slow machines
ASSERT_TIMELY (3s, processed == count);
ASSERT_EQ (queue.size (), 0);
}
}

0 comments on commit 1a7b21b

Please sign in to comment.