diff --git a/tile/base/chrono_test.cc b/tile/base/chrono_test.cc index 8df941c..524fbce 100644 --- a/tile/base/chrono_test.cc +++ b/tile/base/chrono_test.cc @@ -5,8 +5,9 @@ namespace tile { static constexpr auto one_ms = std::chrono::milliseconds(1); +static constexpr auto kTestN = 1000; -long AvageTime(std::function f, std::size_t n = 100) { +long AvageTime(std::function f, std::size_t n = kTestN) { long double total = 0; for (std::size_t i = 0; i != n; ++i) { total += 1.0f / n * f(); @@ -34,7 +35,7 @@ TEST(CoarseSystemClock, Compare) { return (ReadCoarseSystemClock() - std::chrono::system_clock::now()) / one_ms; }); - ASSERT_NEAR(diff, 0, 50); + ASSERT_NEAR(diff, 0, kTestN); } TEST(CoarseSteadyClock, Compare) { @@ -42,6 +43,6 @@ TEST(CoarseSteadyClock, Compare) { return (ReadCoarseSteadyClock() - std::chrono::steady_clock::now()) / one_ms; }); - ASSERT_NEAR(diff, 0, 50); + ASSERT_NEAR(diff, 0, kTestN); } } // namespace tile