diff --git a/test/test_math/test_low_pass_filter.cpp b/test/test_math/test_low_pass_filter.cpp index 9af77de842..1a97e72400 100644 --- a/test/test_math/test_low_pass_filter.cpp +++ b/test/test_math/test_low_pass_filter.cpp @@ -4,34 +4,34 @@ static void test_U16_min(void) { // Passing zero for the filter value should return the input value - TEST_ASSERT_EQUAL_UINT16(0, LOW_PASS_FILTER(0U, 0U, 0U)); - TEST_ASSERT_EQUAL_UINT16(1234U, LOW_PASS_FILTER(1234U, 0U, 0U)); - TEST_ASSERT_EQUAL_UINT16(1234U, LOW_PASS_FILTER(1234U, 0U, 9999U)); + TEST_ASSERT_EQUAL_UINT16(0, LOW_PASS_FILTER((uint16_t)0, UINT8_C(0), (uint16_t)0)); + TEST_ASSERT_EQUAL_UINT16(1234U, LOW_PASS_FILTER((uint16_t)1234, UINT8_C(0), (uint16_t)0)); + TEST_ASSERT_EQUAL_UINT16(1234U, LOW_PASS_FILTER((uint16_t)1234, UINT8_C(0), (uint16_t)9999)); } static void test_U16_max(void) { // Passing UINT8_MAX for the filter value should make the input close to the previous value - TEST_ASSERT_EQUAL_UINT16(0, LOW_PASS_FILTER(0U, UINT8_MAX, 0U)); - TEST_ASSERT_EQUAL_UINT16(4U, LOW_PASS_FILTER(1234U, UINT8_MAX, 0U)); - TEST_ASSERT_EQUAL_UINT16(9964U, LOW_PASS_FILTER(1234U, UINT8_MAX, 9999U)); + TEST_ASSERT_EQUAL_UINT16(0, LOW_PASS_FILTER((uint16_t)0, UINT8_MAX, (uint16_t)0)); + TEST_ASSERT_EQUAL_UINT16(4U, LOW_PASS_FILTER((uint16_t)1234, UINT8_MAX, (uint16_t)0)); + TEST_ASSERT_EQUAL_UINT16(9964U, LOW_PASS_FILTER((uint16_t)1234, UINT8_MAX, (uint16_t)9999)); } static void test_S16_min(void) { // Passing zero for the filter value should return the input value - TEST_ASSERT_EQUAL_INT16(0, LOW_PASS_FILTER(0, 0U, 0)); - TEST_ASSERT_EQUAL_INT16(1234, LOW_PASS_FILTER(1234, 0U, 0)); - TEST_ASSERT_EQUAL_INT16(-1234, LOW_PASS_FILTER(-1234, 0U, 0)); - TEST_ASSERT_EQUAL_INT16(1234, LOW_PASS_FILTER(1234, 0U, 9999)); - TEST_ASSERT_EQUAL_INT16(-1234, LOW_PASS_FILTER(-1234, 0U, 9999)); + TEST_ASSERT_EQUAL_INT16(0, LOW_PASS_FILTER((int16_t)0, UINT8_C(0), (int16_t)0)); + TEST_ASSERT_EQUAL_INT16(1234, LOW_PASS_FILTER((int16_t)1234, UINT8_C(0), (int16_t)0)); + TEST_ASSERT_EQUAL_INT16(-1234, LOW_PASS_FILTER((int16_t)-1234, UINT8_C(0), (int16_t)0)); + TEST_ASSERT_EQUAL_INT16(1234, LOW_PASS_FILTER((int16_t)1234, UINT8_C(0), (int16_t)9999)); + TEST_ASSERT_EQUAL_INT16(-1234, LOW_PASS_FILTER((int16_t)-1234, UINT8_C(0), (int16_t)9999)); } static void test_S16_max(void) { // Passing UINT8_MAX for the filter value should make the input close to the previous value - TEST_ASSERT_EQUAL_INT16(0, LOW_PASS_FILTER(0, UINT8_MAX, 0)); - TEST_ASSERT_EQUAL_INT16(4, LOW_PASS_FILTER(1234, UINT8_MAX, 0)); - TEST_ASSERT_EQUAL_INT16(-4, LOW_PASS_FILTER(-1234, UINT8_MAX, 0)); - TEST_ASSERT_EQUAL_INT16(9964, LOW_PASS_FILTER(1234, UINT8_MAX, 9999)); - TEST_ASSERT_EQUAL_INT16(-9964, LOW_PASS_FILTER(-1234, UINT8_MAX, -9999)); + TEST_ASSERT_EQUAL_INT16(0, LOW_PASS_FILTER((int16_t)0, UINT8_MAX, (int16_t)0)); + TEST_ASSERT_EQUAL_INT16(4, LOW_PASS_FILTER((int16_t)1234, UINT8_MAX, (int16_t)0)); + TEST_ASSERT_EQUAL_INT16(-4, LOW_PASS_FILTER((int16_t)-1234, UINT8_MAX, (int16_t)0)); + TEST_ASSERT_EQUAL_INT16(9964, LOW_PASS_FILTER((int16_t)1234, UINT8_MAX, (int16_t)9999)); + TEST_ASSERT_EQUAL_INT16(-9964, LOW_PASS_FILTER((int16_t)-1234, UINT8_MAX, (int16_t)-9999)); } void test_LOW_PASS_FILTER(void) { diff --git a/test/test_schedule_calcs/test_ign_calcs.cpp b/test/test_schedule_calcs/test_ign_calcs.cpp index 9b7579f440..15715b3d9b 100644 --- a/test/test_schedule_calcs/test_ign_calcs.cpp +++ b/test/test_schedule_calcs/test_ign_calcs.cpp @@ -33,8 +33,6 @@ struct ign_test_parameters int16_t expectedEndAngle; // Expected end angle }; -static void nullIgnCallback(void) { } - void test_calc_ign_timeout(const ign_test_parameters &test_params) { char msg[150];