summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-03 19:17:40 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-04 06:58:20 +0100
commit0979263e1654259e6cac4be2e53ca022f7cbb6df (patch)
treeb34f0c055d87344dd84d20ccab499502513a486d /test
parent4b21182e620f7a1a2e0180865f7ed4116aedd77e (diff)
test/critter: more logging touch-ups
Diffstat (limited to 'test')
-rw-r--r--test/critter.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/critter.cpp b/test/critter.cpp
index d52c1639..012a2aa6 100644
--- a/test/critter.cpp
+++ b/test/critter.cpp
@@ -92,13 +92,14 @@ bool run(StringView subtest_name, critter& npc, const function_view<Ns() const>&
if (!start.quiet) [[unlikely]]
{
if (subtest_name)
- Debug{} << "-----" << start.name << "->" << start.instance << Debug::nospace << subtest_name << "-----";
+ Debug{} << "**" << start.name << "->" << start.instance << Debug::nospace << subtest_name << colon();
else
- Debug{} << "-----" << start.name << subtest_name << "-----";
+ Debug{} << "**" << start.name << subtest_name << colon();
}
constexpr auto print_pos = [](StringView prefix, point start, point pos, Ns time, Ns dt) {
- DBG_nospace << prefix << " " << pos << "--"
+ DBG_nospace << prefix
+ << " " << pos
<< " time:" << time
<< " dt:" << dt
<< " dist:" << point::distance_l2(pos, start);
@@ -114,7 +115,7 @@ bool run(StringView subtest_name, critter& npc, const function_view<Ns() const>&
break;
}
if (start.verbose) [[unlikely]]
- print_pos("-", expected.pt, npc.position(), time, dt);
+ print_pos(" ", expected.pt, npc.position(), time, dt);
fm_assert(dt >= Millisecond*1e-1);
fm_assert(dt <= Second * 1000);
npc.update_movement(index, dt, start.rotation);
@@ -128,14 +129,17 @@ bool run(StringView subtest_name, critter& npc, const function_view<Ns() const>&
{
if (!start.quiet) [[unlikely]]
{
- print_pos("-", expected.pt, pos, time, dt);
- Debug{} << "===>" << i << "iters" << colon(',') << time << Debug::newline;
+ print_pos("->", expected.pt, pos, time, dt);
+ DBG_nospace << "===>"
+ << " iters=" << colon(',')
+ << " time" << time
+ << Debug::newline;
}
if (i == 0) [[unlikely]] // todo! check for very small dt before dying
{
{ auto dbg = Error{standard_error(), Debug::Flag::NoSpace};
- dbg << "!!! fatal: took zero iterations!";
- dbg << " dt=" << dt << "accel=" << npc.speed;
+ dbg << "!!! fatal: took zero iterations";
+ dbg << " dt=" << dt << " accel=" << npc.speed;
}
fm_assert(false);
}