WindhoverLabs / airliner

7 stars 3 forks source link

LD app unit test is affected by uninitialized member variables #345

Open ynielson opened 1 year ago

ynielson commented 1 year ago

LD app has member variables which are not explicitly initialized like, "PreviousLandDetectedMsg/altitude_max". The other unitialized member variables are initialized in "LD::InitData()" function.

This affected unit test when I instantiated LD object in the stack to clear out the object for every test case. This may be an issue just for the unit test but these uninitialized member variables are used to compare without being initialized, which may not be zero depending on the optimization level or how the object is used later.

For these reasons, I sometimes used a main object in the stack or from the global area declared extern.