1
0
Fork 0
flightgear/test_suite/unit_tests/Navaids/test_navaids2.cxx
Edward d'Auvergne 88179ec9c1 TestSuite: Implementation of FGTestApi.
The test_suite/helpers directory has been renamed to test_suite/FGTestApi/ and
all the fgtest namespaces renamed to FGTestApi.  The helper functions are now
also placed into either a setUp or tearDown namespace depending on their
function.  And a new FGTestApi::PrivateAccessor::FDM namespace has been created
for holding friend classes used to access private or protected variables or
functions from solely within the test suite.
2018-07-26 15:52:06 +02:00

34 lines
816 B
C++

#include "test_navaids2.hxx"
#include "test_suite/FGTestApi/globals.hxx"
#include <Navaids/NavDataCache.hxx>
#include <Navaids/navrecord.hxx>
#include <Navaids/navlist.hxx>
// Set up function for each test.
void NavaidsTests::setUp()
{
FGTestApi::setUp::initTestGlobals("navaids2");
}
// Clean up after each test.
void NavaidsTests::tearDown()
{
FGTestApi::tearDown::shutdownTestGlobals();
}
void NavaidsTests::testBasic()
{
SGGeod egccPos = SGGeod::fromDeg(-2.27, 53.35);
FGNavRecordRef tla = FGNavList::findByFreq(115.7, egccPos);
CPPUNIT_ASSERT_EQUAL(strcmp(tla->get_ident(), "TNT"), 0);
CPPUNIT_ASSERT(tla->ident() == "TNT");
CPPUNIT_ASSERT(tla->name() == "TRENT VOR-DME");
CPPUNIT_ASSERT_EQUAL(tla->get_freq(), 11570);
CPPUNIT_ASSERT_EQUAL(tla->get_range(), 130);
}