1
0
Fork 0
flightgear/tests/test_navaids2.cxx
Edward d'Auvergne 0f96032487 TestSuite: Shift of the globals unit test helper functions into the test suite.
The setting of the SG log levels and developer mode has been removed as this
clashes with the output control set by the test suite main() function.
2018-03-23 17:26:05 +01:00

29 lines
689 B
C++

#include "test_suite/helpers/globals.hxx"
#include <simgear/misc/test_macros.hxx>
#include <Navaids/NavDataCache.hxx>
#include <Navaids/navrecord.hxx>
#include <Navaids/navlist.hxx>
void testBasic()
{
SGGeod egccPos = SGGeod::fromDeg(-2.27, 53.35);
FGNavRecordRef tla = FGNavList::findByFreq(115.7, egccPos);
SG_CHECK_EQUAL(strcmp(tla->get_ident(), "TNT"), 0);
SG_CHECK_EQUAL(tla->ident(), "TNT");
SG_CHECK_EQUAL(tla->name(), "TRENT VOR-DME");
SG_CHECK_EQUAL(tla->get_freq(), 11570);
SG_CHECK_EQUAL(tla->get_range(), 130);
}
int main(int argc, char* argv[])
{
fgtest::initTestGlobals("navaids2");
testBasic();
fgtest::shutdownTestGlobals();
}