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

Use INFINITE_LOOP macro for loop control in unit test #783

Merged
merged 13 commits into from
Oct 5, 2023

Conversation

chinglee-iot
Copy link
Member

@chinglee-iot chinglee-iot commented Sep 7, 2023

Description

Use the following pattern for loop control in unit test.

for( ; configCONTROL_INFINITE_LOOP(); )
{
    ....
}

In the unit test, the configCONTROL_INFINITE_LOOP can be defined to a mocked function for loop controlling.

#define configCONTROL_INFINITE_LOOP vFakeInfinitLoop

Test Steps

N/A

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

Address #750 comment in line 290.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@chinglee-iot chinglee-iot requested a review from a team as a code owner September 7, 2023 07:04
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (97d48ba) 93.62% compared to head (f7838cc) 93.62%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #783   +/-   ##
=======================================
  Coverage   93.62%   93.62%           
=======================================
  Files           6        6           
  Lines        2508     2508           
  Branches      598      598           
=======================================
  Hits         2348     2348           
  Misses        107      107           
  Partials       53       53           
Flag Coverage Δ
unittests 93.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
tasks.c 94.81% <ø> (ø)
timers.c 98.77% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chinglee-iot
Copy link
Member Author

The uncovered line is because there is no unit test to cover it. This PR doesn't change the logic in the implementation.

ActoryOu
ActoryOu previously approved these changes Sep 12, 2023
queue.c Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Oct 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@chinglee-iot chinglee-iot merged commit d442d79 into FreeRTOS:main Oct 5, 2023
17 checks passed
@chinglee-iot chinglee-iot deleted the update-infinite-loop branch October 5, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants