Improved bet tests.
This commit is contained in:
@ -384,53 +384,6 @@ void test_pokerDealerBurn_should_SendCardsToTheGrave(void) {
|
||||
|
||||
}
|
||||
|
||||
void test_pokerBetGetCurrentCallValue_should_CalculateTheCallValue(void) {
|
||||
poker_t poker;
|
||||
uint8_t first, second;
|
||||
pokerInit(&poker);
|
||||
first = pokerPlayerAdd(&poker);
|
||||
second = pokerPlayerAdd(&poker);
|
||||
pokerPlayerChipsAdd(poker.players + first, 10000);
|
||||
pokerPlayerChipsAdd(poker.players + second, 10000);
|
||||
|
||||
TEST_ASSERT_EQUAL_INT32(0, pokerBetGetCurrentCallValue(&poker));
|
||||
pokerBetForPlayer(&poker, first, 100);
|
||||
TEST_ASSERT_EQUAL_INT32(100, pokerBetGetCurrentCallValue(&poker));
|
||||
pokerBetForPlayer(&poker, second, 150);
|
||||
TEST_ASSERT_EQUAL_INT32(150, pokerBetGetCurrentCallValue(&poker));
|
||||
|
||||
pokerPotAdd(&poker);
|
||||
TEST_ASSERT_EQUAL_INT32(150, pokerBetGetCurrentCallValue(&poker));
|
||||
TEST_ASSERT_EQUAL_INT32(0, poker.pots[1].chips);
|
||||
pokerBetForPlayer(&poker, second, 50);
|
||||
TEST_ASSERT_EQUAL_INT32(200, pokerBetGetCurrentCallValue(&poker));
|
||||
TEST_ASSERT_EQUAL_INT32(50, poker.pots[1].chips);
|
||||
}
|
||||
|
||||
void test_pokerBetGetCurrentCallValue_should_SkipOutPlayers(void) {
|
||||
poker_t poker;
|
||||
uint8_t i;
|
||||
pokerInit(&poker);
|
||||
|
||||
i = pokerPlayerAdd(&poker);
|
||||
pokerPlayerChipsAdd(poker.players + i, 10000);
|
||||
pokerBetForPlayer(&poker, i, 300);
|
||||
|
||||
i = pokerPlayerAdd(&poker);
|
||||
pokerPlayerChipsAdd(poker.players + i, 10000);
|
||||
pokerBetForPlayer(&poker, i, 500);
|
||||
|
||||
i = pokerPlayerAdd(&poker);
|
||||
pokerPlayerChipsAdd(poker.players + i, 10000);
|
||||
pokerBetForPlayer(&poker, i, 200);
|
||||
|
||||
TEST_ASSERT_EQUAL_INT32(500, pokerBetGetCurrentCallValue(&poker));
|
||||
poker.players[1].state |= POKER_PLAYER_STATE_OUT;
|
||||
TEST_ASSERT_EQUAL_INT32(300, pokerBetGetCurrentCallValue(&poker));
|
||||
poker.players[0].state |= POKER_PLAYER_STATE_OUT;
|
||||
TEST_ASSERT_EQUAL_INT32(200, pokerBetGetCurrentCallValue(&poker));
|
||||
}
|
||||
|
||||
void test_pokerDeal_should_DealCardsToThePlayer(void) {
|
||||
poker_t poker;
|
||||
uint8_t playerIndex;
|
||||
@ -1396,7 +1349,6 @@ int test_poker() {
|
||||
RUN_TEST(test_pokerPlayerAdd_should_ResetThePlayer);
|
||||
RUN_TEST(test_pokerDealerTurn_should_TurnCardsFromTheDeck);
|
||||
RUN_TEST(test_pokerDealerBurn_should_SendCardsToTheGrave);
|
||||
RUN_TEST(test_pokerBetGetCurrentCallValue_should_CalculateTheCallValue);
|
||||
RUN_TEST(test_pokerDeal_should_DealCardsToThePlayer);
|
||||
RUN_TEST(test_pokerPlayerChipsAdd_should_AddChipsToThePlayer);
|
||||
RUN_TEST(test_pokerPlayerChipsAdd_should_TurnOutStateOff);
|
||||
|
Reference in New Issue
Block a user