test(battle-engine M13): best-effort emit-payload presence (Inconclusive => deferred to structural validation)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -434,6 +434,26 @@ namespace SVSim.BattleEngine.Tests
|
||||
return (mgr, emitted);
|
||||
}
|
||||
|
||||
// M13 Task 4 best-effort: read the emit payload back out of the agent's stock sequencer. With
|
||||
// _notEmit=true (NewNetworkEmitBattle terminates the path that way), EmitMsgUriPack short-circuits
|
||||
// BEFORE stockEmitMessageMgr.StockData (RealTimeNetworkAgent.cs:1438 vs :1461), so the stock is
|
||||
// expected to be null/empty — return null on any null/throw so the test degrades to Inconclusive
|
||||
// rather than failing. Field `stockEmitMessageMgr` (:103) + `GetSequenceAllData()`
|
||||
// (StockEmitMgr.cs:81, returns List<Dictionary<string,object>>) verified against the copied engine.
|
||||
public static System.Collections.IList TryReadStockedEmitData(RealTimeNetworkAgent agent)
|
||||
{
|
||||
try
|
||||
{
|
||||
var f = typeof(RealTimeNetworkAgent).GetField("stockEmitMessageMgr",
|
||||
System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
|
||||
var stock = f?.GetValue(agent);
|
||||
if (stock == null) return null;
|
||||
var m = stock.GetType().GetMethod("GetSequenceAllData");
|
||||
return m?.Invoke(stock, null) as System.Collections.IList;
|
||||
}
|
||||
catch { return null; }
|
||||
}
|
||||
|
||||
private static void SetField(object obj, string name, object value)
|
||||
{
|
||||
var f = obj.GetType().GetField(name,
|
||||
|
||||
Reference in New Issue
Block a user