#include <gtest/gtest.h>
#include <nav_2d_utils/bounds.h>
#include <nav_grid/vector_nav_grid.h>
#include <vector>
Go to the source code of this file.
Functions | |
void | countValues (const nav_grid::VectorNavGrid< unsigned char > &grid, unsigned int &match, unsigned int &missed, unsigned int &multiple) |
Count the values in a grid. More... | |
int | main (int argc, char **argv) |
TEST (DivideBounds, zeroes) | |
TEST (DivideBounds, iterative_tests) | |
TEST (DivideBounds, recursive_tests) | |
void countValues | ( | const nav_grid::VectorNavGrid< unsigned char > & | grid, |
unsigned int & | match, | ||
unsigned int & | missed, | ||
unsigned int & | multiple | ||
) |
Count the values in a grid.
[in] | The | grid |
[out] | match | Number of values == 1 |
[out] | missed | Number of values == 0 |
[out] | multiple | Number of other values |
Definition at line 49 of file bounds_test.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 195 of file bounds_test.cpp.
TEST | ( | DivideBounds | , |
zeroes | |||
) |
Definition at line 79 of file bounds_test.cpp.
TEST | ( | DivideBounds | , |
iterative_tests | |||
) |
This test is for the divideBounds method and takes grids of various sizes (cycled through with the outer two loops) and tries to divide them into subgrids of various sizes (cycled through with the next two loops). The resulting vector of bounds should cover every cell in the original grid, so each of the divided bounds is iterated over, adding one to each grid cell. If everything works perfectly, each cell should be touched exactly once.
Definition at line 101 of file bounds_test.cpp.
TEST | ( | DivideBounds | , |
recursive_tests | |||
) |
This test is for the divideBounds method and calls it recursively to ensure that the method works when the minimum values in the original bounds are not zero.
Definition at line 151 of file bounds_test.cpp.