Skip to content
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

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

maribu
Copy link
Member

@maribu maribu commented Dec 13, 2021

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

@maribu maribu requested a review from benpicco December 13, 2021 12:59
@maribu maribu added Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 13, 2021
@fjmolinas
Copy link
Contributor

I ran it on arduino-uno arduino-zero atmega256rfr2-xpro b-l072z-lrwan1 frdm-k64f frdm-kw41z hifive1b i-nucleo-lrwan1 nrf52dk nucleo-f030r8 nucleo-f091rc nucleo-f103rb nucleo-f207zg nucleo-f303k8 nucleo-f303re nucleo-f334r8 nucleo-f767zi nucleo-g071rb nucleo-g474re nucleo-l073rz nucleo-l152re nucleo-l433rc nucleo-l452re nucleo-l496zg nucleo-l4r5zi nucleo-l552ze-q nucleo-wl55jc openmote-b p-nucleo-wb55 samr21-xpro slstk3402a z1, all good but the AVR ones see here

@kaspar030
Copy link
Contributor

BTW, this is the first build that was limited by can_fast_ci_run.py. Worked fine.
Here's the output (cut from https://ci.riot-os.org/RIOT-OS/RIOT/17388/d84e6515fb189e9c9af61880037f47e40d4e8ac0/output.html):

--- static tests: passed
-- running on worker mobi6.inet.haw-hamburg.de-21 thread 1, build number 103295.
--- can_fast_ci_run:
{
  "apps": [
    "tests/periph_timer_periodic"
  ],
  "boards": []
}
BOARDS_CHANGED=""
APPS_CHANGED="tests/periph_timer_periodic"

This should detect some bugs regarding incorrect behavior regarding
timer_start() not resuming periodic timers as expected.
@maribu maribu force-pushed the tests/periph_timer_periodic branch from d84e651 to 1d57cf9 Compare December 13, 2021 16:12
@maribu
Copy link
Member Author

maribu commented Dec 13, 2021

I changed the wording a bit: s/repetition/iteration/g since the first run is not a repetition.

Comment on lines 82 to 90
{
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";
}
Copy link
Member Author

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.

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@maribu maribu merged commit 13df2a6 into RIOT-OS:master Dec 15, 2021
@maribu
Copy link
Member Author

maribu commented Dec 15, 2021

Thanks for the review!

@maribu maribu deleted the tests/periph_timer_periodic branch December 15, 2021 11:55
@fjmolinas fjmolinas added this to the Release 2022.01 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants