| 25 | using namespace grid_map; |
| 26 | |
| 27 | TEST(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 | |
| 45 | TEST(GridMapIterator, LinearIndex) |
| 46 | { |
nothing calls this directly
no test coverage detected