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

Fix #1466, Add status return to CFE_ES_WaitForStartupSync() #2273

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thnkslprpt
Copy link
Contributor

@thnkslprpt thnkslprpt commented Mar 30, 2023

Checklist

Describe the contribution

Testing performed
GitHub CI actions all passing successfully.
Local tests confirm all tests passing and LCOV confirms coverage of amended lines, and total coverage unaffected.

These 2 UT calls to CFE_ES_WaitForStartupSync() would have had to be updated, but as far as I can tell they are not actually required for coverage, and are not needed for the test blocks that they are part of (ES_ResetUnitTest() is run immediately after both).

ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "UT", &UtAppRecPtr, NULL);
CFE_ES_Global.SystemState = CFE_ES_SystemState_CORE_READY;
/* Note - CFE_ES_WaitForStartupSync() returns void, nothing to check for
* here. This is for code coverage
*/
UtAssert_VOIDCALL(CFE_ES_WaitForStartupSync(99));
/* Test waiting for apps to initialize as an external app
*/
ES_ResetUnitTest();
ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_EARLY_INIT, "UT", &UtAppRecPtr, NULL);
CFE_ES_Global.SystemState = CFE_ES_SystemState_CORE_READY;
/* Note - CFE_ES_WaitForStartupSync() returns void, nothing to check for
* here. This is for code coverage
*/
UtAssert_VOIDCALL(CFE_ES_WaitForStartupSync(99));
/* Test successfully adding a time-stamped message to the system log that
* causes the log index to be reset
*/
ES_ResetUnitTest();

Coverage is already provided by the prior call to CFE_ES_WaitForStartupSync():

CFE_ES_WaitForStartupSync(0);

CFE_ES_WaitForSystemState() is already fully covered elsewhere.

Expected behavior changes
CFE_ES_WaitForStartupSync() now carries through the status/return of CFE_ES_WaitForSystemState() allowing additional handling by the user.

System(s) tested on
Intel(R) Celeron(R) N4100 CPU @ 1.10GHz x86_64
Debian GNU/Linux 11 (bullseye)
Current main branch of cFS.

Contributor Info
Avi Weiss @thnkslprpt

@github-advanced-security
Copy link

You have successfully added a new CodeQL configuration coding-standard. As part of the setup process, we have scanned this repository and found 1905 existing alerts. Please check the repository Security tab to see all alerts.

@github-advanced-security
Copy link

You have successfully added a new CodeQL configuration security. As part of the setup process, we have scanned this repository and found 29 existing alerts. Please check the repository Security tab to see all alerts.

@dzbaker dzbaker requested a review from jphickey June 8, 2023 18:29
Copy link
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

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

Looks good

@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Ready Ready for discussion at the Configuration Control Board (CCB)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add status output to CFE_ES_WaitForStartupSync
2 participants