Test Nasal airport.taxiways API
This commit is contained in:
parent
7961f12e81
commit
335d0003cc
2 changed files with 18 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
||||||
#include "testNasalSys.hxx"
|
#include "testNasalSys.hxx"
|
||||||
|
|
||||||
#include "test_suite/FGTestApi/testGlobals.hxx"
|
#include "test_suite/FGTestApi/testGlobals.hxx"
|
||||||
|
#include "test_suite/FGTestApi/NavDataCache.hxx"
|
||||||
|
|
||||||
#include <simgear/structure/commands.hxx>
|
#include <simgear/structure/commands.hxx>
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
void NasalSysTests::setUp()
|
void NasalSysTests::setUp()
|
||||||
{
|
{
|
||||||
FGTestApi::setUp::initTestGlobals("NasalSys");
|
FGTestApi::setUp::initTestGlobals("NasalSys");
|
||||||
|
FGTestApi::setUp::initNavDataCache();
|
||||||
|
|
||||||
fgInitAllowedPaths();
|
fgInitAllowedPaths();
|
||||||
globals->get_props()->getNode("nasal", true);
|
globals->get_props()->getNode("nasal", true);
|
||||||
|
@ -150,3 +152,17 @@ void NasalSysTests::testCommands()
|
||||||
CPPUNIT_ASSERT(!ok);
|
CPPUNIT_ASSERT(!ok);
|
||||||
CPPUNIT_ASSERT_EQUAL(19, fgGetInt("/foo/test"));
|
CPPUNIT_ASSERT_EQUAL(19, fgGetInt("/foo/test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NasalSysTests::testAirportGhost()
|
||||||
|
{
|
||||||
|
auto nasalSys = globals->get_subsystem<FGNasalSys>();
|
||||||
|
nasalSys->getAndClearErrorList();
|
||||||
|
|
||||||
|
bool ok = FGTestApi::executeNasal(R"(
|
||||||
|
var apt = airportinfo('LFBD');
|
||||||
|
var taxiways = apt.taxiways;
|
||||||
|
unitTest.assert_equal(size(taxiways), 0);
|
||||||
|
)");
|
||||||
|
CPPUNIT_ASSERT(ok);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ class NasalSysTests : public CppUnit::TestFixture
|
||||||
CPPUNIT_TEST_SUITE(NasalSysTests);
|
CPPUNIT_TEST_SUITE(NasalSysTests);
|
||||||
CPPUNIT_TEST(testStructEquality);
|
CPPUNIT_TEST(testStructEquality);
|
||||||
CPPUNIT_TEST(testCommands);
|
CPPUNIT_TEST(testCommands);
|
||||||
|
CPPUNIT_TEST(testAirportGhost);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -45,6 +46,7 @@ public:
|
||||||
// The tests.
|
// The tests.
|
||||||
void testStructEquality();
|
void testStructEquality();
|
||||||
void testCommands();
|
void testCommands();
|
||||||
|
void testAirportGhost();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _FG_NASALSYS_UNIT_TESTS_HXX
|
#endif // _FG_NASALSYS_UNIT_TESTS_HXX
|
||||||
|
|
Loading…
Add table
Reference in a new issue