-
Notifications
You must be signed in to change notification settings - Fork 203
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 #2110, Add CFE_ES_StatusToString and CFE_STATUS_C #2113
Conversation
f7785db
to
87bde9e
Compare
void TestStatusToString(void) | ||
{ | ||
/* NULL test */ | ||
UtAssert_ADDRESS_EQ(CFE_ES_StatusToString(CFE_SUCCESS, NULL), NULL); |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
char expected[CFE_STATUS_STRING_LENGTH + 1]; | ||
|
||
/* Used oversized string to test for truncation */ | ||
snprintf(expected, sizeof(expected), "0x%08x", (unsigned int)status); |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
snprintf(expected, sizeof(expected), "0x%08x", (unsigned int)status); | ||
rtn_addr = CFE_ES_StatusToString(status, &status_string); | ||
UtAssert_ADDRESS_EQ(rtn_addr, &status_string); | ||
UtAssert_STRINGBUF_EQ(status_string, sizeof(status_string), expected, sizeof(expected)); |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
void TestStatusToString(void) | ||
{ | ||
/* NULL test */ | ||
UtAssert_ADDRESS_EQ(CFE_ES_StatusToString(CFE_SUCCESS, NULL), NULL); |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
char expected[CFE_STATUS_STRING_LENGTH + 1]; | ||
|
||
/* Used oversized string to test for truncation */ | ||
snprintf(expected, sizeof(expected), "0x%08x", (unsigned int)status); |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
snprintf(expected, sizeof(expected), "0x%08x", (unsigned int)status); | ||
rtn_addr = CFE_ES_StatusToString(status, &status_string); | ||
UtAssert_ADDRESS_EQ(rtn_addr, &status_string); | ||
UtAssert_STRINGBUF_EQ(status_string, sizeof(status_string), expected, sizeof(expected)); |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
87bde9e
to
6c8f494
Compare
/* Used oversized string to test for truncation */ | ||
snprintf(expected, sizeof(expected), "0x%08x", (unsigned int)status); | ||
rtn_addr = CFE_ES_StatusToString(status, &status_string); | ||
UtAssert_ADDRESS_EQ(rtn_addr, status_string); |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
|
||
if (status_string != NULL) | ||
{ | ||
snprintf(*status_string, sizeof(*status_string), "0x%08x", (unsigned int)status); |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
CCB:2022-06-08 APPROVED |
nasa/cFE#2113, Add CFE_ES_StatusToString and CFE_STATUS_C nasa/cFE#2115, Add macro for initializing command header
nasa/cFE#2119, Endian macro mask before shift to avoid shift overflow warning nasa/cFE#2115, Add macro for initializing command header nasa/cFE#2113, Add CFE_ES_StatusToString and CFE_STATUS_C
nasa/cFE#2119, Endian macro mask before shift to avoid shift overflow warning nasa/cFE#2115, Add macro for initializing command header nasa/cFE#2113, Add CFE_ES_StatusToString and CFE_STATUS_C
nasa/cFE#2119, Endian macro mask before shift to avoid shift overflow warning nasa/cFE#2115, Add macro for initializing command header nasa/cFE#2113, Add CFE_ES_StatusToString and CFE_STATUS_C
*Combines:* cFE v7.0.0-rc4+dev143 osal osal v6.0.0-rc4+dev87 psp v1.6.0-rc4+dev ci_lab v2.5.0-rc4+dev22 to_lab v2.5.0-rc4+dev21 sample_app v1.3.0-rc4+dev21 **Includes:** - nasa/cFE#2119, Endian macro mask before shift to avoid shift overflow warning - nasa/cFE#2115, Add macro for initializing command header *Add StatusToString API* - nasa/osal#1259, Add OS_StatusToString API - nasa/PSP#347, Add CFE_PSP_StatusToString and CFE_PSP_STATUS_C - nasa/cFE#2113, Add CFE_ES_StatusToString and CFE_STATUS_C *Remove registration of empty EVS filters* - nasa/ci_lab#111, Remove registration of empty EVS filters - nasa/to_lab#122, Remove registration of empty EVS filters - nasa/sample_app#175, Remove registration of empty event filters
*Combines:* cFE v7.0.0-rc4+dev143 osal osal v6.0.0-rc4+dev87 psp v1.6.0-rc4+dev ci_lab v2.5.0-rc4+dev22 to_lab v2.5.0-rc4+dev21 sample_app v1.3.0-rc4+dev21 **Includes:** - nasa/cFE#2119, Endian macro mask before shift to avoid shift overflow warning - nasa/cFE#2115, Add macro for initializing command header *Add StatusToString API* - nasa/osal#1259, Add OS_StatusToString API - nasa/PSP#347, Add CFE_PSP_StatusToString and CFE_PSP_STATUS_C - nasa/cFE#2113, Add CFE_ES_StatusToString and CFE_STATUS_C *Remove registration of empty EVS filters* - nasa/ci_lab#111, Remove registration of empty EVS filters - nasa/to_lab#122, Remove registration of empty EVS filters - nasa/sample_app#175, Remove registration of empty event filters Co-authored-by: Jacob Hageman <[email protected]>
Checklist (Please check before submitting)
Describe the contribution
Adds CFE_ES_StatusToString and CFE_STATUS_C
Testing performed
CI (coverage tests and app testcase functional)
Expected behavior changes
None, just adds useful APIs for future cleanup
System(s) tested on
CI
Additional context
None
Third party code
None
Contributor Info - All information REQUIRED for consideration of pull request
None