Skip to content

Commit 75a766e

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

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/robotics/bresenham/test/bresenham_test.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,14 @@ 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, CheckLineMoreHorizontalThanVertical) {
41+
Coordinate start{1, 3};
42+
Coordinate end{6, 4};
43+
LineGenerator line(start, end);
44+
auto points = line.GetPoints();
45+
std::vector<Coordinate> expected = {
46+
{1, 3}, {2, 3}, {3, 3}, {4, 4}, {5, 4}, {6, 4}};
47+
EXPECT_TRUE(std::equal(std::begin(points), std::end(points),
48+
std::begin(expected), std::end(expected)));
49+
}

0 commit comments

Comments
 (0)