diff --git a/test_suite/FGTestApi/CMakeLists.txt b/test_suite/FGTestApi/CMakeLists.txt index a68aeb00c..045ba7dde 100644 --- a/test_suite/FGTestApi/CMakeLists.txt +++ b/test_suite/FGTestApi/CMakeLists.txt @@ -1,6 +1,7 @@ set(TESTSUITE_SOURCES ${TESTSUITE_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/globals.cxx + ${CMAKE_CURRENT_SOURCE_DIR}/NavDataCache.cxx ${CMAKE_CURRENT_SOURCE_DIR}/PrivateAccessorFDM.cxx ${CMAKE_CURRENT_SOURCE_DIR}/scene_graph.cxx PARENT_SCOPE @@ -10,6 +11,7 @@ set(TESTSUITE_SOURCES set(TESTSUITE_HEADERS ${TESTSUITE_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/globals.hxx + ${CMAKE_CURRENT_SOURCE_DIR}/NavDataCache.hxx ${CMAKE_CURRENT_SOURCE_DIR}/PrivateAccessorFDM.hxx ${CMAKE_CURRENT_SOURCE_DIR}/scene_graph.hxx PARENT_SCOPE diff --git a/test_suite/FGTestApi/NavDataCache.cxx b/test_suite/FGTestApi/NavDataCache.cxx new file mode 100644 index 000000000..d29161c64 --- /dev/null +++ b/test_suite/FGTestApi/NavDataCache.cxx @@ -0,0 +1,25 @@ +#include "NavDataCache.hxx" + +#include + + +namespace FGTestApi { + +namespace setUp { + +void initNavDataCache() +{ + flightgear::NavDataCache* cache = flightgear::NavDataCache::createInstance(); + if (cache->isRebuildRequired()) { + std::cerr << "Navcache rebuild for testing" << std::flush; + + while (cache->rebuild() != flightgear::NavDataCache::REBUILD_DONE) { + SGTimeStamp::sleepForMSec(1000); + std::cerr << "." << std::flush; + } + } +} + +} // End of namespace setUp. + +} // End of namespace FGTestApi. diff --git a/test_suite/FGTestApi/NavDataCache.hxx b/test_suite/FGTestApi/NavDataCache.hxx new file mode 100644 index 000000000..c7a819281 --- /dev/null +++ b/test_suite/FGTestApi/NavDataCache.hxx @@ -0,0 +1,15 @@ +#ifndef FG_NAV_DATA_CACHE_TEST_HELPERS_HXX +#define FG_NAV_DATA_CACHE_TEST_HELPERS_HXX + +namespace FGTestApi { + +namespace setUp { + + +void initNavDataCache(); + +} // End of namespace setUp. + +} // End of namespace FGTestApi. + +#endif // of FG_NAV_DATA_CACHE_TEST_HELPERS_HXX diff --git a/test_suite/FGTestApi/globals.cxx b/test_suite/FGTestApi/globals.cxx index d857ed706..42771a793 100644 --- a/test_suite/FGTestApi/globals.cxx +++ b/test_suite/FGTestApi/globals.cxx @@ -1,4 +1,3 @@ - #include "config.h" #include "test_suite/dataStore.hxx" @@ -12,28 +11,17 @@ #include
#include
-#include #include