From caf60daa0086bf6e82f2e8c9dccb60b88f8780ae Mon Sep 17 00:00:00 2001 From: ephphatha Date: Sun, 6 Mar 2022 15:25:16 +1100 Subject: [PATCH] Fix tests expecting unclean HoldItem uses. These test cases were asserting side-effects of the call to CreatePlayer leaving an initialised gold item in the held item slot. --- test/player_test.cpp | 2 +- test/writehero_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/player_test.cpp b/test/player_test.cpp index dc6e573ba..61501edd2 100644 --- a/test/player_test.cpp +++ b/test/player_test.cpp @@ -88,7 +88,7 @@ static void AssertPlayer(Player &player) ASSERT_EQ(CountItems(player.InvBody, NUM_INVLOC), 1); ASSERT_EQ(CountItems(player.InvList, NUM_INV_GRID_ELEM), 1); ASSERT_EQ(CountItems(player.SpdList, MAXBELTITEMS), 2); - ASSERT_EQ(CountItems(&player.HoldItem, 1), 1); + ASSERT_EQ(CountItems(&player.HoldItem, 1), 0); ASSERT_EQ(player.position.tile.x, 0); ASSERT_EQ(player.position.tile.y, 0); diff --git a/test/writehero_test.cpp b/test/writehero_test.cpp index 042990206..bf34c4910 100644 --- a/test/writehero_test.cpp +++ b/test/writehero_test.cpp @@ -221,7 +221,7 @@ static void AssertPlayer(Player &player) ASSERT_EQ(CountItems(player.InvBody, NUM_INVLOC), 6); ASSERT_EQ(CountItems(player.InvList, NUM_INV_GRID_ELEM), 2); ASSERT_EQ(CountItems(player.SpdList, MAXBELTITEMS), 8); - ASSERT_EQ(CountItems(&player.HoldItem, 1), 1); + ASSERT_EQ(CountItems(&player.HoldItem, 1), 0); ASSERT_EQ(player.position.tile.x, 75); ASSERT_EQ(player.position.tile.y, 68);