diff --git a/test/unit/game/GameStateTest.cpp b/test/unit/game/GameStateTest.cpp index 8d42bbd..d735d0f 100644 --- a/test/unit/game/GameStateTest.cpp +++ b/test/unit/game/GameStateTest.cpp @@ -20,10 +20,7 @@ TEST(game_state_test, game_state_test_1) UNO::GAME::ClientPlayerState playerState3("qkp", 100, false); UNO::GAME::ClientPlayerState playerState4("lzh", 100, false); - clientGameState.addPlayer(playerState1); - clientGameState.addPlayer(playerState2); - clientGameState.addPlayer(playerState3); - clientGameState.addPlayer(playerState4); + clientGameState.init({playerState1, playerState2, playerState3, playerState4}, {}, {}, 0, 3); const auto &players = clientGameState.getPlayers(); ASSERT_EQ(players[0].getName(), "pkq"); diff --git a/test/unit/game/PlayerTest.cpp b/test/unit/game/PlayerTest.cpp index f8b9e05..22084cc 100644 --- a/test/unit/game/PlayerTest.cpp +++ b/test/unit/game/PlayerTest.cpp @@ -25,7 +25,7 @@ TEST(player_test, player_test_1) ASSERT_EQ(handCard.getCards().begin()->getColor(), UNO::GAME::CardColor::RED); ASSERT_EQ(handCard.getCards().begin()->getType(), UNO::GAME::CardType::NUM1); - handCard.play(handCard.getCards().begin()); + handCard.play(*handCard.getCards().begin()); ASSERT_EQ(handCard.getCards().begin()->getColor(), UNO::GAME::CardColor::RED); ASSERT_EQ(handCard.getCards().begin()->getType(), UNO::GAME::CardType::SKIP);