1
0
Fork 0
Commit graph

44 commits

Author SHA1 Message Date
James Turner
3f14d53286 FlightPlans: fix save/load of restrictions, deleting legs from Nasal
- Fix Leg ownership to avoid segfaults when deleting them via Nasal
- Modify FP save/load code so restrictions and holds are correctly
  saved and restored

Extend the tests to cover these cases.
2020-03-10 14:00:40 +00:00
legoboyvdlp R
b920a09fcf Correct whitespace in NasalPositioned.cxx; fix segfault in NasalPositioned by adding null check in the legGhostGetMember method; add test case for segfault 2020-01-27 16:27:46 +00:00
James Turner
45fbdaa9c9 Starting tests for RNAV/procedures
One test so far, attempting to reproduce a bug I see with the 737.

Note these tests are skipped unless you have procedures available
and set a magic env var to find them.
2019-10-16 23:28:52 +01:00
James Turner
36f88f6f07 Rename test globals to testGlobals [.cxx|.hxx] 2019-09-24 11:39:34 +01:00
James Turner
18c19885c6 Improvements to Nasal hold API
Ensure changes from Nasal are picked up by delegates (such as GPS) when
they are made. Add a route-manager test which sets and exits a hold
using Nasal.

As part of this, update the test API to make it easy to run Nasal from
a test.
2019-09-24 11:29:05 +01:00
James Turner
5ce8a942bf RNAV / GPS hold support
The GPS/RNAV system can now fly holds, both left and right-handed.
The correct entry is selected, and hold count can be selected.
Also there's lots of lovely test cases.
2019-09-23 23:01:12 +01:00
James Turner
45df8f51b2 Move GPS sequencing into Nasal (optionally)
GPS now lets the delegate handle the sequencing behaviour, by
setting a new config property. The default GPS delegate (in Nasal)
now sets this property.

This requires a corresponding FGData update.
2019-09-20 13:05:57 +01:00
James Turner
833cc61293 GPS intercept tests 2019-09-20 09:50:55 +01:00
James Turner
19af6994fb GPS : Offset flight test 2019-09-19 17:27:13 +01:00
James Turner
05e99d3a3b More GPS sequencing tests
Also extended the test helpers in various ways.
2019-09-19 17:27:13 +01:00
James Turner
fdb2120b68 GPS: tests for long great-circle legs
Check that everything behaves as expected with legs spanning very
large distances.
2019-09-19 17:27:13 +01:00
James Turner
2434c037c8 Improve Leg mode course/track computation 2019-09-19 17:27:13 +01:00
James Turner
21e9f3d5e9 Disable KML logging in Route-manager test 2019-09-18 23:47:13 +01:00
James Turner
1c09704903 Fix tests until GPS course changes land 2019-09-18 23:42:39 +01:00
James Turner
a2e9374c54 GPS tests 2019-09-18 23:42:39 +01:00
James Turner
1c58de62ed Route-manager unit-tests
Also contains large extensions to the TestPilot helper
2019-09-18 23:42:39 +01:00
James Turner
604a23166b Working on Direct-to tests 2019-09-18 23:42:38 +01:00
James Turner
21a8e89a0a Basic flight-plan/leg tests for GPS 2019-09-18 23:42:38 +01:00
James Turner
e15d67e637 TestPilot helper in the test API
Use this in the GPS tests.
2019-09-18 23:40:36 +01:00
James Turner
24f4de4681 Initial GPS unit test coverage 2019-09-18 23:40:36 +01:00
James Turner
8428cd2a44 Revert "CommRadio: fix tuning 25Khz and 75Khz channels"
Revert this change - I will re-add the unit-tests again, but we need
a different approach for 8.3 stations, than what I did here.

This reverts commit 91cc83abb5.
2019-07-01 06:29:05 +01:00
James Turner
9f8b6f50f9 Fix navRadio tests for revised power supply paths 2019-06-27 15:46:09 +01:00
James Turner
91cc83abb5 CommRadio: fix tuning 25Khz and 75Khz channels
In 8.3 mode, ensure that 25 and 75Khz channels can be tuned using the
abbreviated syntax (eg 118.02 for 118.025). 

As part of this, add test coverage of the CommRadio for basic and 8.3-
mode operation.
2019-06-27 15:45:53 +01:00
James Turner
64eaf6fe03 Fix for route-path when leg 0 is not a runway
Avoid doing turn-computation for the first waypoint, even if it’s not
a runway. Add a unit-test to cover this case.

Reported by Josh Davidson
2019-03-26 22:50:46 +01:00
James Turner
12eac24039 Tests: NavRadio GS tests
Also includes false GS lobe tests
2018-12-10 17:44:09 +00:00
James Turner
a9475bd0fa Basic nav-radio ILS testing
Complex cases still to be added, but this tests the basic reception.
2018-12-04 09:39:36 +01:00
James Turner
c7b28a1960 UNit-tests for the NavRadio
Still needs ILS and GS tests, but starting to be useful already.
2018-11-25 13:12:50 +00:00
James Turner
1cbcae9795 Bugfix: fix range/ident priority of loaded wpts
When the lat-lon of a waypoint disagrees with the discovered ident by
more than a threshold, assume we have a DB mismatch, and just revert
to a basic wpt specified by lat-lon. This avoids inserting huge
legs by selecting a very distant navaid with matching ident

https://sourceforge.net/p/flightgear/codetickets/1814/
2018-10-08 16:40:25 +01:00
James Turner
69dbfc0a27 Core airway and flight-plan enhancements
Add better airway support, fix various issues with VIA, and add
parsing / generation of ICAO route strings. Also fix the
serialisation of flight-plans with airway enroute segments, so these
can be restored correctly.
2018-08-28 12:23:01 +01:00
James Turner
e3d032942e Move aircraft-performance code into a public API
Upcoming flight-planning changes want to use the perf computation code
in route-path, so move it to a public class, and implement some of the
missing functionality, especially correct GS computation for altitude.
2018-08-26 14:39:42 +01:00
Edward d'Auvergne
fff923d2f4 TestSuite: Migration of the HIDInput tests to the CppUnit framework.
The extractBits(), signExtend(), and writeBits() functions of the anonymous
namespace in Input/FGHIDEventInput.cxx have been shifted out of the namespace
and are now exposed via the header.  This is needed as
<Input/FGHIDEventInput.cxx> cannot be imported within the CppUnit
infrastructure, as it is already built into the run_test_suite binary.
2018-07-26 15:52:07 +02:00
Edward d'Auvergne
dbe7c90115 TestSuite: Shifted the YASim atmosphere test into the CppUnit framework. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
99a50508a7 TestSuite: Spun out the NavDataCache initialisation code.
Not all tests will require the NavDataCache, so it is no longer set up with the
dummy globals data structure.
2018-07-26 15:52:06 +02:00
Edward d'Auvergne
b0c5a5481d TestSuite: Migration of the autosaveMigration tests into the CppUnit infrastructure. 2018-07-26 15:52:06 +02:00
Edward d'Auvergne
7aa034bc80 TestSuite: Migration of the AeroElement tests into the CppUnit infrastructure. 2018-07-26 15:52:06 +02:00
Edward d'Auvergne
88179ec9c1 TestSuite: Implementation of FGTestApi.
The test_suite/helpers directory has been renamed to test_suite/FGTestApi/ and
all the fgtest namespaces renamed to FGTestApi.  The helper functions are now
also placed into either a setUp or tearDown namespace depending on their
function.  And a new FGTestApi::PrivateAccessor::FDM namespace has been created
for holding friend classes used to access private or protected variables or
functions from solely within the test suite.
2018-07-26 15:52:06 +02:00
Edward d'Auvergne
3c9d3590d4 TestSuite: Migration of the Navaids tests into the CppUnit infrastructure. 2018-06-06 20:39:25 +02:00
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
Edward d'Auvergne
7616f1ec3e TestSuite: Migration of the posinit unit tests. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
85ad420be1 TestSuite: Migration of the Add-ons management unit tests. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
d51e21c667 TestSuite: Migration of the LaRCSim matrix computation unit tests. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
73a9927c22 TestSuite: Migration of the Flightplan tests into the CppUnit infrastructure. 2018-03-23 17:26:05 +01:00
Edward d'Auvergne
c9122ff84b TestSuite: Converted the old tests/test-mktime.cxx program into a unit test.
This required many time related include files, functions, and variables to be
tested for via CMake, and converted to macros via #cmakedefine, so that they
would be automatically set for the test-mktime.cxx file.
2018-03-23 17:26:04 +01:00
Edward d'Auvergne
8b438cb97e TestSuite: Initial support for a FlightGear test suite based on CppUnit.
This includes the basic CMake infrastructure for building and executing the test
suite.  Four test categories have been added - unit, system/functional, GUI, and
simgear unit tests.  The test suite is run by typing 'make test_suite'.

All of the fgfs sources are included in the new run_test_suite executable,
excluding the bootstrap routine and its main() function.  The test suite
currently consists of a single dummy unit test for the NasalSys subsystem, and a
single demonstration simgear/props unit test.
2018-03-23 17:26:04 +01:00