Skip to content

Commit 05ef265

Browse files
Kyle GrageKyle Grage
authored andcommitted
relearning pointers
1 parent 8aff0b4 commit 05ef265

File tree

1 file changed

+21
-27
lines changed

1 file changed

+21
-27
lines changed

tests/test_CornerPiece.cpp

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ TEST(Settlement_constructor){
1919
GameBoard board({"test board"});
2020
Player& test_player = board.getPlayer(0);
2121

22-
Settlement test_cp(&board, loc, test_player);
22+
Settlement test_cp(board, loc, test_player);
2323
CHECK_EQUAL(loc, test_cp.getLocation());
24-
CHECK_EQUAL(&board, test_cp.getBoard());
25-
CHECK_EQUAL(&test_player, test_cp.getOwner());
24+
CHECK_EQUAL(board, test_cp.getBoard());
2625
CHECK_EQUAL(1, test_cp.getVictoryPoints());
2726
}
2827

@@ -31,10 +30,9 @@ TEST(City_constructor){
3130
GameBoard board({"test board"});
3231
Player& test_player = board.getPlayer(0);
3332

34-
City test_cp(&board, loc, test_player);
33+
City test_cp(board, loc, test_player);
3534
CHECK_EQUAL(loc, test_cp.getLocation());
36-
CHECK_EQUAL(&board, test_cp.getBoard());
37-
CHECK_EQUAL(&test_player, test_cp.getOwner());
35+
CHECK_EQUAL(board, test_cp.getBoard());
3836
CHECK_EQUAL(2, test_cp.getVictoryPoints());
3937
}
4038

@@ -43,10 +41,9 @@ TEST(Wonder_constructor){
4341
GameBoard board({"test board"});
4442
Player& test_player = board.getPlayer(0);
4543

46-
Wonder test_cp(&board, loc, test_player);
44+
Wonder test_cp(board, loc, test_player);
4745
CHECK_EQUAL(loc, test_cp.getLocation());
48-
CHECK_EQUAL(&board, test_cp.getBoard());
49-
CHECK_EQUAL(&test_player, test_cp.getOwner());
46+
CHECK_EQUAL(board, test_cp.getBoard());
5047
CHECK_EQUAL(10, test_cp.getVictoryPoints());
5148
}
5249

@@ -55,11 +52,10 @@ TEST(City_upgrade_constructor){
5552
GameBoard board({"test board"});
5653
Player& test_player = board.getPlayer(0);
5754

58-
Settlement intermediate_cp(&board, loc, test_player);
59-
City test_cp(&intermediate_cp);
55+
Settlement intermediate_cp(board, loc, test_player);
56+
City test_cp(intermediate_cp);
6057
CHECK_EQUAL(loc, test_cp.getLocation());
61-
CHECK_EQUAL(&board, test_cp.getBoard());
62-
CHECK_EQUAL(&test_player, test_cp.getOwner());
58+
CHECK_EQUAL(board, test_cp.getBoard());
6359
CHECK_EQUAL(2, test_cp.getVictoryPoints());
6460
}
6561

@@ -68,11 +64,10 @@ TEST(Wonder_upgrade_settlement_constructor){
6864
GameBoard board({"test board"});
6965
Player& test_player = board.getPlayer(0);
7066

71-
Settlement intermediate_cp(&board, loc, test_player);
72-
Wonder test_cp(&intermediate_cp);
67+
Settlement intermediate_cp(board, loc, test_player);
68+
Wonder test_cp(intermediate_cp);
7369
CHECK_EQUAL(loc, test_cp.getLocation());
74-
CHECK_EQUAL(&board, test_cp.getBoard());
75-
CHECK_EQUAL(&test_player, test_cp.getOwner());
70+
CHECK_EQUAL(board, test_cp.getBoard());
7671
CHECK_EQUAL(10, test_cp.getVictoryPoints());
7772
}
7873

@@ -81,11 +76,10 @@ TEST(Wonder_upgrade_city_constructor){
8176
GameBoard board({"test board"});
8277
Player& test_player = board.getPlayer(0);
8378

84-
City intermediate_cp(&board, loc, test_player);
85-
Wonder test_cp(&intermediate_cp);
79+
City intermediate_cp(board, loc, test_player);
80+
Wonder test_cp(intermediate_cp);
8681
CHECK_EQUAL(loc, test_cp.getLocation());
87-
CHECK_EQUAL(&board, test_cp.getBoard());
88-
CHECK_EQUAL(&test_player, test_cp.getOwner());
82+
CHECK_EQUAL(board, test_cp.getBoard());
8983
CHECK_EQUAL(10, test_cp.getVictoryPoints());
9084
}
9185

@@ -95,7 +89,7 @@ TEST(Settlement_Resource_Mod){
9589
GameBoard board({"test board"});
9690
Player& test_player = board.getPlayer(0);
9791

98-
Settlement test_cp(&board, loc, test_player);
92+
Settlement test_cp(board, loc, test_player);
9993
CHECK_EQUAL(1, test_cp.getResourceModifier());
10094
}
10195

@@ -104,7 +98,7 @@ TEST(City_Resource_Mod){
10498
GameBoard board({"test board"});
10599
Player& test_player = board.getPlayer(0);
106100

107-
City test_cp(&board, loc, test_player);
101+
City test_cp(board, loc, test_player);
108102
CHECK_EQUAL(2, test_cp.getResourceModifier());
109103
}
110104

@@ -113,7 +107,7 @@ TEST(Wonder_Resource_Mod){
113107
GameBoard board({"test board"});
114108
Player& test_player = board.getPlayer(0);
115109

116-
Wonder test_cp(&board, loc, test_player);
110+
Wonder test_cp(board, loc, test_player);
117111
CHECK_EQUAL(10, test_cp.getResourceModifier());
118112
}
119113

@@ -123,7 +117,7 @@ TEST(Settlement_Victory_Pts){
123117
GameBoard board({"test board"});
124118
Player& test_player = board.getPlayer(0);
125119

126-
Settlement test_cp(&board, loc, test_player);
120+
Settlement test_cp(board, loc, test_player);
127121
CHECK_EQUAL(1, test_cp.getVictoryPoints());
128122
}
129123

@@ -132,7 +126,7 @@ TEST(City_Victory_Pts){
132126
GameBoard board({"test board"});
133127
Player& test_player = board.getPlayer(0);
134128

135-
City test_cp(&board, loc, test_player);
129+
City test_cp(board, loc, test_player);
136130
CHECK_EQUAL(2, test_cp.getVictoryPoints());
137131
}
138132

@@ -141,7 +135,7 @@ TEST(Wonder_Victory_Pts){
141135
GameBoard board({"test board"});
142136
Player& test_player = board.getPlayer(0);
143137

144-
Wonder test_cp(&board, loc, test_player);
138+
Wonder test_cp(board, loc, test_player);
145139
CHECK_EQUAL(10, test_cp.getVictoryPoints());
146140
}
147141

0 commit comments

Comments
 (0)