Compare commits

..
Author SHA1 Message Date
admin 22b762748e Use pre-increment in action point tests 2026-06-23 13:16:19 -07:00
4 changed files with 6 additions and 6 deletions
@@ -66,7 +66,7 @@ protected:
net::eagle0::shardok::storage::fb::DrawType_UNKNOWN_DRAW_TYPE);
endGameCondition.mutate_victory_details(
net::eagle0::shardok::storage::fb::VictoryCondition_UNKNOWN_VICTORY_CONDITION);
std::vector<PlayerId> winningIdsVec{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
auto winningIdsVec = std::vector<PlayerId>{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
auto winningIdsOff = fbb.CreateVector(winningIdsVec);
auto statusB = net::eagle0::shardok::storage::fb::GameStatusBuilder(fbb);
statusB.add_state(net::eagle0::shardok::storage::fb::GameStatus_::State_GAME_RUNNING);
@@ -75,7 +75,7 @@ protected:
net::eagle0::shardok::storage::fb::GameStatus_::State_GAME_RUNNING);
const auto mapOffset = AddHexMap(fbb, hexMap);
const vector<int8_t> attackerVC{
const auto attackerVC = vector<int8_t>{
net::eagle0::shardok::storage::fb::
VictoryCondition_VICTORY_CONDITION_LAST_PLAYER_STANDING,
net::eagle0::shardok::storage::fb::
@@ -87,7 +87,7 @@ protected:
1000,
&attackerVC);
const vector<int8_t> defenderVC{
const auto defenderVC = vector<int8_t>{
net::eagle0::shardok::storage::fb::
VictoryCondition_VICTORY_CONDITION_WIN_AFTER_MAX_ROUNDS,
net::eagle0::shardok::storage::fb::
@@ -33,7 +33,7 @@ protected:
defenderPlayer};
const auto playersOffset = fbb.CreateVectorOfSortedTables(&playersVec);
std::vector<Unit> units{
auto units = std::vector<Unit>{
AddGenericUnit(0, 0, attackerLocation),
AddGenericUnit(1, 1, defenderLocation)};
if (secondAttacker) { units.push_back(AddGenericUnit(0, 2, attacker2Location)); }
@@ -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);
}