Skip to content

Commit

Permalink
Increase codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Jul 24, 2022
1 parent bf94c61 commit 431c214
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
9 changes: 0 additions & 9 deletions game_rect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,6 @@ bool operator==(const game_rect& lhs, const game_rect& rhs) noexcept
;
}

game_rect& operator+=(game_rect& rect, const game_coordinat& delta) noexcept
{
rect = game_rect(
rect.get_tl() + delta,
rect.get_br() + delta
);
return rect;
}

std::ostream& operator<<(std::ostream& os, const game_rect& r) noexcept
{
os << "(" << r.get_tl() << "-" << r.get_br() << ")";
Expand Down
12 changes: 12 additions & 0 deletions piece.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,18 @@ void test_piece()
const auto p{get_test_white_king()};
assert(get_occupied_square(p) == square("e1"));
}
// get_test_white_king
{
const auto p{get_test_white_king()};
assert(p.get_type() == piece_type::king);
assert(p.get_color() == chess_color::white);
}
// get_test_white_knight
{
const auto p{get_test_white_knight()};
assert(p.get_type() == piece_type::knight);
assert(p.get_color() == chess_color::white);
}
// has_actions
{
const auto p{get_test_white_king()};
Expand Down
2 changes: 1 addition & 1 deletion piece_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void test_piece_action()
const piece_action a(piece_action_type::attack, square("e3"));
assert(!to_str(piece_action(a)).empty());
const piece_action b(piece_action_type::move, square("e2"), square("e4"));
assert(!to_str(piece_action(a)).empty());
assert(!to_str(piece_action(b)).empty());
}
// operator<<
{
Expand Down
5 changes: 5 additions & 0 deletions test_game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ void test_game_functions()
g.add_action(create_press_left_action()); // cursor to d8
g.tick();
assert(!can_player_select_piece_at_cursor_pos(g, chess_color::white));

g.add_action(create_press_left_action()); // cursor to d7
g.add_action(create_press_left_action()); // cursor to d6
g.tick();
assert(!can_player_select_piece_at_cursor_pos(g, chess_color::white));
}
// clear_sound_effects
{
Expand Down

0 comments on commit 431c214

Please sign in to comment.