test: replace campaign labels with behavior names

This commit is contained in:
Erik 2026-08-18 12:25:00 +02:00
parent e6fab96f12
commit 9c6b143a03
30 changed files with 135 additions and 97 deletions

View file

@ -41,7 +41,7 @@ namespace AcDream.Core.Tests.Physics;
/// suite's "resolved" scenarios are what prevents that regression.
/// </para>
/// </summary>
public sealed class Ap71EntryRestrictionGateTests
public sealed class EntryRestrictionGateTests
{
private const uint RestrictionObjGuid = 0x80001234u;
private const uint MoverGuid = 0x50000001u;

View file

@ -12,10 +12,10 @@ namespace AcDream.Core.Tests.Physics.Motion;
/// </summary>
public sealed class ConstraintManagerTests
{
private static (R5Host host, ConstraintManager cm) Setup()
private static (PhysicsObjHostStub host, ConstraintManager cm) Setup()
{
var world = new Dictionary<uint, R5Host>();
var host = new R5Host(10u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var host = new PhysicsObjHostStub(10u, world);
return (host, new ConstraintManager(host));
}

View file

@ -20,11 +20,11 @@ namespace AcDream.Core.Tests.Physics.Motion;
/// <c>receive_target_update</c> seams forward to the owned
/// <see cref="TargetManager"/> exactly as retail's <c>CPhysicsObj</c> does.</para>
/// </summary>
internal sealed class R5Host : IPhysicsObjHost
internal sealed class PhysicsObjHostStub : IPhysicsObjHost
{
public readonly Dictionary<uint, R5Host> World;
public readonly Dictionary<uint, PhysicsObjHostStub> World;
public R5Host(uint id, Dictionary<uint, R5Host> world)
public PhysicsObjHostStub(uint id, Dictionary<uint, PhysicsObjHostStub> world)
{
Id = id;
World = world;

View file

@ -14,11 +14,11 @@ namespace AcDream.Core.Tests.Physics.Motion;
/// </summary>
public sealed class PositionManagerFacadeTests
{
private static (R5Host self, R5Host target, PositionManager pm) Setup()
private static (PhysicsObjHostStub self, PhysicsObjHostStub target, PositionManager pm) Setup()
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world);
var target = new R5Host(20u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world);
var target = new PhysicsObjHostStub(20u, world);
return (self, target, new PositionManager(self));
}

View file

@ -13,18 +13,18 @@ namespace AcDream.Core.Tests.Physics.Motion;
/// </summary>
public sealed class StickyManagerTests
{
private static (R5Host self, R5Host target, StickyManager sticky) Setup(
private static (PhysicsObjHostStub self, PhysicsObjHostStub target, StickyManager sticky) Setup(
uint targetId = 20u, float targetRadius = 0.5f)
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world);
var target = new R5Host(targetId, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world);
var target = new PhysicsObjHostStub(targetId, world);
var sticky = new StickyManager(self);
return (self, target, sticky);
}
private static StickyManager StuckAndInitialized(
R5Host self, R5Host target, Vector3 targetOrigin, float targetRadius = 0.5f)
PhysicsObjHostStub self, PhysicsObjHostStub target, Vector3 targetOrigin, float targetRadius = 0.5f)
{
var sticky = new StickyManager(self);
sticky.StickTo(target.Id, targetRadius, targetHeight: 1.0f);
@ -130,10 +130,10 @@ public sealed class StickyManagerTests
[Fact]
public void ReStick_TearsDownPreviousBeforeSettingNew()
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world);
var a = new R5Host(20u, world);
var b = new R5Host(21u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world);
var a = new PhysicsObjHostStub(20u, world);
var b = new PhysicsObjHostStub(21u, world);
var sticky = new StickyManager(self);
sticky.StickTo(a.Id, 0.5f, 1.0f);
@ -159,9 +159,9 @@ public sealed class StickyManagerTests
[Fact]
public void AdjustOffset_SteersTowardTarget_ClampedToStep()
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world) { Radius = 0.5f, MinterpMaxSpeed = 1.0f };
var target = new R5Host(20u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world) { Radius = 0.5f, MinterpMaxSpeed = 1.0f };
var target = new PhysicsObjHostStub(20u, world);
var sticky = StuckAndInitialized(self, target, new Vector3(5f, 0f, 0f));
var frame = new MotionDeltaFrame();
@ -178,9 +178,9 @@ public sealed class StickyManagerTests
[Fact]
public void AdjustOffset_TooClose_BacksOff_SignedDistance()
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world) { Radius = 0.5f, MinterpMaxSpeed = 1.0f };
var target = new R5Host(20u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world) { Radius = 0.5f, MinterpMaxSpeed = 1.0f };
var target = new PhysicsObjHostStub(20u, world);
// centerDist 0.9, cyl = 0.9-0.5-0.5 = -0.1, minus 0.3 → dist = -0.4.
var sticky = StuckAndInitialized(self, target, new Vector3(0.9f, 0f, 0f));
@ -194,9 +194,9 @@ public sealed class StickyManagerTests
[Fact]
public void AdjustOffset_DeepOverlap_BacksOff_RateLimited()
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world) { Radius = 0.5f, MinterpMaxSpeed = 1.0f };
var target = new R5Host(20u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world) { Radius = 0.5f, MinterpMaxSpeed = 1.0f };
var target = new PhysicsObjHostStub(20u, world);
// centerDist 0.1 → cyl = 0.1-0.5-0.5 = -0.9, minus 0.3 → dist = -1.2
// (overlap DEEPER than one tick's step).
var sticky = StuckAndInitialized(self, target, new Vector3(0.1f, 0f, 0f));
@ -214,9 +214,9 @@ public sealed class StickyManagerTests
[Fact]
public void AdjustOffset_UsesCachedPosition_WhenTargetUnresolvable()
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world) { Radius = 0.5f, MinterpMaxSpeed = 1.0f };
var target = new R5Host(20u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world) { Radius = 0.5f, MinterpMaxSpeed = 1.0f };
var target = new PhysicsObjHostStub(20u, world);
var sticky = new StickyManager(self);
target.Resolvable = false;
sticky.StickTo(target.Id, 0.5f, 1.0f);
@ -233,9 +233,9 @@ public sealed class StickyManagerTests
[Fact]
public void AdjustOffset_NoMinterp_UsesFallbackSpeed()
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world) { Radius = 0.5f, MinterpMaxSpeed = null };
var target = new R5Host(20u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world) { Radius = 0.5f, MinterpMaxSpeed = null };
var target = new PhysicsObjHostStub(20u, world);
var sticky = StuckAndInitialized(self, target, new Vector3(50f, 0f, 0f));
var frame = new MotionDeltaFrame();

View file

@ -14,11 +14,11 @@ namespace AcDream.Core.Tests.Physics.Motion;
/// </summary>
public sealed class TargetManagerTests
{
private static (R5Host self, R5Host target, Dictionary<uint, R5Host> world) TwoHosts()
private static (PhysicsObjHostStub self, PhysicsObjHostStub target, Dictionary<uint, PhysicsObjHostStub> world) TwoHosts()
{
var world = new Dictionary<uint, R5Host>();
var self = new R5Host(10u, world);
var target = new R5Host(20u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var self = new PhysicsObjHostStub(10u, world);
var target = new PhysicsObjHostStub(20u, world);
return (self, target, world);
}
@ -122,7 +122,7 @@ public sealed class TargetManagerTests
var (self, originalTarget, world) = TwoHosts();
self.TargetManager.SetTarget(0, originalTarget.Id, 1.0f, 0.0);
self.HandleUpdateTargetCalls.Clear();
var replacement = new R5Host(originalTarget.Id, world);
var replacement = new PhysicsObjHostStub(originalTarget.Id, world);
var p = new Position(1u, new Vector3(99f, 0f, 0f), Quaternion.Identity);
self.ReceiveTargetUpdate(
@ -143,7 +143,7 @@ public sealed class TargetManagerTests
self.SetOrigin(Vector3.Zero);
originalTarget.SetOrigin(new Vector3(5f, 0f, 0f));
self.PositionManager.StickTo(originalTarget.Id, 0.5f, 1f);
var replacement = new R5Host(originalTarget.Id, world);
var replacement = new PhysicsObjHostStub(originalTarget.Id, world);
replacement.SetOrigin(new Vector3(10f, 0f, 0f));
originalTarget.SetOrigin(new Vector3(-5f, 0f, 0f));
var delta = new MotionDeltaFrame();
@ -260,7 +260,7 @@ public sealed class TargetManagerTests
watcher.TargetManager.SetTarget(0, target.Id, 1.0f, 0.0);
watcher.HandleUpdateTargetCalls.Clear();
watcher.Resolvable = false;
var replacement = new R5Host(watcher.Id, world);
var replacement = new PhysicsObjHostStub(watcher.Id, world);
target.TargetManager.NotifyVoyeurOfEvent(TargetStatus.Teleported);
@ -273,10 +273,10 @@ public sealed class TargetManagerTests
[Fact]
public void NotifyVoyeurOfEvent_BroadcastsToAll_NoDistanceGate()
{
var world = new Dictionary<uint, R5Host>();
var target = new R5Host(20u, world);
var w1 = new R5Host(10u, world);
var w2 = new R5Host(11u, world);
var world = new Dictionary<uint, PhysicsObjHostStub>();
var target = new PhysicsObjHostStub(20u, world);
var w1 = new PhysicsObjHostStub(10u, world);
var w2 = new PhysicsObjHostStub(11u, world);
// both watch the target (each gets a target_info via SetTarget)
w1.TargetManager.SetTarget(0, target.Id, 1.0f, 0.0);
w2.TargetManager.SetTarget(0, target.Id, 1.0f, 0.0);

View file

@ -463,7 +463,7 @@ public sealed class MotionInterpreterDoMotionFamilyTests
}
[Fact]
public void StopCompletely_DoesNotTouchSidestepOrTurnSpeeds_J9()
public void StopCompletely_DoesNotTouchSidestepOrTurnSpeeds()
{
// A9/J9: retail touches ONLY forward cmd/speed + sidestep/turn
// COMMANDS — it does NOT write sidestep_speed or turn_speed. The

View file

@ -705,8 +705,8 @@ public sealed class MotionInterpreterJumpFamilyTests
[Fact]
public void JumpIsAllowed_LeashArmedAndOverstrained_ReturnsGeneralMovementFailure()
{
var world = new System.Collections.Generic.Dictionary<uint, R5Host>();
var host = new R5Host(10u, world);
var world = new System.Collections.Generic.Dictionary<uint, PhysicsObjHostStub>();
var host = new PhysicsObjHostStub(10u, world);
const uint outdoorCell = 0x12340007u; // low16 < 0x0100 -> outdoor
host.Position = new Position(outdoorCell, Vector3.Zero, Quaternion.Identity);

View file

@ -60,7 +60,7 @@ namespace AcDream.Core.Tests.Physics;
/// </para>
/// </summary>
[Trait("Lane", "InstalledDat")]
public sealed class Ap157SortingSphereFloodMeasurementTests
public sealed class SortingSphereFloodMeasurementTests
{
/// <summary>Arbitrary non-zero landblock id — only its prefix matters for
/// seeding the outdoor flood; the entity is placed at the landblock's own

View file

@ -30,7 +30,7 @@ namespace AcDream.Core.Tests.Physics;
/// </item>
/// </list>
/// </summary>
public class Ap10WaterSemanticsTests
public class WaterSemanticsTests
{
// ── §1: TerrainSurface.SampleWaterDepth golden values ──────────────────