1
0
Fork 0
Commit graph

54 commits

Author SHA1 Message Date
James Turner
c1e5cc3074 Improve creating VIA segments
Improve argument parsing for createViaTo, createViaFromTo to
handle Airway ghosts as well as strings. As part of this, allow
specification of the airway level explicitly when looking
up an airway.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2686/
2022-01-05 15:44:50 +00:00
Julian Smith
1b7e8504ef test_suite/unit_tests/: cope with getStringValue() now returning std::string. 2021-12-27 10:19:34 +00:00
James Turner
4236cee7b2 Another waypoint selection test from MikeD
Currently selects the wrong VOR, bvut the code is working as
designed, we think.
2021-09-02 11:29:02 +01:00
James Turner
45d969f319 Add tests cases around bug 2616
Can't reproduce this, but capturing in a unit-test just to make sure.

SF-Ticket: https://sourceforge.net/p/flightgear/codetickets/2616/
2021-08-21 13:09:39 +01:00
James Turner
4bf88a0b67 Extend unit-test for route-manager waypoint selection
SF-Ticket: https://sourceforge.net/p/flightgear/codetickets/2372/
2021-08-20 12:08:17 +01:00
James Turner
e8952b6c0f Update tests for revised Subsystem API 2021-04-25 19:18:56 +01:00
James Turner
7a3f8276a6 Add unit-tests for Route-manager commands
Fix some bugs in insert-waypt command discovered during the testing
(w00t, tests FTW)
2020-12-14 11:45:46 +00:00
James Turner
72f1b84837 Improve waypointFromString logic
- exclude POIs and some other types from the ident match, to avoid
  confusing results
- improve how the search vicinity is computed when inserting a leg,
  which is the common case for a route with a destination set. Use
  the midpoint of the leg ending at the insert position, as the optimal
  search vicinity
- move the waypointFromString code into route.cxx, since it is mostly
  independent of a FlightPlan instance
- extend the tests to cover the bug which flagged these issues

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2372/
2020-12-13 17:55:32 +00:00
Scott Giese
43c530b660 Modernize: std::string_literals 2020-12-05 14:25:59 -06:00
legoboyvdlp R
b00520ffdb Add test case for issue with routepath at Paro. Also add support for approaches to the TestDelegate. 2020-10-13 09:32:11 +01:00
James Turner
a297c89144 Flightplans: add clearAll, rename clear -> clearLegs
Improve naming of clear() methods, and expose the new ones to Nasal.
this will allow RouteManager dialog ‘clear’ button to clear all, soon.

See ticket:
https://sourceforge.net/p/flightgear/codetickets/2064/
2020-08-17 16:11:10 +01:00
legoboyvdlp R
d6b7eaf60f Fix that tp_type will return nil for transitions 2020-07-30 12:26:04 +01:00
legoboyvdlp R
668b499ff4 Correct restrictions above and below. Add test case. Fix contributed by Tobias Dammers 2020-07-30 12:25:02 +01:00
legoboyvdlp R
3255105190 Ensure that cruise parameters are set when cloning flightplan 2020-07-22 11:31:07 +01:00
James Turner
2f4b2153ef Fix test: find airways.
Fix handling of ‘both’ level option in several places, and amend
the test to make it explicit that we want Clacton VOR, not NDB.
2020-07-16 11:28:50 +01:00
legoboyvdlp R
cd5a0ffe0b Expose totalDistanceNm to Nasal flightplan ghost
Requested by Tobias Dammers, includes associated test. 
May be cherry-picked to 2020.2.
2020-06-30 13:30:35 +01:00
legoboyvdlp R
585c821bde Extend wp.hidden unit test to ensure path is empty after a hidden waypoint 2020-06-19 09:47:16 +01:00
legoboyvdlp R
f05c10e13a Add test for airway() nasal function 2020-06-18 09:22:03 +01:00
legoboyvdlp R
b210f9e253 Add test for cloning flightplan with approach transitions 2020-06-10 17:18:23 +01:00
James Turner
58d7454976 Explicit support for approach transitions
Make the handling of approach transitions consistent with SID and STAR
transitions, including the Nasal API. Add some tests to cover the
new features.
2020-05-27 21:44:59 +01:00
James Turner
55ce199535 Fixes for cloning FPs with procedures 2020-05-27 16:09:18 +01:00
legoboyvdlp R
1a94f4858b Test for cloning plan with procedures 2020-05-25 09:42:52 +01:00
legoboyvdlp R
14c729027c Tests for cloning flightplan.
Two initial tests: basic flightplan and with fgfp-loaded flightplan
2020-05-25 09:42:44 +01:00
James Turner
54f660764e Tests: change how we find+load data files
Avoid encoding test-data as strings, since this exceeds MSVC limits
on string literals, and tests don’t need to be relocatable anyway,
so we can just hard-code the source location into config.h
2020-05-24 14:14:35 +01:00
James Turner
d66edf42f5 Expose new index-of-interest FP methods to Nasal
Add some test checks for the Nasal API as well
2020-05-22 15:52:54 +01:00
James Turner
fffcd14362 Fix FlightPlan procedure transition handling
Overhaul how transitions are stored in FlightPlan XML, and how
they’re exposed to Nasal. Simplify the Nasal access by making
‘sid_trans’ and ‘star_trans’ writeable.

Extend the unit-tests a lot to cover this, both from C++ and also
from Nasal

As part of this, overhaul the ownership of FlightPlan delegate
factories, to make it safer (use ref-counting of the factories,
and allow the factory to customise delegate clean-up behaviour)
2020-05-21 22:32:28 +01:00
James Turner
8af20fbcab Fix for loading of FGFP plans.
Where the plan does not contain departure / arrival WPs, fire the
corresponding delegate methods after load, to run the selection logic.

Also, add a ‘loaded’ delegate callback, to give delegates a chance to
perform validation and fix-up after all flight-plan loads.
2020-05-19 22:01:42 +01:00
legoboyvdlp R
5747b51df3 Add test for fgfp procedures (failing) 2020-05-14 11:32:49 +01:00
James Turner
134685b527 Fix FP delegate when loading GPXs
When load a GPX route, run normal departure/arrival airport callbacks
on the delegates. (They are blocked for ‘native’ XML routes to avoid
losing SIDs and STARs)

https://sourceforge.net/p/flightgear/codetickets/2227/
2020-05-03 08:30:18 +01:00
James Turner
6baa55b36b Waypoint hiding support (for the A320, etc)
To support FMS which delete ‘past’ waypoints, add some helpers:
 - waypoints can be flagged as hidden, this property is exposed to Nasal
 - currentWP() accepts an offset parameter, allowing FlightPlan indexing
   to treat the current WP as index 0
 - a ‘numRemainingWaypoints()’ function on flightPlan in Nasal, again
   to range how many waypoints are left, starting from the current WP

Add some basic tests of these new features to the route-manager tests.
2020-05-01 09:28:42 +01:00
James Turner
b85048db2d GPS/FLightPlan test updates
- fix reseting of the NavData each test
- improve the test-pilot’s GPS following (reduce turn range close
   to the desired course)
- test DME intercepts
2020-04-21 15:48:41 +01:00
James Turner
b016c4b489 GPS/FP radial-intercept tests
By Jonathan Redpath, with some additions from me. Starting to exercise
both GPS and route-path for radial intercepts
2020-04-20 11:03:35 +01:00
James Turner
492c6daeca Bugfix for DISCON GPS test
Relocate before starting the GPS, to avoid confusion when we teleport
2020-04-19 17:04:46 +01:00
James Turner
17774dbe4c FlightPlan: DISCON works with pointAlongRoute
Add some tests for the default GPS / route-manager handling of
DISCON in flight-plans. Especially check behaviour when sequencing
a DISCON, and resuming with a Direct-to after one. 

This requires a corresponding FGData update to the default GPS Nasal.
2020-04-19 16:44:49 +01:00
James Turner
1a925b152d FlightPlan: don’t assert on invalid waypoints
When there is no first anchor waypoint (eg a runway or navaid), avoid
asserts from the RoutePath code.
2020-04-19 12:27:50 +01:00
James Turner
4c0965e3c1 Some initial tests for route discontinuities.
Probably many more to add, but this is some basic testing at least of
inserting, querying and removing discontinuities.
2020-04-15 16:11:33 +01:00
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
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
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
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
1c58de62ed Route-manager unit-tests
Also contains large extensions to the TestPilot helper
2019-09-18 23:42:39 +01:00
James Turner
21a8e89a0a Basic flight-plan/leg tests for GPS 2019-09-18 23:42:38 +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
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
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