| 1 |
/* |
| 2 |
* Copyright (C) 2019 James Turner |
| 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_GPS_UNIT_TESTS_HXX |
| 22 |
#define _FG_GPS_UNIT_TESTS_HXX |
| 23 |
|
| 24 |
|
| 25 |
#include <cppunit/extensions/HelperMacros.h> |
| 26 |
#include <cppunit/TestFixture.h> |
| 27 |
|
| 28 |
#include <memory> |
| 29 |
|
| 30 |
#include <simgear/props/props.hxx> |
| 31 |
|
| 32 |
class SGGeod; |
| 33 |
class GPS; |
| 34 |
|
| 35 |
// The flight plan unit tests. |
| 36 |
class GPSTests : public CppUnit::TestFixture |
| 37 |
{ |
| 38 |
// Set up the test suite. |
| 39 |
CPPUNIT_TEST_SUITE(GPSTests); |
| 40 |
CPPUNIT_TEST(testBasic); |
| 41 |
CPPUNIT_TEST(testNavRadioSlave); |
| 42 |
CPPUNIT_TEST(testTurnAnticipation); |
| 43 |
CPPUNIT_TEST(testOBSMode); |
| 44 |
CPPUNIT_TEST(testDirectTo); |
| 45 |
CPPUNIT_TEST(testLegMode); |
| 46 |
CPPUNIT_TEST(testDirectToLegOnFlightplan); |
| 47 |
CPPUNIT_TEST(testLongLeg); |
| •48 |
// CPPUNIT_TEST(testLongLegWestbound); |
| 49 |
CPPUNIT_TEST(testOffsetFlight); |
| 50 |
CPPUNIT_TEST(testOverflightSequencing); |
| 51 |
CPPUNIT_TEST(testOffcourseSequencing); |
| 52 |
CPPUNIT_TEST(testLegIntercept); |
| 53 |
CPPUNIT_TEST(testDirectToLegOnFlightplanAndResumeBuiltin); |
| 54 |
CPPUNIT_TEST(testBuiltinRevertToOBSAtEnd); |
| 55 |
CPPUNIT_TEST(testRadialIntercept); |
| 56 |
// CPPUNIT_TEST(testSWIFT8); |
| 57 |
CPPUNIT_TEST(testDMEIntercept); |
| •58 |
// CPPUNIT_TEST(testFinalLegCourse); |
| 59 |
CPPUNIT_TEST(testCourseLegIntermediateWaypoint); |
| 60 |
CPPUNIT_TEST(testExceedFlyByMaxAngleTurn); |
| 61 |
CPPUNIT_TEST(testFlyOverMaxInterceptAngle); |
| 62 |
|
| 63 |
CPPUNIT_TEST_SUITE_END(); |
| 64 |
|
| 65 |
void setPositionAndStabilise(GPS* gps, const SGGeod& g); |
| 66 |
|
| 67 |
GPS* setupStandardGPS(SGPropertyNode_ptr config = {}, |
| 68 |
const std::string name = "gps", const int index = 0); |
| 69 |
void setupRouteManager(); |
| 70 |
|
| 71 |
public: |
| 72 |
// Set up function for each test. |
| 73 |
void setUp(); |
| 74 |
|
| 75 |
// Clean up after each test. |
| 76 |
void tearDown(); |
| 77 |
|
| 78 |
// The tests. |
| 79 |
void testBasic(); |
| 80 |
void testNavRadioSlave(); |
| 81 |
void testTurnAnticipation(); |
| 82 |
void testOBSMode(); |
| 83 |
void testDirectTo(); |
| 84 |
void testLegMode(); |
| 85 |
void testDirectToLegOnFlightplan(); |
| 86 |
void testLongLeg(); |
| 87 |
void testLongLegWestbound(); |
| 88 |
void testOffsetFlight(); |
| 89 |
void testOffcourseSequencing(); |
| 90 |
void testOverflightSequencing(); |
| 91 |
void testLegIntercept(); |
| 92 |
void testDirectToLegOnFlightplanAndResumeBuiltin(); |
| 93 |
void testBuiltinRevertToOBSAtEnd(); |
| 94 |
void testRadialIntercept(); |
| 95 |
void testSWIFT8(); |
| 96 |
void testDMEIntercept(); |
| 97 |
void testFinalLegCourse(); |
| 98 |
void testCourseLegIntermediateWaypoint(); |
| 99 |
void testExceedFlyByMaxAngleTurn(); |
| 100 |
void testFlyOverMaxInterceptAngle(); |
| 101 |
}; |
| 102 |
|
| 103 |
#endif // _FG_GPS_UNIT_TESTS_HXX |