1
0
Fork 0

Fixes for Keith’s tests

This commit is contained in:
James Turner 2021-06-08 14:20:13 +01:00
parent 45ac50d2b7
commit 6ab1fdbe0f
4 changed files with 13 additions and 9 deletions

View file

@ -16,6 +16,7 @@
#include <Main/options.hxx>
#include <Main/util.hxx>
#include <Main/FGInterpolator.hxx>
#include <Main/locale.hxx>
#include <Time/TimeManager.hxx>
@ -78,6 +79,9 @@ void initTestGlobals(const std::string& testName)
* destroyed via the subsystem manager.
*/
globals->add_subsystem("events", globals->get_event_mgr(), SGSubsystemMgr::DISPLAY);
// necessary to avoid asserts: mark FGLocale as initialized
globals->get_locale()->selectLanguage({});
}
bool logPositionToKML(const std::string& testName)

View file

@ -49,7 +49,7 @@ void AIFlightPlanTests::setUp()
FGTestApi::setUp::initTestGlobals("AI");
FGTestApi::setUp::initNavDataCache();
globals->add_new_subsystem<FGAIManager>();
globals->add_new_subsystem<FGAIManager>(SGSubsystemMgr::GENERAL);
auto props = globals->get_props();
props->setBoolValue("sim/ai/enabled", true);
@ -276,7 +276,7 @@ void AIFlightPlanTests::testAIFlightPlanLeftCircle()
course += 10;
const auto g1 = SGGeodesy::direct(lastWp->getPos(), course, SG_NM_TO_METER * 5.0);
wp->setPos(g1);
wp->setName("testWp_" + i);
wp->setName("testWp_" + std::to_string(i));
wp->setOn_ground(true);
wp->setGear_down(true);
wp->setSpeed(10);

View file

@ -56,7 +56,7 @@ void TrafficMgrTests::tearDown()
}
void TrafficMgrTests::testParse() {
globals->add_new_subsystem<FGTrafficManager>();
globals->add_new_subsystem<FGTrafficManager>(SGSubsystemMgr::GENERAL);
globals->get_subsystem_mgr()->bind();
globals->get_subsystem_mgr()->init();
@ -108,7 +108,7 @@ void TrafficMgrTests::testTrafficManager()
FGTestApi::setPositionAndStabilise(egeo->geod());
auto tmgr = globals->add_new_subsystem<FGTrafficManager>();
auto tmgr = globals->add_new_subsystem<FGTrafficManager>(SGSubsystemMgr::GENERAL);
tmgr->bind();
tmgr->init();
@ -150,4 +150,4 @@ void TrafficMgrTests::testTrafficManager()
counter++;
}
CPPUNIT_ASSERT_EQUAL(25, counter);
}
}

View file

@ -68,10 +68,10 @@ void GroundnetTests::setUp()
ybbn->testSuiteInjectGroundnetXML(SGPath::fromUtf8(FG_TEST_SUITE_DATA) / "YBBN.groundnet.xml");
globals->add_new_subsystem<PerformanceDB>();
globals->add_new_subsystem<FGATCManager>();
globals->add_new_subsystem<FGAIManager>();
globals->add_new_subsystem<flightgear::AirportDynamicsManager>();
globals->add_new_subsystem<PerformanceDB>(SGSubsystemMgr::GENERAL);
globals->add_new_subsystem<FGATCManager>(SGSubsystemMgr::GENERAL);
globals->add_new_subsystem<FGAIManager>(SGSubsystemMgr::GENERAL);
globals->add_new_subsystem<flightgear::AirportDynamicsManager>(SGSubsystemMgr::GENERAL);
globals->get_subsystem_mgr()->bind();
globals->get_subsystem_mgr()->init();