From 363d7a69497aac9031e1635152a26c203095fb6e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 3 Mar 2024 13:30:43 +0100 Subject: a! --- src/timer.hpp | 3 ++- test/critter.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/timer.hpp b/src/timer.hpp index 96b652f7..1835d7e4 100644 --- a/src/timer.hpp +++ b/src/timer.hpp @@ -186,7 +186,8 @@ struct Ns uint64_t stamp; }; -constexpr inline Ns Second{1000000000}, Millisecond{1000000}; +constexpr inline Ns Second{1000000000}, Millisecond{1000000}, Microsecond{1000}; +constexpr inline const Ns& Seconds{Second}, Milliseconds{Millisecond}, Microseconds{Microsecond}; struct Time final { diff --git a/test/critter.cpp b/test/critter.cpp index 0f4f1a9e..c6845fd1 100644 --- a/test/critter.cpp +++ b/test/critter.cpp @@ -19,10 +19,11 @@ constexpr auto constantly(const auto& x) noexcept { } template -void run(StringView name, const F& make_dt, critter& npc, const Ns max_time, +void run(StringView name, const F& make_dt, critter& npc, const point start, const rotation r, const point end, const Ns expected_time, - const uint32_t fuzz_pixels, const Ns fuzz_time, bool no_crash = false) + const uint32_t fuzz_pixels, const Ns fuzz_time, + const Ns max_time = Second*300, bool no_crash = false) { constexpr uint32_t max_steps = 10'000; fm_assert(max_time < Second*300); @@ -32,7 +33,6 @@ void run(StringView name, const F& make_dt, critter& npc, const Ns max_time, char buf[81]; Ns time{0}; - uint32_t steps; Debug{} << name << npc.position(); @@ -132,7 +132,7 @@ template void test1(const F& make_dt, int accel) w[chunk_coords_{0,0,0}].mark_modified(); w[chunk_coords_{0,1,0}].mark_modified(); - run("test1"_s, make_dt, *player, Second*20, init, N, end, Second*7, 16, Millisecond*350); + run("test1"_s, make_dt, *player, init, N, end, Second*7, 16, Second*60); } /* ***** TEST 2 ***** -- cgit v1.2.3