| 123 | } |
| 124 | |
| 125 | int main() { |
| 126 | |
| 127 | const std::vector<std::vector<float>> grid{ |
| 128 | {0, 0, 1, 0, 0}, |
| 129 | {0, 0, 1, 0, 0}, |
| 130 | {0, 0, 1, 0, 0}, |
| 131 | {0, 0, 1, 0, 0}, |
| 132 | {0, 0, 1, 0, 0}}; |
| 133 | |
| 134 | const std::vector<std::vector<float>> solution_grid{ |
| 135 | {1, 1, 1, 0, 0}, |
| 136 | {1, 1, 1, 0, 0}, |
| 137 | {1, 1, 1, 0, 0}, |
| 138 | {1, 1, 1, 0, 0}, |
| 139 | {1, 1, 1, 0, 0}}; |
| 140 | |
| 141 | const CartesianIndex start_loc{1, 1}; |
| 142 | |
| 143 | auto test_grid = grid; |
| 144 | recursive_fill(test_grid, start_loc, 0.0, 1.0); |
| 145 | assert(test_grid == solution_grid); |
| 146 | |
| 147 | test_grid = grid; |
| 148 | queue_fill(test_grid, start_loc, 0.0, 1.0); |
| 149 | assert(test_grid == solution_grid); |
| 150 | |
| 151 | test_grid = grid; |
| 152 | stack_fill(test_grid, start_loc, 0.0, 1.0); |
| 153 | assert(test_grid == solution_grid); |
| 154 | |
| 155 | return EXIT_SUCCESS; |
| 156 | } |
nothing calls this directly
no test coverage detected