-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Update references to time values to use chrono #14941
Conversation
Ticker test contains definition of variable total_ticks, which is unused in the file since removal of function wait_and_print() in commit aaa15bc
|
||
TEST_ASSERT_UINT32_WITHIN(TOLERANCE_US, MULTI_TICKER_TIME_MS * 1000, time_diff); | ||
TEST_ASSERT_DURATION_WITHIN(TOLERANCE, MULTI_TICKER_TIME, time_diff); |
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.
See previous comment
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.
Could you clarify this comment? As TOLERANCE here is not a function like macro as TOLERANCE_US is above , it's just a constant value of 1000us.
0a701cc
to
d772834
Compare
References to time should do so using std::chrono. We reworked tests in connectivity and drivers to use std::chrono and new APIs in order to remove deprecation warnings resulting from deprecated API calls. This required addition of a macro for test assertions using std::chrono values. As host test "timing_drift_auto" expects time values represented as an integral number of microseconds, we explicitly provide this in place using "microseconds{TICKER_TIME}.count()" in the relevant ticker tests. We recognise this is ugly, but thought it best to descriptively convert from std::chrono to the host test's required representation. Co-authored-by: Hari Limaye <[email protected]>
d772834
to
86c2d70
Compare
Pull request has been modified.
@rwalton-arm thank you for your review, I have addressed all comments and rebased |
Thanks. All looks good to me! |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Reworked connectivity and drivers greentea tests to replace deprecated API calls with new APIs that accept std::chrono values, and updated references to time values in these tests to use std::chrono values.
This PR is picking up from #14453.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Verified that tests touched by this PR build with CLI 1 and CLI 2, and run with success in all cases on target board K66F. In particular, ticker tests now pass which were previously failing in CI following #14453.
Reviewers
@adbridge @kjbracey-arm @ARMmbed/mbed-os-core