2018-06-06 18:18:48 +00:00
|
|
|
#include "test_navaids2.hxx"
|
|
|
|
|
2018-07-16 13:59:21 +00:00
|
|
|
#include "test_suite/FGTestApi/globals.hxx"
|
2018-06-10 13:43:20 +00:00
|
|
|
#include "test_suite/FGTestApi/NavDataCache.hxx"
|
2018-06-06 18:18:48 +00:00
|
|
|
|
|
|
|
#include <Navaids/NavDataCache.hxx>
|
|
|
|
#include <Navaids/navrecord.hxx>
|
|
|
|
#include <Navaids/navlist.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
// Set up function for each test.
|
|
|
|
void NavaidsTests::setUp()
|
|
|
|
{
|
2018-07-16 13:59:21 +00:00
|
|
|
FGTestApi::setUp::initTestGlobals("navaids2");
|
2018-06-10 13:43:20 +00:00
|
|
|
FGTestApi::setUp::initNavDataCache();
|
2018-06-06 18:18:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Clean up after each test.
|
|
|
|
void NavaidsTests::tearDown()
|
|
|
|
{
|
2018-07-16 13:59:21 +00:00
|
|
|
FGTestApi::tearDown::shutdownTestGlobals();
|
2018-06-06 18:18:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|