share one loadTestConfig() helper across the tests
19 test translation units each defined an identical local loadConfig(). They now include src/test/TestConfig.h, which lives off the lib/ui/app include path like SimulationTestAccess.h. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GH8ZMRY3vhxxXcaUxBqxkk
This commit is contained in:
@@ -19,15 +19,11 @@
|
||||
#include "SimulationTestAccess.h"
|
||||
#include "StationBodyComponent.h"
|
||||
#include "UnlocksConfig.h"
|
||||
#include "TestConfig.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
GameConfig loadConfig()
|
||||
{
|
||||
return ConfigLoader::loadFromDirectory(CONFIG_DIR);
|
||||
}
|
||||
|
||||
void killEnemyStations(Simulation& sim)
|
||||
{
|
||||
sim.getAdmin().forEach<StationBodyComponent, FactionComponent, HealthComponent>(
|
||||
@@ -42,7 +38,7 @@ void killEnemyStations(Simulation& sim)
|
||||
// bay together, gated to the given station level.
|
||||
GameConfig configWithSalvageGroup(int stationLevel)
|
||||
{
|
||||
GameConfig cfg = loadConfig();
|
||||
GameConfig cfg = loadTestConfig();
|
||||
cfg.unlocks.groups.clear();
|
||||
cfg.unlocks.groups.push_back(
|
||||
UnlockGroupDef{"salvage_operations", stationLevel, {}, {}, {"salvager"}, {"salvage_bay"}, {}});
|
||||
|
||||
Reference in New Issue
Block a user