threading test: zero initialize counter

The high performance test atomic counters need to be set to zero to have reliable results.
This commit is contained in:
Sandy 2020-11-16 01:13:14 -05:00 committed by GitHub
parent 94b9616b3a
commit 36466231d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -174,8 +174,8 @@ TEST_CASE("HighResolutionTimer") {
{
const auto interval1 = 100ms;
const auto interval2 = 200ms;
std::atomic<uint64_t> counter1;
std::atomic<uint64_t> counter2;
std::atomic<uint64_t> counter1(0);
std::atomic<uint64_t> counter2(0);
auto start = std::chrono::steady_clock::now();
auto cb1 = [&counter1] { ++counter1; };
auto cb2 = [&counter2] { ++counter2; };