|
|
|
@ -126,6 +126,54 @@ void test_pokerTakeBlinds_should_TakeTheBlinds(void) {
|
|
|
|
|
TEST_ASSERT_EQUAL_INT32(800, (poker.players + 4)->chips);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_pokerTakeBlinds_should_NotCountAsBetting(void) {
|
|
|
|
|
poker_t poker;
|
|
|
|
|
pokerInit(&poker);
|
|
|
|
|
pokerSetBlinds(&poker, 100, 200);
|
|
|
|
|
|
|
|
|
|
pokerPlayerChipsAdd(poker.players + pokerPlayerAdd(&poker), 1000);
|
|
|
|
|
pokerPlayerChipsAdd(poker.players + pokerPlayerAdd(&poker), 1000);
|
|
|
|
|
pokerPlayerChipsAdd(poker.players + pokerPlayerAdd(&poker), 1000);
|
|
|
|
|
pokerPlayerChipsAdd(poker.players + pokerPlayerAdd(&poker), 1000);
|
|
|
|
|
pokerPlayerChipsAdd(poker.players + pokerPlayerAdd(&poker), 1000);
|
|
|
|
|
|
|
|
|
|
pokerDealerNew(&poker);
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[0].state
|
|
|
|
|
);
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[1].state
|
|
|
|
|
);
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[2].state
|
|
|
|
|
);
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[3].state
|
|
|
|
|
);
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[4].state
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
pokerTakeBlinds(&poker);
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[0].state
|
|
|
|
|
);
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[1].state
|
|
|
|
|
);
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[2].state
|
|
|
|
|
);
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[3].state
|
|
|
|
|
);
|
|
|
|
|
TEST_ASSERT_BIT_LOW(
|
|
|
|
|
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND, poker.players[4].state
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_pokerPlayerGetCallBet_should_GetCallBet(void) {
|
|
|
|
|
poker_t poker;
|
|
|
|
|
uint8_t p0, p1, p2;
|
|
|
|
@ -186,6 +234,7 @@ int test_poker_h() {
|
|
|
|
|
RUN_TEST(test_pokerResetBettingRound_should_ResetTheBettingRound);
|
|
|
|
|
RUN_TEST(test_pokerTakeBlinds_should_TakeTheBlinds);
|
|
|
|
|
RUN_TEST(test_pokerPlayerGetCallBet_should_GetCallBet);
|
|
|
|
|
RUN_TEST(test_pokerTakeBlinds_should_NotCountAsBetting);
|
|
|
|
|
RUN_TEST(test_pokerInRoundGetCount_should_ReturnCountOfPlayersInRound);
|
|
|
|
|
|
|
|
|
|
return UNITY_END();
|
|
|
|
|