test(tecs): fix CI warnings

- correct rounding with lround
 - no underscores in test names
This commit is contained in:
Balduin
2026-04-23 17:14:29 +02:00
parent 1e5569ec83
commit 2000f8794d
+14 -14
View File
@@ -234,7 +234,7 @@ protected:
float run(float duration)
{
float peak_v_err = 0.f;
const int steps = static_cast<int>(duration / DT + 0.5f);
const int steps = static_cast<int>(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();