fix: Engine-Grenzen für Segmente und Blink-Anzahl
This commit is contained in:
@@ -171,6 +171,18 @@ static void test_pulse(void)
|
||||
TEST_ASSERT_TRUE(nl_engine_idle());
|
||||
}
|
||||
|
||||
static void test_blink_max_clamped(void)
|
||||
{
|
||||
nl_engine_blink(200); /* > NL_BLINK_MAX, should clamp to 100 */
|
||||
TEST_ASSERT_FALSE(nl_engine_idle());
|
||||
/* After 99 blinks (99*2 phases = 198), should still be blinking */
|
||||
nl_engine_tick(300 * 99 * 2);
|
||||
TEST_ASSERT_FALSE(nl_engine_idle());
|
||||
/* After 2 more phases to complete the last blink (total 100 blinks), should be idle */
|
||||
nl_engine_tick(300 * 2);
|
||||
TEST_ASSERT_TRUE(nl_engine_idle());
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
@@ -184,5 +196,6 @@ int main(void)
|
||||
RUN_TEST(test_color_interpolates);
|
||||
RUN_TEST(test_blink_overrides_and_restores);
|
||||
RUN_TEST(test_pulse);
|
||||
RUN_TEST(test_blink_max_clamped);
|
||||
return UNITY_END();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user