Skip to content

Commit ca768ba

Browse files
author
ankit21
committed
--
1 parent 3b29262 commit ca768ba

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

include/Deck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//#include "DevelopmentCard.h"
1515

1616

17-
enum DevCardType { KNIGHT, VICTORYPOINT, YEAROFPLENTY, MONOPOLY, ROADBUILDING };
17+
enum DevCardType { KNIGHT, VICTORYPOINT, YEAROFPLENTY, MONOPOLY, ROADBUILDING, NULLTYPE };
1818

1919

2020
/**

src/Deck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ DevCardType Deck::drawCard()
8686

8787
if(this->getSize() == 0)
8888
{
89-
return KNIGHT;
89+
return NULLTYPE;
9090
}
9191

9292
DevCardType card = this->deck.back();

tests/test_Deck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEST(DeckTest, deck_draw)
1414
{
1515
Deck* testDeck= new Deck();
1616
DevCardType temp = testDeck->drawCard();
17-
ASSERT_NE(temp, KNIGHT);
17+
ASSERT_NE(temp, NULLTYPE);
1818
testDeck->discard(temp);
1919
// temp = NULL;
2020
// delete testDeck;
@@ -27,7 +27,7 @@ TEST(DeckTest, reshuffle_discard_pile)
2727
for (int i = 0; i<300; i++)
2828
{
2929
drawn = testDeck->drawCard();
30-
ASSERT_NE(drawn, KNIGHT);
30+
ASSERT_NE(drawn, NULLTYPE);
3131
testDeck->discard(drawn);
3232
// drawn = NULL;
3333
}

0 commit comments

Comments
 (0)