From 9470e934ea8201b03e20983cf10ad09f5b3d03d7 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 11 Dec 2010 09:36:23 +0100 Subject: Correct the first test, add another. --- server/tests/calculate_score.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/tests/calculate_score.cpp b/server/tests/calculate_score.cpp index cb4e0f2..b78e763 100644 --- a/server/tests/calculate_score.cpp +++ b/server/tests/calculate_score.cpp @@ -1,4 +1,4 @@ -#define BOOST_TEST_MODULE +#define BOOST_TEST_MODULE calculate_score #include #include @@ -21,7 +21,27 @@ BOOST_AUTO_TEST_CASE(tsumo_tanyao) { BOOST_CHECK_EQUAL(player.won, true); BOOST_CHECK_EQUAL(player.won_value.yaku, 2); - BOOST_CHECK_EQUAL(player.won_value.fu, 28); - BOOST_CHECK_EQUAL(player.won_value.tsumo(), 500); - BOOST_CHECK_EQUAL(player.won_value.tsumo_east(), 1000); + BOOST_CHECK_EQUAL(player.won_value.fu, 32); + BOOST_CHECK_EQUAL(player.won_value.tsumo(), 700); + BOOST_CHECK_EQUAL(player.won_value.tsumo_east(), 1300); +} + +BOOST_AUTO_TEST_CASE(ron_tanyao) { + Player player; + player.client = make_shared(); + player.round_start(0); + + player.hand = list_of + (Tile::Man_2)(Tile::Man_2)(Tile::Man_2) + (Tile::Pin_2)(Tile::Pin_3)(Tile::Pin_4) + (Tile::Sou_2)(Tile::Sou_2)(Tile::Sou_2) + (Tile::Man_8); + + player.declare_ron(Tile::Man_8); + + BOOST_CHECK_EQUAL(player.won, true); + BOOST_CHECK_EQUAL(player.won_value.yaku, 1); + BOOST_CHECK_EQUAL(player.won_value.fu, 40); + BOOST_CHECK_EQUAL(player.won_value.ron(), 1300); + BOOST_CHECK_EQUAL(player.won_value.ron_east(), 2000); } -- cgit v1.2.3