Debian Codegraph @

test_suite/unit_tests/Instrumentation/test_navRadio.hxx

raw symbols SCIP
1 /*
2 * Copyright (C) 2018 Edward d'Auvergne
3 *
4 * This file is part of the program FlightGear.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20
21 #ifndef _FG_NAVRADIO_UNIT_TESTS_HXX
22 #define _FG_NAVRADIO_UNIT_TESTS_HXX
23
24 #include <memory>
25 #include <string>
26
27 #include <cppunit/extensions/HelperMacros.h>
28 #include <cppunit/TestFixture.h>
29
30 class FGNavRadio;
31 class SGGeod;
32
33 // The flight plan unit tests.
34 class NavRadioTests : public CppUnit::TestFixture
35 {
36 // Set up the test suite.
37 CPPUNIT_TEST_SUITE(NavRadioTests);
38 CPPUNIT_TEST(testBasic);
39
40 CPPUNIT_TEST(callNavRadioCDI);
41 CPPUNIT_TEST(callNewNavRadioCDI);
42 CPPUNIT_TEST(callNavRadioILS);
43 CPPUNIT_TEST(callNewNavRadioILS);
44 CPPUNIT_TEST(callNavRadioGS);
45 CPPUNIT_TEST(callNewNavRadioGS);
46
47 CPPUNIT_TEST(testGS);
48 CPPUNIT_TEST(testILSFalseCourse);
49 CPPUNIT_TEST(testILSPaired);
50 CPPUNIT_TEST(testILSAdjacentPaired);
51 CPPUNIT_TEST(testGlideslopeLongDistance);
52
53 CPPUNIT_TEST(testVORSignalQuality);
54
55 CPPUNIT_TEST_SUITE_END();
56
57 void setPositionAndStabilise(FGNavRadio* r, const SGGeod& g);
58 std::unique_ptr<FGNavRadio> testVORSignalQuality_setup(
59 const std::string& name, int index);
60 double testVORSignalQuality_maxRateOfChange(bool changeStandbyFreq);
61
62 public:
63 // Set up function for each test.
64 void setUp();
65
66 // Clean up after each test.
67 void tearDown();
68
69 std::string formatFrequency(double f);
70
71 // The tests.
72 void testBasic();
73
74 void callNavRadioCDI();
75 void callNewNavRadioCDI();
76 void callNavRadioILS();
77 void callNewNavRadioILS();
78 void callNavRadioGS();
79 void callNewNavRadioGS();
80
81 void testGS();
82 void testILSFalseCourse();
83 void testILSPaired();
84 void testILSAdjacentPaired();
85 void testGlideslopeLongDistance();
86
87 void testVORSignalQuality();
88 };
89
90
91 #endif // _FG_NAVRADIO_UNIT_TESTS_HXX