summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-06 00:10:26 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-06 00:10:53 +0100
commitf5f217397e1370e52695f1b4314bf1527f5955cf (patch)
tree8b65a9f395c3f3d2f5adf557469eb750023b483c /test
parent5bb5b49268e9420c0a20fee29f4dfb7800936665 (diff)
test/critter: show delta value in verbose output
Diffstat (limited to 'test')
-rw-r--r--test/critter.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/critter.cpp b/test/critter.cpp
index 824c34d1..8e480245 100644
--- a/test/critter.cpp
+++ b/test/critter.cpp
@@ -118,12 +118,14 @@ bool run(world& w, const function_view<Ns() const>& make_dt,
if (!start.quiet) [[unlikely]]
Debug{} << "**" << start.name << start.instance << colon();
- constexpr auto print_pos = [](StringView prefix, point start, point pos, Ns time, Ns dt) {
+ constexpr auto print_pos = [](StringView prefix, point start, point pos, Ns time, Ns dt, uint16_t delta) {
DBG_nospace << prefix
<< " " << pos
<< " time:" << time
<< " dt:" << dt
- << " dist:" << point::distance_l2(pos, start);
+ << " dist:" << point::distance_l2(pos, start)
+ << " delta:" << delta;
+ };
auto fail = [b = grace.no_crash](const char* file, int line) {
if (b) [[likely]]
@@ -146,7 +148,7 @@ bool run(world& w, const function_view<Ns() const>& make_dt,
break;
}
if (start.verbose) [[unlikely]]
- print_pos(" ", expected.pt, npc.position(), time, dt);
+ print_pos(" ", expected.pt, npc.position(), time, dt, npc.delta);
fm_assert(dt >= Millisecond*1e-1);
fm_assert(dt <= Second * 1000);
npc.update_movement(index, dt, start.rotation);
@@ -161,7 +163,7 @@ bool run(world& w, const function_view<Ns() const>& make_dt,
{
if (!start.quiet) [[unlikely]]
{
- print_pos("->", expected.pt, pos, time, dt);
+ print_pos("->", expected.pt, pos, time, dt, npc.delta);
DBG_nospace << "===>"
<< " iters,"
<< " time:" << time
@@ -181,13 +183,13 @@ bool run(world& w, const function_view<Ns() const>& make_dt,
if (time > max_time) [[unlikely]]
{
if (!start.quiet) [[unlikely]]
- print_pos("*", start.pt, last_pos, time, dt);
+ print_pos("*", start.pt, last_pos, time, dt, npc.delta);
Error{standard_error()} << "!!! fatal: timeout" << max_time << "reached!";
return fail(__FILE__, __LINE__);
}
if (i > max_steps) [[unlikely]]
{
- print_pos("*", start.pt, last_pos, time, dt);
+ print_pos("*", start.pt, last_pos, time, dt, npc.delta);
Error{standard_error()} << "!!! fatal: position doesn't converge after" << i << "iterations!";
return fail(__FILE__, __LINE__);
}