summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-03 13:13:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-04 06:58:13 +0100
commit358e8905d4aa34073a3702ea106dc59a252582f1 (patch)
treee40d630658f8aeeb36b5f48f4a47e8d9cc15e552 /test
parent23a7a6defc0f30f8d053ae4ec65ed8046ce9f4e5 (diff)
test/critter: a??
Diffstat (limited to 'test')
-rw-r--r--test/critter.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/test/critter.cpp b/test/critter.cpp
index 4e215ab2..0f4f1a9e 100644
--- a/test/critter.cpp
+++ b/test/critter.cpp
@@ -36,7 +36,6 @@ void run(StringView name, const F& make_dt, critter& npc, const Ns max_time,
Debug{} << name << npc.position();
- auto last_pos = npc.position();
uint32_t i;
bool stopped = false;
@@ -45,20 +44,25 @@ void run(StringView name, const F& make_dt, critter& npc, const Ns max_time,
for (i = 0; i <= max_steps; i++)
{
auto dt = Ns{make_dt()};
- fm_assert(dt == Millisecond * 100);
- const auto pos = npc.position();
- Debug{} << "-" << pos << colon(',') << "time" << time << Debug::nospace << ", dt" << dt;
+ //fm_assert(dt == Millisecond * 100);
+ const auto last_pos = npc.position();
+ Debug{} << "-" << last_pos << colon(',')
+ << "time" << time
+ << Debug::nospace << ", dt" << dt;
fm_assert(dt >= Millisecond*1e-1);
fm_assert(dt <= Second * 1000);
npc.update_movement(index, dt, r);
+ const auto pos = npc.position();
time += dt;
if (pos == last_pos)
{
stopped = true;
+ Debug{} << "-" << last_pos << colon(',')
+ << "time" << time << Debug::nospace
+ << ", dt" << dt;
+ Debug{} << "break!";
break;
}
- last_pos = pos;
-
if (time > max_time) [[unlikely]]
{
Error{&std::cerr} << "timeout:" << max_time << "reached!";