-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/periph_timer_periodic: spice up test #17388
Conversation
I ran it on |
BTW, this is the first build that was limited by
|
This should detect some bugs regarding incorrect behavior regarding timer_start() not resuming periodic timers as expected.
d84e651
to
1d57cf9
Compare
I changed the wording a bit: |
{ | ||
if (chan == 0 && count[chan] > 0) { | ||
return "OK"; | ||
if (chan == 0) { | ||
if (count[chan] > 0) { | ||
return "OK"; | ||
} | ||
} | ||
|
||
if (chan > 0 && count[chan] == 0) { | ||
else if (count[chan] == 0) { | ||
return "OK"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is btw. cppcheck approved (I locally still run it in my editor - with appropriate include paths). The chan > 0
looked suspiciously like a bound check to cppcheck
and cppecheck
pointed out that chan < MAX_CHANNELS
would also be needed for full bounds checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Thanks for the review! |
Contribution description
The test should detect some bugs regarding incorrect behavior regarding
timer_start()
not resuming periodic timers as expected.Testing procedure
The test should still pass (hopefully) for all non-AVR boards, but fail on AVR due to the bug fixed in #17387
Issues/PRs references
Used to test #17387