diff --git a/src/lib/tecs/TECSClosedLoopTest.cpp b/src/lib/tecs/TECSClosedLoopTest.cpp index 12a806b0c5..da572ee5f3 100644 --- a/src/lib/tecs/TECSClosedLoopTest.cpp +++ b/src/lib/tecs/TECSClosedLoopTest.cpp @@ -234,7 +234,7 @@ protected: float run(float duration) { float peak_v_err = 0.f; - const int steps = static_cast(duration / DT + 0.5f); + const int steps = static_cast(std::lround(duration / DT)); for (int i = 0; i < steps; ++i) { @@ -257,7 +257,7 @@ protected: // and airspeed must not drift at all. This exercises that the model and TECS // are self-consistent at the operating point. -TEST_F(TECSClosedLoopTest, SteadyStateCruise_DefaultTuning) +TEST_F(TECSClosedLoopTest, SteadyStateCruiseDefaultTuning) { initAircraftState(); initParams(); @@ -270,7 +270,7 @@ TEST_F(TECSClosedLoopTest, SteadyStateCruise_DefaultTuning) EXPECT_NEAR(_state.h, _alt_sp, 1e-5f); } -TEST_F(TECSClosedLoopTest, SteadyStateCruise_HighSpeedWeight) +TEST_F(TECSClosedLoopTest, SteadyStateCruiseHighSpeedWeight) { initAircraftState(); @@ -286,7 +286,7 @@ TEST_F(TECSClosedLoopTest, SteadyStateCruise_HighSpeedWeight) EXPECT_NEAR(_state.h, _alt_sp, 1e-5f); } -TEST_F(TECSClosedLoopTest, SteadyStateCruise_LowSpeedWeight) +TEST_F(TECSClosedLoopTest, SteadyStateCruiseLowSpeedWeight) { initAircraftState(); @@ -307,7 +307,7 @@ TEST_F(TECSClosedLoopTest, SteadyStateCruise_LowSpeedWeight) // feedforward are identical (spe_weight = ske_weight = 1), so these tests pass // with either the old or new throttle implementation. -TEST_F(TECSClosedLoopTest, AltitudeStepUp_DefaultTuning) +TEST_F(TECSClosedLoopTest, AltitudeStepUpDefaultTuning) { initAircraftState(); initParams(); @@ -322,7 +322,7 @@ TEST_F(TECSClosedLoopTest, AltitudeStepUp_DefaultTuning) EXPECT_NEAR(_state.h, _alt_sp, 0.5f); } -TEST_F(TECSClosedLoopTest, AltitudeStepDown_DefaultTuning) +TEST_F(TECSClosedLoopTest, AltitudeStepDownDefaultTuning) { initAircraftState(); initParams(); @@ -355,7 +355,7 @@ TEST_F(TECSClosedLoopTest, AltitudeStepDown_DefaultTuning) // The EXPECT_LT threshold (1.0 m/s) sits between the two regimes: // fails without the fix (~2-3 m/s), passes with it (~0.3 m/s). -TEST_F(TECSClosedLoopTest, AltitudeStepUp_HighSpeedWeight) +TEST_F(TECSClosedLoopTest, AltitudeStepUpHighSpeedWeight) { initAircraftState(); @@ -372,7 +372,7 @@ TEST_F(TECSClosedLoopTest, AltitudeStepUp_HighSpeedWeight) EXPECT_NEAR(_state.h, _alt_sp, 0.5f); } -TEST_F(TECSClosedLoopTest, AltitudeStepDown_HighSpeedWeight) +TEST_F(TECSClosedLoopTest, AltitudeStepDownHighSpeedWeight) { initAircraftState(); @@ -390,7 +390,7 @@ TEST_F(TECSClosedLoopTest, AltitudeStepDown_HighSpeedWeight) EXPECT_NEAR(_state.h, _alt_sp, 0.5f); } -TEST_F(TECSClosedLoopTest, AltitudeStepUp_LowSpeedWeight) +TEST_F(TECSClosedLoopTest, AltitudeStepUpLowSpeedWeight) { initAircraftState(); @@ -407,7 +407,7 @@ TEST_F(TECSClosedLoopTest, AltitudeStepUp_LowSpeedWeight) EXPECT_NEAR(_state.h, _alt_sp, 0.5f); } -TEST_F(TECSClosedLoopTest, AltitudeStepDown_LowSpeedWeight) +TEST_F(TECSClosedLoopTest, AltitudeStepDownLowSpeedWeight) { initAircraftState(); @@ -427,7 +427,7 @@ TEST_F(TECSClosedLoopTest, AltitudeStepDown_LowSpeedWeight) -TEST_F(TECSClosedLoopTest, AltitudeStepUp_LowAccel) +TEST_F(TECSClosedLoopTest, AltitudeStepUpLowAccel) { initAircraftState(); @@ -445,7 +445,7 @@ TEST_F(TECSClosedLoopTest, AltitudeStepUp_LowAccel) EXPECT_NEAR(_state.h, _alt_sp, 0.5f); } -TEST_F(TECSClosedLoopTest, AltitudeStepDown_LowAccel) +TEST_F(TECSClosedLoopTest, AltitudeStepDownLowAccel) { initAircraftState(); @@ -469,7 +469,7 @@ TEST_F(TECSClosedLoopTest, AltitudeStepDown_LowAccel) // Step the airspeed setpoint while holding altitude. The throttle loop must // accelerate or decelerate the aircraft and then hold the new speed. -TEST_F(TECSClosedLoopTest, AirspeedStepUp_DefaultTuning) +TEST_F(TECSClosedLoopTest, AirspeedStepUpDefaultTuning) { initAircraftState(); @@ -483,7 +483,7 @@ TEST_F(TECSClosedLoopTest, AirspeedStepUp_DefaultTuning) EXPECT_NEAR(_state.h, _alt_sp, 0.5f); } -TEST_F(TECSClosedLoopTest, AirspeedStepDown_DefaultTuning) +TEST_F(TECSClosedLoopTest, AirspeedStepDownDefaultTuning) { initAircraftState();