Skip to content

Commit ce2aea0

Browse files
committed
src: robotics: bresenham: improve test coverage
1 parent 0848e86 commit ce2aea0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/robotics/bresenham/test/bresenham_test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ TEST(Bresenham, CheckLineFromPositiveTowardsRightUpwards) {
3636
EXPECT_TRUE(std::equal(std::begin(points), std::end(points),
3737
std::begin(expected), std::end(expected)));
3838
}
39+
40+
TEST(Bresenham, CheckVerticalLineReachesEndYFirst) {
41+
Coordinate start{0, 0};
42+
Coordinate end{1, 3};
43+
LineGenerator line(start, end);
44+
auto points = line.GetPoints();
45+
std::vector<Coordinate> expected = {{0, 0}, {0, 1}, {1, 2}, {1, 3}};
46+
EXPECT_TRUE(std::equal(std::begin(points), std::end(points),
47+
std::begin(expected), std::end(expected)));
48+
}

0 commit comments

Comments
 (0)