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.
Test case: Test_LD_Execute_AutoLanded(), Test_LD_Execute_AutoFlying()
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.