From 9ff6e4ba4294bee38a8703f1bb1252760210146d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 10 Oct 2026 19:39:42 +0200 Subject: [PATCH] Tests: the floor's stick-independence at the allocator; throttle-lock twin diagnostics Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/ThrottleLockTests.cs | 3 ++- tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ThrottleLockTests.cs b/tests/Aetheria.Shared.Tests/ThrottleLockTests.cs index 12b436e56..57f5af731 100644 --- a/tests/Aetheria.Shared.Tests/ThrottleLockTests.cs +++ b/tests/Aetheria.Shared.Tests/ThrottleLockTests.cs @@ -137,7 +137,8 @@ public sealed class ThrottleLockTests : IDisposable ship.Ship.Turn = twin.Ship.Turn = turn; ship.Ship.Update(dt); twin.Ship.Update(dt); - Assert.True(Apart(Axes(ship), Axes(twin)) < 1e-6f, "the ship's throttles differ from its full-forward twin's"); + var apart = Apart(Axes(ship), Axes(twin)); + Assert.True(apart < 1e-6f, $"the ship's throttles differ from its full-forward twin's by {apart}: [{string.Join(" ", Axes(ship))}] against [{string.Join(" ", Axes(twin))}]"); Assert.True(twin.Forward.Axis > .98f, "fixture: the twin's forward drive is at full"); } diff --git a/tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs b/tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs index dcbaa1986..405bb8833 100644 --- a/tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs +++ b/tests/Aetheria.Shared.Tests/ThrustAllocatorTests.cs @@ -435,7 +435,11 @@ public class ThrustAllocatorTests var throttle = new float[hull.Length]; allocator.Allocate(hull, new float2(1, -1), turn, throttle, forwardFloor: true); Assert.All(throttle.Take(3), t => Assert.True(t > .9999f, "a forward-pushing column holds full")); - Assert.True(throttle[4] < 1e-3f, "reverse stays off: the stick is ignored under the floor"); + + var blind = new float[hull.Length]; + new ThrustAllocator().Allocate(hull, default, turn, blind, forwardFloor: true); + var apart = throttle.Zip(blind, (a, b) => MathF.Abs(a - b)).Max(); + Assert.True(apart < 1e-6f, $"the stick changed the floored throttles by {apart}"); var open = new float[hull.Length]; new ThrustAllocator().Allocate(hull, new float2(0, 1), turn, open);