Compare commits

..
Author SHA1 Message Date
admin b9ebaf516f Use direct vector declarations in action tests 2026-06-23 12:54:28 -07:00
12 changed files with 17 additions and 17 deletions
@@ -23,7 +23,7 @@ class AIAttackGroupsTest : public ::testing::Test {
flatbuffers::FlatBufferBuilder fbb;
fbb.ForceDefaults(true);
std::vector<Unit> unitsVec{
auto unitsVec = std::vector<Unit>{
AddGenericUnit(0, 0, Coords(0, 0)),
AddGenericUnit(0, 1, Coords(0, 1)),
AddGenericUnit(0, 2, Coords(5, 0)),
@@ -287,4 +287,4 @@ TEST_F(AIAttackGroupsTest, targetPriorities_assignHighestPowerFirst) {
.target = Coords(0, 5),
.attackLocations = upperRightAttackLocations}}),
tpls[2].priorityOrder);
}
}
@@ -20,7 +20,7 @@ class AIAttackerStrategySelectorTest : public ::testing::Test {
flatbuffers::FlatBufferBuilder fbb;
fbb.ForceDefaults(true);
std::vector<Unit> unitsVec{
auto unitsVec = std::vector<Unit>{
AddGenericUnit(0, 0, Coords(5, 0)),
AddGenericUnit(0, 1, Coords(4, 0)),
AddGenericUnit(0, 2, Coords(5, 5)),
@@ -21,7 +21,7 @@ class AIStrategySelectorTest : public ::testing::Test {
flatbuffers::FlatBufferBuilder fbb;
fbb.ForceDefaults(true);
std::vector<Unit> unitsVec{
auto unitsVec = std::vector<Unit>{
AddGenericUnit(0, 0, Coords(5, 0)),
AddGenericUnit(0, 1, Coords(4, 0)),
AddGenericUnit(0, 2, Coords(5, 5)),
@@ -291,4 +291,4 @@ TEST_F(AIStrategySelectorTest,
return GetGameSettings()->GetGetter().GetBattalionType(typeId);
})
.strategyType);
}
}
@@ -17,7 +17,7 @@ class AIScoreUtilitiesTest : public ::testing::Test {
flatbuffers::FlatBufferBuilder fbb;
fbb.ForceDefaults(true);
std::vector<Unit> unitsVec{
auto unitsVec = std::vector<Unit>{
AddGenericUnit(0, 0, Coords(5, 0)),
AddGenericUnit(0, 1, Coords(4, 0)),
AddGenericUnit(0, 2, Coords(5, 5)),
@@ -26,7 +26,7 @@ class AIWaterCrossingCalculatorTest : public ::testing::Test {
flatbuffers::FlatBufferBuilder fbb;
fbb.ForceDefaults(true);
std::vector<Unit> unitsVec{
auto unitsVec = std::vector<Unit>{
AddGenericUnit(0, 0, Coords(5, 0)),
AddGenericUnit(0, 1, Coords(4, 0))};
@@ -34,7 +34,7 @@ TEST_F(FallIntoWaterActionTests, takesDamage) {
Coords c{2, 2};
auto fallerOffset = AddGenericUnit(1, 0, c);
auto unitsVec = std::vector<Unit>{fallerOffset};
std::vector<Unit> unitsVec{fallerOffset};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
net::eagle0::shardok::storage::fb::Weather weather;
@@ -77,7 +77,7 @@ TEST_F(FallIntoWaterActionTests, highRoll_sweptAway) {
Coords c{2, 2};
auto fallerOffset = AddGenericUnit(1, 0, c);
auto unitsVec = std::vector<Unit>{fallerOffset};
std::vector<Unit> unitsVec{fallerOffset};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
net::eagle0::shardok::storage::fb::Weather weather;
@@ -121,7 +121,7 @@ TEST_F(FallIntoWaterActionTests, lowRoll_escapes) {
Coords c{2, 2};
auto fallerOffset = AddGenericUnit(1, 0, c);
auto unitsVec = std::vector<Unit>{fallerOffset};
std::vector<Unit> unitsVec{fallerOffset};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
net::eagle0::shardok::storage::fb::Weather weather;
@@ -170,7 +170,7 @@ TEST_F(FallIntoWaterActionTests, noHero_alwaysSweptAway) {
unit.mutable_location() = c;
unit.mutable_battalion().mutate_size(500);
auto unitsVec = std::vector<Unit>{unit};
std::vector<Unit> unitsVec{unit};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
net::eagle0::shardok::storage::fb::Weather weather;
@@ -53,7 +53,7 @@ class MeteorCastActionTests : public ::testing::Test {
auto otherOffset = AddGenericUnit(1, 1, Coords(1, 1));
auto unitsVec = std::vector<Unit>{casterOffset, otherOffset};
std::vector<Unit> unitsVec{casterOffset, otherOffset};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto hexMap = AddHexMap(fbb, BASIC_MAP_FB);
@@ -104,7 +104,7 @@ auto MakeGameState() -> GameStateW {
ub.mutable_location() = coords;
ub.mutate_status(net::eagle0::shardok::storage::fb::UnitStatus_NORMAL_UNIT);
auto unitsVec = std::vector<Unit>{ub};
std::vector<Unit> unitsVec{ub};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto weather = net::eagle0::shardok::storage::fb::Weather(
@@ -45,7 +45,7 @@ class PerformUndeadCommandsActionTest : public ::testing::Test {
auto undeadOff = AddGenericUndead(UNCONTROLLED_PLAYER_ID, 1, undeadPosition);
auto targetedOff = AddGenericUnit(4, 2, Coords(5, 5));
auto unitsVec = std::vector<Unit>{adjOff, undeadOff, targetedOff};
std::vector<Unit> unitsVec{adjOff, undeadOff, targetedOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto mapOff = AddBasicMap(fbb);
@@ -22,7 +22,7 @@ class PlaceHiddenUnitCommandTest : public ::testing::Test {
auto actorOff = AddGenericUnit(0, 0, Coords(-1, -1));
auto unitsVec = std::vector<Unit>{actorOff};
std::vector<Unit> unitsVec{actorOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto hexMapOffset = AddHexMap(fbb, BASIC_MAP_FB);
@@ -21,7 +21,7 @@ class UndeadChangeAction_test : public ::testing::Test {
auto firstUndeadOff = AddGenericUndead(1, 1, Coords(4, 4));
auto secondUndeadOff = AddGenericUndead(2, 2, Coords(1, 1));
auto unitsVec = vector<Unit>{otherUnit, firstUndeadOff, secondUndeadOff};
vector<Unit> unitsVec{otherUnit, firstUndeadOff, secondUndeadOff};
auto unitsOff = fbb.CreateVectorOfSortedStructs(&unitsVec);
GameStateBuilder gsb(fbb);
@@ -39,7 +39,7 @@ class UpdateOpponentKnowledgeActionTests : public ::testing::Test {
auto attackerOff = AddGenericUnit(0, 0, attackerPosition);
auto defenderOff = AddGenericUnit(1, 1, notAdjacentPosition);
auto unitsVec = vector<Unit>{attackerOff, defenderOff};
vector<Unit> unitsVec{attackerOff, defenderOff};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);