Skip to content

Commit

Permalink
Speed up Helpers::Pair test
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Nov 30, 2021
1 parent 797f67f commit 651b82b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Helpers_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,13 @@ TEST(HelpersTest, Pair)

#if !defined _MSC_VER && !defined __arm__
// Iterate over large numbers, and check for unique keys.
for (math::PairInput a = math::MAX_UI32-5000; a < math::MAX_UI32; a++)
for (math::PairInput a = math::MAX_UI32 - 10000;
a < math::MAX_UI32 - 500;
a += math::Rand::IntUniform(100, 500))
{
for (math::PairInput b = math::MAX_UI32-5000; b < math::MAX_UI32; b++)
for (math::PairInput b = math::MAX_UI32 - 10000;
b < math::MAX_UI32 - 500;
b += math::Rand::IntUniform(100, 500))
{
math::PairOutput key = math::Pair(a, b);
std::tie(c, d) = math::Unpair(key);
Expand All @@ -514,6 +518,8 @@ TEST(HelpersTest, Pair)
set.insert(key);
}
}

std::cout << "Tested: " << set.size() << " keys\n.";
#endif
}
}
Expand Down

0 comments on commit 651b82b

Please sign in to comment.