1
0
Fork 0
Commit graph

98 commits

Author SHA1 Message Date
James Turner
423c754009 Reposition: tolerate more scenarios in ATC_mgr
When starting at an airport, but not at parking or a runway, create
an empty AIFlightPlan, and ensure the AIManager code doesn’t choke on
empty FPs.

Add a unit-test which simulates the C172 tutorial reposition logic,
which is a little gnarly.
2020-10-27 18:32:18 +00: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
830a890eff Tests: skeleton ViewManager/Views tests 2020-09-08 12:31:42 +01:00
James Turner
e46c6f587b AIFlightPlan: remove ‘erase’ option from Decrement
Thankfully, the erase option to DecrementWaypoint was never used, so
remove it, since it’s … mental.
2020-09-05 11:16:36 +01:00
James Turner
02cfaeabba Tests: AIFlightPlan Increment/Decrement
Capture the current behaviour of Increment/DecrementWaypoint in
AI flightplans, prior to making some simplifications. Especially try
to test the behaviour of the ‘increment and erase’ logic.
2020-09-05 11:14:00 +01:00
James Turner
f5b5828bd0 AIFlightPlan: add test for XML parsing
This meant some slight refactoring to expose some easier APIs for
testing, but the normal methods should be unaffected.
2020-09-05 10:44:43 +01:00
James Turner
3a3ff07883 Start testing FGAIFlightPlan 2020-09-05 10:44:43 +01:00
James Turner
1f6b43c38f More AI tests 2020-09-03 17:51:40 +01:00
James Turner
d1fc4b58cb Start creating tests of AIModel code
First test just creates the manager, and ensures the user aircraft
updates in sync with the real aircraft.
2020-09-03 17:51:40 +01:00
James Turner
37d820120d Unit-testing: tests for Nasal SGCommand API
Test adding/removing/invoking commands, and error handles when
duplicate adding and removing a command name.
2020-08-26 17:20:58 +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
02c7b37122 Add test case for issue with last waypoint being a runway 2020-07-30 12:25:17 +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
James Turner
f0d3663102 Nasal unit-testing: allow deep struct equality.
Add a deep comparison of vecs and hashes, when deciding equality in
test assertions.
2020-07-08 15:22:27 +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
ea40f3d424 Adjust LBEL SID departure test work work 2020-05-31 12:16:59 +01:00
James Turner
e51a0c55b5 Fly-by support for Radial intercepts
In the common case, avoid an overshoot when doing radial
intercepts.
2020-05-30 15:59:07 +01:00
James Turner
176ccfa8dc Test updates for new GPS fly-by 2020-05-30 15:59:07 +01:00
legoboyvdlp R
e76787fa62 Add test for Heathrow ILS 27L
To try and diagnose user problems intercepting glideslope at 4000 feet
+ 12 miles.
2020-05-29 16:42:41 +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
1eef7300be PosInit: fix a crash with invalid park-pos.
Add test-cases for this,
2020-05-21 23:19:39 +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
James Turner
63fe5237c6 Improve interaction of —parkpos and repositioning
Re-work how position-init and ATC-manager work together to do
parking assignment and fallback (when the parking is unavailable).
Improve the logic for the reposition case, and teach ATC-manager about
reposition explicitly.

When the parking is unavailable, explicitly fall back to best-runway
selection in finalizePosition.

Add many additional position-init tests, to cover all of this.
2020-05-19 18:00:34 +01:00
legoboyvdlp R
d8b778a59e Add (failing) test for indexOfWP function with procedures 2020-05-18 09:35:16 +01:00
legoboyvdlp R
67d5757133 Add test case for LARPA2F procedure at Barcelona. Potential bug with (500) waypoint. Also, the test pilot decided to fly off on runway heading - my error, or his? 2020-05-14 11:49:03 +01:00
legoboyvdlp R
bdf969e802 Add test for STAR transitions (failing) 2020-05-14 11:32:49 +01:00
legoboyvdlp R
5747b51df3 Add test for fgfp procedures (failing) 2020-05-14 11:32:49 +01:00
legoboyvdlp R
f088734dea Add RNAV test for transitions (failing) 2020-05-14 11:32:49 +01:00
Stuart Buchanan
24c21bf876 Double posinit test
Testcase for running posinit twice.

posinit sets various properties which it then reads, so there's
a possibility that it could write a value which causes unexpected
behaviour when run later.

Unclear if this should be a unit test or a system test, but it's
simple enough to be a unit test.
2020-05-10 14:32:04 +01:00
James Turner
522c742419 Draft version of Nasal unit-testing API
Only the in-sim version works for now, the test-suite mode is not
implemented yet. Also the test API will evolve, but should stay close
to what CppUnit defines.

Run a test file by specifying a path to nasal-test : examples will be
added to FGData shortly.
2020-05-06 15:20:26 +01:00
James Turner
ee3958f971 Skeleton work on Nasal GC test
Incomplete, but the goal is to stess the Nasal GC system by creating
and destroying large number of objects continously.
2020-05-06 15:20:26 +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