From 12e8d1f342303394f8e6be72c08a92e3a4097bfb Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Thu, 19 Jul 2018 15:45:14 +0100 Subject: Add Canfield unit tests --- src/test/test_helper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/test/test_helper.cpp') diff --git a/src/test/test_helper.cpp b/src/test/test_helper.cpp index c4f902e..33a81ca 100644 --- a/src/test/test_helper.cpp +++ b/src/test/test_helper.cpp @@ -124,6 +124,14 @@ void test_helper::k_plus_stock_test ASSERT_EQ(gs.get_data(), game_state(sr, piles).get_data()) << gs; } +uint8_t test_helper::cards_in_founds(game_state& gs) { + uint8_t sz = 0; + for (auto found : gs.foundations) { + sz += gs.piles[found].size(); + } + return sz; +} + ostream& operator <<(ostream& os, const move& m) { return os << "move:(" << int(m.from) << "," << int(m.to) -- cgit v1.2.1