Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a unit test for the
FGAtmosphere
class in preparation for further changes that will address the topics mentioned in #666 (comment) (static members & methods) and #815 (comment) (MSIS atmospheric model).The unit test in this PR will provide a means to check that no regressions will be introduced by future changes to
FGAtmosphere
.In the process of writing this unit test, the following bugs have been discovered and fixed:
FGAtmosphere::InitModel()
,Viscosity
andKinematicViscosity
were computed beforeSLTemperature
was initialized resulting in incorrect values of air viscosity.FGAtmosphere::Calculate()
the density was ignoring the values from the propertiesatmosphere/override/temperature
oratmosphere/override/pressure
if one or both of these features were used.FGAtmosphere::SetPressureSL()
,SLdensity
was not updated despite the fact thatSLpressure
was modified.FGAtmosphere::SetTemperatureSL()
,SLdensity
andSLsoundspeed
were not updated despite the fact thatSLtemperature
was modified.ConvertToRankine
,ConvertFromPSF
, etc.) now always raise an exception. Previously, some conversion routines silently swallowed the error returning null temperatures or pressures in the process. And as has been discussed in issue FGStandardAtmosphere:CalculatePressureAltitude() can cause NaN values #815, null temperature and pressure are evil !FGAtmosphere
did not initialize its members: that stage was defered to the call toInitModel()
. This is evil because you never know what code might be executed between the construction and the call toInitModel()
.