From 651b82b6d7253627cc228e9875668b5ba76be352 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 30 Nov 2021 13:59:27 -0600 Subject: [PATCH] Speed up Helpers::Pair test Signed-off-by: Michael Carroll --- src/Helpers_TEST.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Helpers_TEST.cc b/src/Helpers_TEST.cc index 21bf2ac0e..36741ee25 100644 --- a/src/Helpers_TEST.cc +++ b/src/Helpers_TEST.cc @@ -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); @@ -514,6 +518,8 @@ TEST(HelpersTest, Pair) set.insert(key); } } + + std::cout << "Tested: " << set.size() << " keys\n."; #endif } }