2018-10-10 08:26:06 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Edward d'Auvergne
|
|
|
|
*
|
|
|
|
* This file is part of the program FlightGear.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _FG_NAVRADIO_UNIT_TESTS_HXX
|
|
|
|
#define _FG_NAVRADIO_UNIT_TESTS_HXX
|
|
|
|
|
2022-11-08 09:34:02 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
2018-10-10 08:26:06 +00:00
|
|
|
|
|
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
#include <cppunit/TestFixture.h>
|
|
|
|
|
|
|
|
class FGNavRadio;
|
|
|
|
class SGGeod;
|
|
|
|
|
|
|
|
// The flight plan unit tests.
|
|
|
|
class NavRadioTests : public CppUnit::TestFixture
|
|
|
|
{
|
|
|
|
// Set up the test suite.
|
|
|
|
CPPUNIT_TEST_SUITE(NavRadioTests);
|
|
|
|
CPPUNIT_TEST(testBasic);
|
2021-01-24 16:09:18 +00:00
|
|
|
|
|
|
|
CPPUNIT_TEST(callNavRadioCDI);
|
|
|
|
CPPUNIT_TEST(callNewNavRadioCDI);
|
|
|
|
CPPUNIT_TEST(callNavRadioILS);
|
|
|
|
CPPUNIT_TEST(callNewNavRadioILS);
|
|
|
|
CPPUNIT_TEST(callNavRadioGS);
|
|
|
|
CPPUNIT_TEST(callNewNavRadioGS);
|
|
|
|
|
2018-10-10 08:26:06 +00:00
|
|
|
CPPUNIT_TEST(testGS);
|
|
|
|
CPPUNIT_TEST(testILSFalseCourse);
|
|
|
|
CPPUNIT_TEST(testILSPaired);
|
|
|
|
CPPUNIT_TEST(testILSAdjacentPaired);
|
2020-05-28 09:45:43 +00:00
|
|
|
CPPUNIT_TEST(testGlideslopeLongDistance);
|
2018-10-10 08:26:06 +00:00
|
|
|
|
2022-11-08 09:34:02 +00:00
|
|
|
CPPUNIT_TEST(testVORSignalQuality);
|
|
|
|
|
2018-10-10 08:26:06 +00:00
|
|
|
CPPUNIT_TEST_SUITE_END();
|
|
|
|
|
2021-01-24 16:09:18 +00:00
|
|
|
void setPositionAndStabilise(FGNavRadio* r, const SGGeod& g);
|
2022-11-08 09:34:02 +00:00
|
|
|
std::unique_ptr<FGNavRadio> testVORSignalQuality_setup(
|
|
|
|
const std::string& name, int index);
|
|
|
|
double testVORSignalQuality_maxRateOfChange(bool changeStandbyFreq);
|
2018-10-10 08:26:06 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
// Set up function for each test.
|
|
|
|
void setUp();
|
|
|
|
|
|
|
|
// Clean up after each test.
|
|
|
|
void tearDown();
|
|
|
|
|
2021-01-24 16:09:18 +00:00
|
|
|
std::string formatFrequency(double f);
|
|
|
|
|
2018-10-10 08:26:06 +00:00
|
|
|
// The tests.
|
|
|
|
void testBasic();
|
2021-01-24 16:09:18 +00:00
|
|
|
|
|
|
|
void callNavRadioCDI();
|
|
|
|
void callNewNavRadioCDI();
|
|
|
|
void callNavRadioILS();
|
|
|
|
void callNewNavRadioILS();
|
|
|
|
void callNavRadioGS();
|
|
|
|
void callNewNavRadioGS();
|
|
|
|
|
2018-10-10 08:26:06 +00:00
|
|
|
void testGS();
|
|
|
|
void testILSFalseCourse();
|
|
|
|
void testILSPaired();
|
|
|
|
void testILSAdjacentPaired();
|
2020-05-28 09:45:43 +00:00
|
|
|
void testGlideslopeLongDistance();
|
2022-11-08 09:34:02 +00:00
|
|
|
|
|
|
|
void testVORSignalQuality();
|
2018-10-10 08:26:06 +00:00
|
|
|
};
|
|
|
|
|
2021-01-24 16:09:18 +00:00
|
|
|
|
2018-10-10 08:26:06 +00:00
|
|
|
#endif // _FG_NAVRADIO_UNIT_TESTS_HXX
|