mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 00:55:43 +00:00
Avoid endl flushes in AI integration tests (#7501)
This commit is contained in:
@@ -733,7 +733,7 @@ TEST_F(AIIntegrationTest, AttackerAI_FirstTurn_MovesUnitsCorrectly) {
|
||||
std::cout << "(" << static_cast<int>(pos.row()) << "," << static_cast<int>(pos.column())
|
||||
<< ") ";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
std::cout << '\n';
|
||||
|
||||
// Log defender positions after setup
|
||||
const auto defenderPositionsAfterSetup =
|
||||
@@ -743,11 +743,11 @@ TEST_F(AIIntegrationTest, AttackerAI_FirstTurn_MovesUnitsCorrectly) {
|
||||
std::cout << "(" << static_cast<int>(pos.row()) << "," << static_cast<int>(pos.column())
|
||||
<< ") ";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
std::cout << '\n';
|
||||
|
||||
// Log attacker unit stats at start of turn
|
||||
const auto* units = engine.GetCurrentGameState()->units();
|
||||
std::cout << "Attacker unit stats at start of turn:" << std::endl;
|
||||
std::cout << "Attacker unit stats at start of turn:\n";
|
||||
for (unsigned int i = 0; i < units->size(); ++i) {
|
||||
const auto* unit = units->Get(i);
|
||||
if (unit->player_id() == attackerPlayerId && unit->location().row() >= 0) {
|
||||
@@ -756,7 +756,7 @@ TEST_F(AIIntegrationTest, AttackerAI_FirstTurn_MovesUnitsCorrectly) {
|
||||
<< static_cast<int>(unit->location().column())
|
||||
<< "): AP=" << static_cast<int>(unit->remaining_action_points())
|
||||
<< " Morale=" << unit->battalion().morale()
|
||||
<< " Size=" << unit->battalion().size() << std::endl;
|
||||
<< " Size=" << unit->battalion().size() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1062,7 +1062,7 @@ TEST_F(AIIntegrationTest, SingleUnit_ID_AttackerAI_FirstTurn_MovesUnitCorrectly)
|
||||
|
||||
std::cout << "ID AI chose: "
|
||||
<< net::eagle0::shardok::common::CommandType_Name(chosenCommand->GetCommandType())
|
||||
<< std::endl;
|
||||
<< '\n';
|
||||
|
||||
engine.PostCommand(attackerPlayerId, choiceResults.chosenIndex);
|
||||
commandCount++;
|
||||
@@ -1080,7 +1080,7 @@ TEST_F(AIIntegrationTest, SingleUnit_ID_AttackerAI_FirstTurn_MovesUnitCorrectly)
|
||||
|
||||
const auto& finalPos = finalPositions[0];
|
||||
std::cout << "ID AI moved unit to: (" << static_cast<int>(finalPos.row()) << ","
|
||||
<< static_cast<int>(finalPos.column()) << ")" << std::endl;
|
||||
<< static_cast<int>(finalPos.column()) << ")\n";
|
||||
|
||||
// ID AI moves to (4,4) - this is the ground truth
|
||||
const Coords expectedPos(4, 4);
|
||||
@@ -1222,7 +1222,7 @@ TEST_F(AIIntegrationTest,
|
||||
|
||||
std::cout << "MCTS (maxPlayerFlips=0, MINIMAX) chose: "
|
||||
<< net::eagle0::shardok::common::CommandType_Name(chosenCommand->GetCommandType())
|
||||
<< std::endl;
|
||||
<< '\n';
|
||||
|
||||
engine.PostCommand(attackerPlayerId, choiceResults.chosenIndex);
|
||||
commandCount++;
|
||||
@@ -1239,7 +1239,7 @@ TEST_F(AIIntegrationTest,
|
||||
const auto& finalPos = finalPositions[0];
|
||||
std::cout << "MCTS (maxPlayerFlips=0, MINIMAX) moved unit to: ("
|
||||
<< static_cast<int>(finalPos.row()) << "," << static_cast<int>(finalPos.column())
|
||||
<< ")" << std::endl;
|
||||
<< ")\n";
|
||||
|
||||
const Coords expectedPos(4, 4);
|
||||
EXPECT_EQ(finalPos.row(), expectedPos.row())
|
||||
|
||||
Reference in New Issue
Block a user