1
0
Fork 0
Commit graph

61 commits

Author SHA1 Message Date
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
Edward d'Auvergne
128c3f0c03 TestSuite: Allow the test_suite target to build again.
Previously it could only be built if the ALL target was built first.
2019-06-14 15:04:17 +02: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
401a0dd22d TestSuite: Silence some warnings. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
688f0b5ea0 TestSuite: Minor output formatting changes and disabling of the GUI tests.
The GUI tests are disabled as there are no such tests yet.
2018-07-26 15:52:07 +02:00
Edward d'Auvergne
ab36c9760d TestSuite: Command line option for disabling the summary printout. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
f8c2cb5284 TestSuite: Migration of the old Navaids tests to the CppUnit framework.
This test suffers from significant bit-rot (it is designed for operation prior
to the NavDataCache), so it is deactivated.
2018-07-26 15:52:07 +02:00
Edward d'Auvergne
02c3c6dc97 TestSuite: Migration of the old GPS tests to the CppUnit framework.
As this code has significant bit-rot and requires a lot of work to compile and
run again, it is currently deactivated.

The test also writes to the files "/Users/jmt/Desktop/airways.kml" and
"/Users/jmt/Desktop/procedures.kml" and would need to be modified to write to a
temporary directory and the file contents reread and checked by the test.
2018-07-26 15:52:07 +02: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
8d0db45c51 TestSuite: Shifted the non-functional src/GUI/layout-test.cxx file to the attic. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
0ea357b04c TestSuite: Improved memory management for the event manager.
In the initTestGlobals() helper function, the event manager is added to the subsystem manager (both
created by the FGGlobals ctor).  This allows the event manager to be destroyed via the subsystem
manager in the FGGlobals dtor.
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
ba5b472705 TestSuite: Elimination of the now unused ENABLE_TESTS CMake variable. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
feb854946e TestSuite: Complete removal of FG_TESTLIB. 2018-07-26 15:52:07 +02:00
Edward d'Auvergne
77b1ec5928 TestSuite: Move of all ancient non-functional tests into test_suite/attic/. 2018-07-26 15:52:06 +02:00
Edward d'Auvergne
2aa8d8ccbf TestSuite: Activation of the runtime headless mode whenever globals are set up. 2018-07-26 15:52:06 +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
63d751c15e TestSuite: Always capture OSG logging.
The NotifyLogger class from src/Viewer/fg_os_osgviewer.cxx has been shifted into
a simgear header file so that it can be reused within the test suite.
2018-07-26 15:52:06 +02:00
Edward d'Auvergne
acb3307a1a TestSuite: Migration of the AeroMesh 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
112d64f828 TestSuite: Helper functions for setting up a dummy renderer and FGScenery. 2018-06-07 11:17:04 +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
a22c53a807 TestSuite: Temporary fix for CTests yet to be ported into the CppUnit framework. 2018-06-05 14:33:01 +02:00
Edward d'Auvergne
8eb4d76411 TestSuite: Fix for the summary and return status of the tests. 2018-05-07 12:41:22 +02:00
Edward d'Auvergne
9583e2d7ad TestSuite: Addition of a test data store singleton.
This is for currently for storing the path to FGData for use in any tests
requiring it.
2018-04-13 10:17:30 +02:00
Edward d'Auvergne
3b79530b06 CMake: Split the target links and includes into separate CMake modules. 2018-04-05 21:06:02 +02:00
Edward d'Auvergne
6a730b5820 CMake: The main sources/headers have been shifted into FG_{SOURCES,HEADERS}.
This allows the sources and headers in src/Main/ to be used by other targets.
They are grouped into the new "Main" flightgear component via the macro in the
FlightGearComponent CMake module.  The bootstrap.cxx file with its main function
has been separated out into a separate variable MAIN_SOURCE for use by the fgfs
binary.

All these files have therefore been removed from the test_suite CMakeLists.txt
file, as they are added via FG_SOURCES and FG_HEADERS.  The MSVC grouping code
also does not need to deal with the now deleted separate SOURCE and HEADER
variables for these files.
2018-04-05 21:06:02 +02:00
Edward d'Auvergne
08386db6ff TestSuite: Comment rewording as the CMake file is no longer a copy from Main. 2018-04-05 21:06:02 +02:00
Edward d'Auvergne
93c4aab885 CMake: Shifted the MSVC grouping code into its own CMake module.
This is for simplifying the main src/Main/CMakeLists.txt file and allowing the
code to be shared with the test suite.
2018-04-05 21:05:54 +02:00
Edward d'Auvergne
f8e57f921d CMake: Shifted the FlightGear embedded resources code into its own CMake module.
This is for simplifying the main src/Main/CMakeLists.txt file and allowing the
code to be shared with the test suite.

The generated source and header files have also been removed from the main
source list and placed in the CMake module as the global variables
EMBEDDED_RESOURCE_SOURCES and EMBEDDED_RESOURCE_HEADERS.
2018-04-05 21:05:30 +02:00
Edward d'Auvergne
bd3a3db50b CMake: Shifted the target setup code into its own CMake module.
This is for simplifying the main src/Main/CMakeLists.txt file and allowing the
code to be shared with the test suite.
2018-04-05 21:05:16 +02:00
Edward d'Auvergne
28a77ed1d9 TestSuite: Only include Qt components if FG_TESTLIB is not set.
This is a fix for abc4cdb4c0 that allows fgfs to
build, without having to expand the fgtestlib to include Qt GUI sources.
2018-03-29 17:19:13 +02:00
Florent Rougon
abc4cdb4c0 TestSuite: call flightgear::shutdownQtApp() from fgtest::shutdownTestGlobals()
Some of the unit tests defined with the new test infrastructure[1]
initialize the QApplication; for these tests, it is necessary to ensure
that the QApplication instance is destroyed before exit() begins,
otherwise we get a segfault when run_test_suite terminates (see [2]).

In order to prevent this segfault from happening, call
flightgear::shutdownQtApp() unconditionally from
fgtest::shutdownTestGlobals() as long as Qt support is compiled in
(flightgear::shutdownQtApp() is safe to call even if the QApplication
hasn't been initialized).

[1] Currently, the three PosInitTests::* tests.
[2] https://bugreports.qt.io/browse/QTBUG-48709
2018-03-29 00:39:38 +02:00
Edward d'Auvergne
32d74493c4 TestSuite: The fatal exit() call has been removed from the globals setup.
The exceptions that occur after this call can be handled by CppUnit, but the
exit() results in the test suite silently exiting without restoring stdout and
stderr.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
98debee29c TestSuite: Addition of the ENABLE_AUTOTESTING CMake option.
This allows for finer control of the test suite execution.  The default of ON
will cause the test-suite to be executed after compiling the test_suite target.
2018-03-23 17:26:05 +01:00
Edward d'Auvergne
2786b6b678 TestSuite: Better memory management for globals by using std::unique_ptr. 2018-03-23 17:26:05 +01: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