Cut 1 Stryker fix batch: cover EvaluateBelt and belt Radius
Stryker over Zone.cs (231 mutants, scoped by --mutate to this cut's file) found two real gaps, both NoCoverage/Survived, not equivalents: - Zone.EvaluateBelt and AsteroidBelt.Evaluate -- the renderer's own path (ZoneRenderer.cs Update, AsteroidBeltUI.Update) -- were never called by any test, so the whole batch body and its loop bound were unreached. EvaluateBeltFillsEveryAsteroidExactlyAsChunkPoseWould pins that the batch path fills every index exactly as the per-index ChunkPose would, closing the gap without duplicating the orbit formula a second time. - AsteroidBelt.Radius (data.Asteroids.Max(a => a.Distance)) had no assertion; a Max-to-Min mutant survived. BeltRadiusIsTheFarthestAsteroidsDistance pins it, since the renderer's visibility bounds and minimap mesh both size off this field. Full suite: 262/262 green (260 + these 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
22a54ccbaf
commit
d9c887c129
1 changed files with 40 additions and 0 deletions
|
|
@ -198,4 +198,44 @@ public sealed class MiningCut1Tests : IDisposable
|
|||
belt.RespawnTimers[brokenIndex] = settings.AsteroidRespawnTime.Evaluate(asteroids[brokenIndex].Size);
|
||||
Assert.Equal(0f, belt.Size(brokenIndex, settings));
|
||||
}
|
||||
|
||||
// Stryker gap (2026-09-25 Stryker pass on this cut): nothing called Zone.EvaluateBelt or
|
||||
// AsteroidBelt.Evaluate, the renderer's own path (ZoneRenderer.cs:452-478), leaving both at NoCoverage.
|
||||
// This does not re-derive the orbit formula (that is ChunkPoseIsTheOrbitAtZoneTime's job); it pins that the
|
||||
// batch path is the same function as the per-index one, per index, over every asteroid -- so the renderer's
|
||||
// buffer can never quietly diverge into a second copy of the pose formula.
|
||||
[Fact]
|
||||
public void EvaluateBeltFillsEveryAsteroidExactlyAsChunkPoseWould()
|
||||
{
|
||||
var (zone, beltKey, asteroids, _) = BuildFixture();
|
||||
zone.Update(0.37f);
|
||||
|
||||
var buffer = new float4[asteroids.Length];
|
||||
zone.EvaluateBelt(beltKey, buffer);
|
||||
|
||||
Assert.Equal(asteroids.Length, buffer.Length);
|
||||
for (var i = 0; i < asteroids.Length; i++)
|
||||
{
|
||||
var expected = zone.ChunkPose(beltKey, i);
|
||||
Assert.Equal(expected.x, buffer[i].x, 4);
|
||||
Assert.Equal(expected.y, buffer[i].y, 4);
|
||||
Assert.Equal(expected.z, buffer[i].z, 4);
|
||||
Assert.Equal(expected.w, buffer[i].w, 4);
|
||||
}
|
||||
}
|
||||
|
||||
// Stryker gap: AsteroidBelt.Radius (Zone.cs, AsteroidBelt constructor) had no assertion, so Max survived a
|
||||
// Min mutation. The renderer's visibility bounds (ZoneRenderer.cs:452) and minimap mesh (:663) both use it
|
||||
// as the belt's farthest asteroid; a Min there would cull or mis-bound the belt.
|
||||
[Fact]
|
||||
public void BeltRadiusIsTheFarthestAsteroidsDistance()
|
||||
{
|
||||
var (zone, beltKey, asteroids, _) = BuildFixture();
|
||||
|
||||
var expectedRadius = float.MinValue;
|
||||
foreach (var a in asteroids)
|
||||
if (a.Distance > expectedRadius) expectedRadius = a.Distance;
|
||||
|
||||
Assert.Equal(expectedRadius, zone.AsteroidBelts[beltKey].Radius, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue