Compare commits

..
Author SHA1 Message Date
admin 22b762748e Use pre-increment in action point tests 2026-06-23 13:16:19 -07:00
8 changed files with 12 additions and 12 deletions
@@ -28,11 +28,11 @@ class ActionPointDistancesTest : public ::testing::Test {
// P P P M P P
// const_cast is safe because we own the mutable buffer (map)
for (int i = 6; i < 12; i++) {
for (int i = 6; i < 12; ++i) {
const_cast<Terrain*>(map->mutable_terrain()->GetMutableObject(i))
->mutate_type(net::eagle0::shardok::storage::fb::Terrain_::Type_FOREST);
}
for (int i = 18; i < 24; i++) {
for (int i = 18; i < 24; ++i) {
const_cast<Terrain*>(map->mutable_terrain()->GetMutableObject(i))
->mutate_type(net::eagle0::shardok::storage::fb::Terrain_::Type_RIVER);
}
@@ -34,7 +34,7 @@ TEST_F(FallIntoWaterActionTests, takesDamage) {
Coords c{2, 2};
auto fallerOffset = AddGenericUnit(1, 0, c);
std::vector<Unit> unitsVec{fallerOffset};
auto unitsVec = std::vector<Unit>{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);
std::vector<Unit> unitsVec{fallerOffset};
auto unitsVec = std::vector<Unit>{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);
std::vector<Unit> unitsVec{fallerOffset};
auto unitsVec = std::vector<Unit>{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);
std::vector<Unit> unitsVec{unit};
auto unitsVec = std::vector<Unit>{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));
std::vector<Unit> unitsVec{casterOffset, otherOffset};
auto unitsVec = std::vector<Unit>{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);
std::vector<Unit> unitsVec{ub};
auto unitsVec = std::vector<Unit>{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));
std::vector<Unit> unitsVec{adjOff, undeadOff, targetedOff};
auto unitsVec = std::vector<Unit>{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));
std::vector<Unit> unitsVec{actorOff};
auto unitsVec = std::vector<Unit>{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));
vector<Unit> unitsVec{otherUnit, firstUndeadOff, secondUndeadOff};
auto unitsVec = vector<Unit>{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);
vector<Unit> unitsVec{attackerOff, defenderOff};
auto unitsVec = vector<Unit>{attackerOff, defenderOff};
auto unitsOffset = fbb.CreateVectorOfSortedStructs(&unitsVec);
auto statusBuilder = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);