Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sign warning #2293

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions libmamba/tests/test_execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ namespace mamba
// are being scheduled concurrently.
// Joins all threads before exiting.
template <typename Func>
void execute_tasks_from_concurrent_threads(size_t task_count,
size_t tasks_per_thread,
void execute_tasks_from_concurrent_threads(std::size_t task_count,
std::size_t tasks_per_thread,
Func work)
{
std::vector<std::thread> producers;
size_t tasks_left_to_launch = task_count;
std::size_t tasks_left_to_launch = task_count;
while (tasks_left_to_launch > 0)
{
const size_t tasks_to_generate = std::min(tasks_per_thread, tasks_left_to_launch);
const std::size_t tasks_to_generate = std::min(tasks_per_thread, tasks_left_to_launch);
producers.emplace_back(
[=]
{
for (int i = 0; i < tasks_to_generate; ++i)
for (std::size_t i = 0; i < tasks_to_generate; ++i)
{
work();
}
Expand Down Expand Up @@ -57,8 +57,8 @@ namespace mamba

TEST(execution, tasks_complete_before_destruction_ends)
{
const size_t arbitrary_task_count = 2048;
const size_t arbitrary_tasks_per_generator = 24;
constexpr std::size_t arbitrary_task_count = 2048;
constexpr std::size_t arbitrary_tasks_per_generator = 24;
std::atomic<int> counter{ 0 };
{
MainExecutor executor;
Expand All @@ -72,8 +72,8 @@ namespace mamba

TEST(execution, closed_prevents_more_scheduling_and_joins)
{
const size_t arbitrary_task_count = 2048;
const size_t arbitrary_tasks_per_generator = 36;
constexpr std::size_t arbitrary_task_count = 2048;
constexpr std::size_t arbitrary_tasks_per_generator = 36;
std::atomic<int> counter{ 0 };
{
MainExecutor executor;
Expand Down