| Directory: | ./ |
|---|---|
| File: | include/shared_memory/tests/tests.h |
| Date: | 2022-06-30 06:29:57 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 12 | 12 | 100.0% |
| Branches: | 12 | 24 | 50.0% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /** | ||
| 2 | * @file tests.h | ||
| 3 | * @author Vincent Berenz | ||
| 4 | * @license License BSD-3-Clause | ||
| 5 | * @copyright Copyright (c) 2019, New York University and Max Planck | ||
| 6 | * Gesellschaft. | ||
| 7 | * @date 2019-05-22 | ||
| 8 | * | ||
| 9 | * @brief Header of the unittests of this package. | ||
| 10 | */ | ||
| 11 | #include <map> | ||
| 12 | #include <string> | ||
| 13 | #include <vector> | ||
| 14 | |||
| 15 | #define DATA_EXCHANGE_QUEUE_SIZE 1000 | ||
| 16 | |||
| 17 | namespace shared_memory_test | ||
| 18 | { | ||
| 19 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string segment_id("unit_test_segment"); |
| 20 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string segment_cv_id("unit_test_cv_segment"); |
| 21 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string segment_mutex_id("unit_test_mutex_segment"); |
| 22 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string object_id("unit_test_object"); |
| 23 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string cond_var_id("unit_test_cond_var"); |
| 24 | |||
| 25 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string exchange_manager_segment_id("em_test_segment"); |
| 26 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string exchange_manager_object_id("em_test_object"); |
| 27 | |||
| 28 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string concurrent_proc1_ready("concurrent_proc1_ready"); |
| 29 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string concurrent_proc2_ready("concurrent_proc2_ready"); |
| 30 | |||
| 31 | const double test_double = 4.4; | ||
| 32 | const float test_float = 4.4; | ||
| 33 | const int test_int = 3; | ||
| 34 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string test_string("test_string"); |
| 35 | const double test_array[4] = {1.1, 2.2, 3.3, 4.4}; | ||
| 36 | const unsigned int test_array_size = 4; | ||
| 37 | const int map_int_keys1 = 0; | ||
| 38 | const int map_int_keys2 = 1; | ||
| 39 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string map_string_keys1("s1"); |
| 40 |
1/2✓ Branch 2 taken 54 times.
✗ Branch 3 not taken.
|
54 | const std::string map_string_keys2("s2"); |
| 41 | const double map_value_1 = 3.3; | ||
| 42 | const double map_value_2 = 4.4; | ||
| 43 | const double concurrent_value_1 = 1.0; | ||
| 44 | const double concurrent_value_2 = 2.0; | ||
| 45 | const double concurrent_stop_value = 3.0; | ||
| 46 | |||
| 47 | const unsigned int test_map_size = 2; | ||
| 48 | |||
| 49 | const int nb_to_consume = 100; | ||
| 50 | |||
| 51 | enum Actions | ||
| 52 | { | ||
| 53 | set_double = 1, | ||
| 54 | set_int, | ||
| 55 | set_float, | ||
| 56 | set_string, | ||
| 57 | set_vector, | ||
| 58 | set_eigen_vector, | ||
| 59 | set_int_double_map, | ||
| 60 | set_string_double_map, | ||
| 61 | set_double_array, | ||
| 62 | set_string_vector_double_map, | ||
| 63 | set_string_vector_eigen_map, | ||
| 64 | concurrent_1, | ||
| 65 | concurrent_2, | ||
| 66 | locked_condition_variable, | ||
| 67 | condition_variable, | ||
| 68 | exchange_manager, | ||
| 69 | }; | ||
| 70 | } // namespace shared_memory_test | ||
| 71 |