Skip to content

Commit

Permalink
machine board, map load test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 committed Oct 7, 2024
1 parent 205491e commit 6d5ce64
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Content.IntegrationTests/Tests/MachineBoardTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@ await server.WaitAssertion(() =>
continue;
var mId = mbc.Prototype;

// Frontier: we accept null as board prototypes, but this will fail the assertions.
if (mId == "Null")
continue;
// End Frontier

Assert.Multiple(() =>
{
Assert.That(protoMan.TryIndex<EntityPrototype>(mId, out var mProto),
$"Machine board {p.ID}'s corresponding machine has an invalid prototype.");
$"Machine board {p.ID}'s corresponding machine has an invalid prototype."); // Frontier
Assert.That(mProto.TryGetComponent<MachineComponent>(out var mComp, compFact),
$"Machine board {p.ID}'s corresponding machine {mId} does not have MachineComponent");
Assert.That(mComp.Board, Is.EqualTo(p.ID),
Expand Down
10 changes: 9 additions & 1 deletion Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public sealed class PostMapInitTest
private static readonly string[] GameMaps =
{
"Frontier",
"NFDev"
"NFDev" // Missing spawn points
};
// End Frontier

Expand Down Expand Up @@ -404,6 +404,14 @@ public async Task AllMapsTested()

var gameMaps = protoMan.EnumeratePrototypes<GameMapPrototype>()
.Where(x => !pair.IsTestPrototype(x))
// Frontier: FIXME - hacky test fix
.Where(x =>
x.ID == PoolManager.TestMap || // Frontier: check test map
(x.MapPath.ToString().StartsWith("/Maps/_NF") && // Frontier: check frontier maps only
!x.MapPath.ToString().StartsWith("/Maps/_NF/Shuttles") && // Frontier: skip shuttles (not loaded as maps)
!x.MapPath.ToString().StartsWith("/Maps/_NF/POI")) // Frontier: skip POIs (not loaded as maps)
)
// End Frontier
.Select(x => x.ID)
.ToHashSet();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@
- state: panel
map: ["enum.WiresVisualLayers.MaintenancePanel"]
- type: Machine
board: CircuitImprinterMachineCircuitboard
board: BlueprintLithographMachineCircuitboard
- type: Lathe
producingSound: /Audio/Machines/circuitprinter.ogg
idleState: icon
Expand Down

0 comments on commit 6d5ce64

Please sign in to comment.