Commit Graph

8 Commits (c39448fa97c2bc397341fbd12a0a5fd815e6f1c1)

Author SHA1 Message Date
Filip Jagodzinski d1b66665df Tests: SleepManager: Fix sleep_auto test
Use us & lp tickers directly, without the common ticker layer.
2018-10-19 11:46:55 +01:00
Filip Jagodzinski b385dc2648 Tests: SleepManager: Update test_check() test
Increase delta to 500 us. This value is still short enough to detect
incorrect behavior of the sleep_manager_can_deep_sleep_test_check() fun,
but allows the targets with low LP timer accuracy to pass, i.e.
NUCLEO_F429ZI.
2018-10-19 11:46:55 +01:00
Filip Jagodzinski aa09d7bd57 Tests: SleepManager: Fix test suite setup
Use ticker init functions from upper HAL layer to allow proper handling
of ticker overflows.
2018-10-19 11:46:55 +01:00
Filip Jagodzinski a55ee97c2a Tests: SleepManager: Add test for new check() fun
sleep_manager_can_deep_sleep_test_check() is intended to be used in test
code.
2018-10-19 11:46:55 +01:00
Filip Jagodzinski 67638a039d Tests: SleepManager: extend test suite
New test cases:
* "deep sleep lock/unlock"
* "deep sleep unbalanced unlock"
* "deep sleep locked USHRT_MAX times"
* "deep sleep locked more than USHRT_MAX times"
* "sleep_auto calls sleep/deep sleep based on lock"
2018-10-19 11:46:55 +01:00
Russ Butler 472ababfef Update deep sleep lock check in tests
When the define LPTICKER_DELAY_TICKS is set deep sleep can be randomly
disallowed when using the low power ticker. This is because a Timer
object, which locks deep sleep, is used to protect from back-to-back
writes to lp tickers which can't support that. This causes tests which
assert that deep sleep is allowed to intermittently fail.

To fix this intermittent failure this patch adds the function
sleep_manager_can_deep_sleep_test_check() which checks if deep sleep
is allowed over a duration. It updates all the tests to use
sleep_manager_can_deep_sleep_test_check() rather
than sleep_manager_can_deep_sleep() so the tests work even if deep
sleep is spuriously blocked.
2018-08-17 09:29:41 -05:00
Martin Kojtal e52bb68f93 tests: astyle fix
All tests should comply to our coding standard now
2018-08-03 10:23:38 +01:00
Martin Kojtal c5a41d83c2 test: add sleep manager tests
This commits contains two tests:
- race condition
- deep sleep locking/unlocking
2017-09-07 15:35:07 +01:00