Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Sep 1, 2023
1 parent caf87dc commit 4aec0a5
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace xtd::tests {
interlocked::increment(count);
}};
thread_pool::queue_user_work_item(action);
thread::sleep(5);
thread_pool::close();
assert::are_equal(1, count, csf_);
}
Expand All @@ -43,8 +44,10 @@ namespace xtd::tests {
interlocked::increment(count);
}};
thread_pool::queue_user_work_item(action);
thread::sleep(5);
thread_pool::close();
thread_pool::queue_user_work_item(action);
thread::sleep(5);
thread_pool::close();
assert::are_equal(2, count, csf_);
}
Expand All @@ -59,6 +62,7 @@ namespace xtd::tests {
}};
for (auto index = 0ul; index < min_worker_threads; ++index)
thread_pool::queue_user_work_item(action);
thread::sleep(5);
thread_pool::close();
assert::are_equal(min_worker_threads, count, csf_);
}
Expand All @@ -73,6 +77,7 @@ namespace xtd::tests {
}};
for (auto index = 0ul; index < max_worker_threads; ++index)
thread_pool::queue_user_work_item(action);
thread::sleep(5);
thread_pool::close();
assert::are_equal(max_worker_threads, count, csf_);
}
Expand All @@ -87,6 +92,7 @@ namespace xtd::tests {
}};
for (auto index = 0ul; index < 2 * max_worker_threads; ++index)
thread_pool::queue_user_work_item(action);
thread::sleep(5);
thread_pool::close();
assert::are_equal(2 * max_worker_threads, count, csf_);
}
Expand Down

0 comments on commit 4aec0a5

Please sign in to comment.