|
2 | 2 | * Copyright (c) Andre 'Espyo' Silva 2025. |
3 | 3 | * |
4 | 4 | * === FILE DESCRIPTION === |
5 | | - * Unit tests for the spatial navigation library. |
| 5 | + * Unit tests for the Easy Spatial Navigation library. |
6 | 6 | * Please read the included readme file. |
7 | 7 | */ |
8 | 8 |
|
9 | 9 | #include <vector> |
10 | 10 | #include <string> |
11 | 11 |
|
12 | | -#include "../spatial_navigation.h" |
| 12 | +#include "../easy_spat_nav.h" |
13 | 13 |
|
14 | 14 |
|
15 | 15 | constexpr const char* COLOR_BOLD = "\033[1m"; |
@@ -186,15 +186,15 @@ void SpatNavTestInterface::fromString(const std::string& s) { |
186 | 186 |
|
187 | 187 |
|
188 | 188 | /** |
189 | | - * @brief Recursively adds children interfaces to the SpatNav manager. |
| 189 | + * @brief Recursively adds children interfaces to the EasySpatNav manager. |
190 | 190 | * |
191 | 191 | * @param manager The manager. |
192 | 192 | * @param interface Interface whose children to add. |
193 | 193 | * @param itemNr Current item number. |
194 | 194 | * @param interfaceFirstItemNr Item number of the first item in the interface. |
195 | 195 | */ |
196 | 196 | void addChildren( |
197 | | - SpatNav::Interface& manager, SpatNavTestInterface* interface, |
| 197 | + EasySpatNav::Interface& manager, SpatNavTestInterface* interface, |
198 | 198 | size_t& itemNr, size_t interfaceFirstItemNr |
199 | 199 | ) { |
200 | 200 | for(size_t ci = 0; ci < interface->children.size(); ci++) { |
@@ -273,12 +273,12 @@ void test( |
273 | 273 | */ |
274 | 274 | void testNav( |
275 | 275 | const std::string& testDescription, |
276 | | - SpatNavTestInterface& interface, SpatNav::DIRECTION direction, |
| 276 | + SpatNavTestInterface& interface, EasySpatNav::DIRECTION direction, |
277 | 277 | size_t focusedItemNr, size_t expectedItemNr, |
278 | | - const SpatNav::Interface::Heuristics& heuristics = {}, |
279 | | - const SpatNav::Interface::Settings& settings = {} |
| 278 | + const EasySpatNav::Interface::Heuristics& heuristics = {}, |
| 279 | + const EasySpatNav::Interface::Settings& settings = {} |
280 | 280 | ) { |
281 | | - SpatNav::Interface spatNavManager; |
| 281 | + EasySpatNav::Interface spatNavManager; |
282 | 282 | spatNavManager.heuristics = heuristics; |
283 | 283 | spatNavManager.settings = settings; |
284 | 284 |
|
@@ -309,10 +309,10 @@ void testNav( |
309 | 309 | } |
310 | 310 |
|
311 | 311 |
|
312 | | -using SpatNav::DIRECTION_RIGHT; |
313 | | -using SpatNav::DIRECTION_DOWN; |
314 | | -using SpatNav::DIRECTION_LEFT; |
315 | | -using SpatNav::DIRECTION_UP; |
| 312 | +using EasySpatNav::DIRECTION_RIGHT; |
| 313 | +using EasySpatNav::DIRECTION_DOWN; |
| 314 | +using EasySpatNav::DIRECTION_LEFT; |
| 315 | +using EasySpatNav::DIRECTION_UP; |
316 | 316 |
|
317 | 317 |
|
318 | 318 | /** |
@@ -506,17 +506,17 @@ int main(int argc, char** argv) { |
506 | 506 | testNav( |
507 | 507 | "Test that Euclidean distance checks pick the best option.", |
508 | 508 | ifDistances, DIRECTION_UP, 3, 2, |
509 | | - { .distCalcMethod = SpatNav::DIST_CALC_METHOD_EUCLIDEAN } |
| 509 | + { .distCalcMethod = EasySpatNav::DIST_CALC_METHOD_EUCLIDEAN } |
510 | 510 | ); |
511 | 511 | testNav( |
512 | 512 | "Test that taxicab distance checks pick the best option.", |
513 | 513 | ifDistances, DIRECTION_UP, 3, 1, |
514 | | - { .distCalcMethod = SpatNav::DIST_CALC_METHOD_TAXICAB } |
| 514 | + { .distCalcMethod = EasySpatNav::DIST_CALC_METHOD_TAXICAB } |
515 | 515 | ); |
516 | 516 | testNav( |
517 | 517 | "Test that taxicab 2 distance checks pick the best option.", |
518 | 518 | ifDistances2, DIRECTION_UP, 3, 1, |
519 | | - { .distCalcMethod = SpatNav::DIST_CALC_METHOD_TAXICAB_2 } |
| 519 | + { .distCalcMethod = EasySpatNav::DIST_CALC_METHOD_TAXICAB_2 } |
520 | 520 | ); |
521 | 521 |
|
522 | 522 | //Single loop pass. |
|
0 commit comments