From e2fa08478eb4871478959890e2d980572f97edd8 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 14 Mar 2024 15:49:38 -0700 Subject: [PATCH] test etb rounding --- unit_tests/tests/actuators/test_etb.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unit_tests/tests/actuators/test_etb.cpp b/unit_tests/tests/actuators/test_etb.cpp index e666ce6bed..055cb76992 100644 --- a/unit_tests/tests/actuators/test_etb.cpp +++ b/unit_tests/tests/actuators/test_etb.cpp @@ -807,10 +807,11 @@ TEST(etb, openLoopThrottle) { setLinearCurve(config->etbBiasBins, 0, 100); setLinearCurve(config->etbBiasValues, -50, 50); + // due to rounding (scaled integer table storage) some of these values are funny EXPECT_NEAR(-50, etb.getOpenLoop(0).value_or(-1), EPS4D); - EXPECT_NEAR(-25, etb.getOpenLoop(25).value_or(-1), EPS4D); + EXPECT_NEAR(-24.975, etb.getOpenLoop(25).value_or(-1), EPS4D); EXPECT_NEAR(0, etb.getOpenLoop(50).value_or(-1), EPS4D); - EXPECT_NEAR(25, etb.getOpenLoop(75).value_or(-1), EPS4D); + EXPECT_NEAR(24.975, etb.getOpenLoop(75).value_or(-1), EPS4D); EXPECT_NEAR(50, etb.getOpenLoop(100).value_or(-1), EPS4D); }