make tests run again
This commit is contained in:
@@ -73,12 +73,11 @@ static void fillMaterials(Simulation& sim, EntityId yardId, const ShipDef& def)
|
||||
TEST_CASE("Shipyard: spawns a player ship after production cycle completes",
|
||||
"[shipyard]")
|
||||
{
|
||||
const GameConfig cfg = loadConfig();
|
||||
Simulation sim(cfg, 42);
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
const ShipDef* def = findAvailableBlueprint(cfg);
|
||||
const ShipDef* def = findAvailableBlueprint(sim.config());
|
||||
REQUIRE(def != nullptr);
|
||||
const BuildingDef* yardDef = findShipyardDef(cfg);
|
||||
const BuildingDef* yardDef = findShipyardDef(sim.config());
|
||||
REQUIRE(yardDef != nullptr);
|
||||
|
||||
const int shipsBefore = static_cast<int>(sim.ships().allShips().size());
|
||||
@@ -119,10 +118,9 @@ TEST_CASE("Shipyard: spawns a player ship after production cycle completes",
|
||||
|
||||
TEST_CASE("Shipyard: does not spawn without a blueprint set", "[shipyard]")
|
||||
{
|
||||
const GameConfig cfg = loadConfig();
|
||||
Simulation sim(cfg, 42);
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
const BuildingDef* yardDef = findShipyardDef(cfg);
|
||||
const BuildingDef* yardDef = findShipyardDef(sim.config());
|
||||
REQUIRE(yardDef != nullptr);
|
||||
|
||||
const int shipsBefore = static_cast<int>(sim.ships().allShips().size());
|
||||
@@ -136,12 +134,11 @@ TEST_CASE("Shipyard: does not spawn without a blueprint set", "[shipyard]")
|
||||
|
||||
TEST_CASE("Shipyard: does not spawn with insufficient materials", "[shipyard]")
|
||||
{
|
||||
const GameConfig cfg = loadConfig();
|
||||
Simulation sim(cfg, 42);
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
const ShipDef* def = findAvailableBlueprint(cfg);
|
||||
const ShipDef* def = findAvailableBlueprint(sim.config());
|
||||
REQUIRE(def != nullptr);
|
||||
const BuildingDef* yardDef = findShipyardDef(cfg);
|
||||
const BuildingDef* yardDef = findShipyardDef(sim.config());
|
||||
REQUIRE(yardDef != nullptr);
|
||||
|
||||
const int shipsBefore = static_cast<int>(sim.ships().allShips().size());
|
||||
@@ -161,12 +158,11 @@ TEST_CASE("Shipyard: does not spawn with insufficient materials", "[shipyard]")
|
||||
|
||||
TEST_CASE("Shipyard: spawns a second ship after materials replenished", "[shipyard]")
|
||||
{
|
||||
const GameConfig cfg = loadConfig();
|
||||
Simulation sim(cfg, 42);
|
||||
Simulation sim(loadConfig(), 42);
|
||||
|
||||
const ShipDef* def = findAvailableBlueprint(cfg);
|
||||
const ShipDef* def = findAvailableBlueprint(sim.config());
|
||||
REQUIRE(def != nullptr);
|
||||
const BuildingDef* yardDef = findShipyardDef(cfg);
|
||||
const BuildingDef* yardDef = findShipyardDef(sim.config());
|
||||
REQUIRE(yardDef != nullptr);
|
||||
|
||||
const EntityId yardId = placeShipyard(sim, *yardDef);
|
||||
|
||||
Reference in New Issue
Block a user