The program contains unit tests to test the correctness of the various functions defined in CA_utils.cpp.
More...
#include "CAdatatypes.h"
#include <cassert>
#include <iostream>
#include <vector>
#include <utility>
|
void | print_success (std::string message) |
| Prints that a specific test passed. More...
|
|
void | test_get_periodic_moore_neighbor_index (int radius) |
| Check returned periodic Moore neighbor index follows the same pattern used to create the flatten neighborhood array. More...
|
|
void | test_get_periodic_von_neumann_neighbor_index (int radius) |
| Check returned periodic Moore neighbor index follows the same pattern used to create the flatten neighborhood array. More...
|
|
void | test_get_neighborhood_size_assert (std::vector< std::pair< int, int > > test_arg_and_expected_value, int rank, CAEnums::Neighborhood nt) |
| Calls get_neighborhood_size and asserts that the returned value equals the expected value. More...
|
|
void | test_get_neighborhood_size () |
| Tests every type of combination possible that get_neighborhood_size is supposed to support.
|
|
void | test_is_diagonal_neighboring_cell_2d () |
| Tests the correctness of the is_diagonal_neighboring_cell_2d method.
|
|
void | test_is_diagonal_neighboring_cell_3d () |
| Tests the correctness of the is_diagonal_neighboring_cell_3d method.
|
|
void | test_get_periodic_index () |
| Tests the correctness of the get_periodic_index method.
|
|
int | main () |
|
The program contains unit tests to test the correctness of the various functions defined in CA_utils.cpp.
- Author
- Emmanuel Cortes (ecort.nosp@m.es@b.nosp@m.erkel.nosp@m.ey.e.nosp@m.du)
Contributor(s)
- Date
- 2022-12-11
◆ print_success()
void print_success |
( |
std::string |
message | ) |
|
Prints that a specific test passed.
- Parameters
-
message | the test function name |
◆ test_get_neighborhood_size_assert()
void test_get_neighborhood_size_assert |
( |
std::vector< std::pair< int, int > > |
test_arg_and_expected_value, |
|
|
int |
rank, |
|
|
CAEnums::Neighborhood |
nt |
|
) |
| |
Calls get_neighborhood_size and asserts that the returned value equals the expected value.
- Parameters
-
test_arg_and_expected_value | Vector of pairs where first is radius test case and second is the expect value |
rank | cell data rank |
nt | neighborhood type |
◆ test_get_periodic_moore_neighbor_index()
void test_get_periodic_moore_neighbor_index |
( |
int |
radius | ) |
|
Check returned periodic Moore neighbor index follows the same pattern used to create the flatten neighborhood array.
- Parameters
-
radius | neighborhood radius |
◆ test_get_periodic_von_neumann_neighbor_index()
void test_get_periodic_von_neumann_neighbor_index |
( |
int |
radius | ) |
|
Check returned periodic Moore neighbor index follows the same pattern used to create the flatten neighborhood array.
- Parameters
-
radius | neighborhood radius |