Skip to content

Commit

Permalink
Add tests around overdraw bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jtothebell committed Dec 28, 2020
1 parent ff0d0ee commit 45f18e2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/graphicstests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,31 @@ TEST_CASE("graphics class behaves as expected") {

checkPoints(graphics, expectedPoints);
}
SUBCASE("overdrawn line() still draws (horizontal)") {
graphics->cls();
graphics->line(-10, 1, 138, 1, 5);

std::vector<coloredPoint> expectedPoints = {
{0, 1, 5},
{1, 1, 5},
{2, 1, 5}//etc
};

checkPoints(graphics, expectedPoints);
}
SUBCASE("overdrawn line() still draws (vertical)") {
graphics->cls();
graphics->line(1, -10, 1, 138, 5);

std::vector<coloredPoint> expectedPoints = {
{1, 0, 5},
{1, 1, 5},
{1, 2, 5}//etc
};

checkPoints(graphics, expectedPoints);
}

SUBCASE("circ({ox}, {oy}) uses pen color and radius of 4") {
graphics->cls();
graphics->circ(40, 40);
Expand Down

0 comments on commit 45f18e2

Please sign in to comment.