MCPcopy Create free account
hub / github.com/ANYbotics/grid_map / TEST

Function TEST

grid_map_core/test/LineIteratorTest.cpp:20–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18using namespace grid_map;
19
20TEST(LineIterator, StartOutsideMap)
21{
22 GridMap map( { "types" });
23 map.setGeometry(Length(8.0, 5.0), 1.0, Position(0.0, 0.0));
24
25 EXPECT_NO_THROW(LineIterator iterator(map, Position(2.0, 2.0), Position(0.0, 0.0)));
26 LineIterator iterator(map, Position(2.0, 2.0), Position(0.0, 0.0));
27
28 EXPECT_FALSE(iterator.isPastEnd());
29 EXPECT_EQ(2, (*iterator)(0));
30 EXPECT_EQ(0, (*iterator)(1));
31
32 ++iterator;
33 EXPECT_FALSE(iterator.isPastEnd());
34 EXPECT_EQ(3, (*iterator)(0));
35 EXPECT_EQ(1, (*iterator)(1));
36
37 ++iterator;
38 EXPECT_FALSE(iterator.isPastEnd());
39 EXPECT_EQ(4, (*iterator)(0));
40 EXPECT_EQ(2, (*iterator)(1));
41
42 ++iterator;
43 EXPECT_TRUE(iterator.isPastEnd());
44}
45
46TEST(LineIterator, EndOutsideMap)
47{

Callers

nothing calls this directly

Calls 4

setGeometryMethod · 0.80
moveMethod · 0.80
getPositionMethod · 0.80
isPastEndMethod · 0.45

Tested by

no test coverage detected