test(battle-engine M13): shared NetworkEmitFixtureBase teardown — close IsForecast/agent global leak

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-06 13:03:07 -04:00
parent bfd99c4829
commit e6a561b30f
3 changed files with 45 additions and 15 deletions

View File

@@ -10,21 +10,11 @@ namespace SVSim.BattleEngine.Tests
// without crashing, while the committed state still matches the M3 direct-ActionProcessor oracle.
// Liveness only (E4); structural frame decoding + the RNG rand-list (M14) are deferred.
[TestFixture]
public class EmitPathReadOracleTests
public class EmitPathReadOracleTests : NetworkEmitFixtureBase
{
// Reset the process globals this fixture mutates so no later fixture inherits them:
// - ToolboxGame.RealTimeNetworkAgent: the injected agent (the solo oracles don't read it, but
// clearing it is defensive, mirroring RandomDrawOracleTests.ResetRandomDrawGate).
// - BattleManagerBase.IsForecast: the network emit harness sets this FALSE (the emit path needs it);
// every solo oracle and EnsureInitialized assume it TRUE. EnsureInitialized only sets it once
// (guarded), so without restoring it here a solo fixture running after this one would see
// IsForecast=false and un-suppressed VFX. Restore the EnsureInitialized default.
[TearDown]
public void ResetGlobals()
{
Wizard.ToolboxGame.SetRealTimeNetworkBattle(null);
BattleManagerBase.IsForecast = true;
}
// The process-global reset (IsForecast=true + clear injected agent) now lives in the shared
// NetworkEmitFixtureBase.ResetNetworkEmitGlobals [TearDown], inherited here — see that file
// for why the leak matters.
[Test]
public void M3_spell_driven_via_OperateMgr_reaches_emit_without_crashing()