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

Function TEST

grid_map_core/test/GridMapIteratorTest.cpp:27–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25using namespace grid_map;
26
27TEST(GridMapIterator, Simple)
28{
29 GridMap map;
30 map.setGeometry(Length(8.1, 5.1), 1.0, Position(0.0, 0.0)); // bufferSize(8, 5)
31 map.add("layer", 0.0);
32 GridMapIterator iterator(map);
33
34 unsigned int i = 0;
35 for (; !iterator.isPastEnd(); ++iterator, ++i) {
36 map.at("layer", *iterator) = 1.0;
37 EXPECT_FALSE(iterator.isPastEnd());
38 }
39
40 EXPECT_EQ(40, i);
41 EXPECT_TRUE(iterator.isPastEnd());
42 EXPECT_TRUE((map["layer"].array() == 1.0f).all());
43}
44
45TEST(GridMapIterator, LinearIndex)
46{

Callers

nothing calls this directly

Calls 4

setGeometryMethod · 0.80
atMethod · 0.80
addMethod · 0.45
isPastEndMethod · 0.45

Tested by

no test coverage detected