Fix #2110, Add CFE_ES_StatusToString and CFE_STATUS_C#2113
Fix #2110, Add CFE_ES_StatusToString and CFE_STATUS_C#2113
Conversation
f7785db to
87bde9e
Compare
modules/es/ut-coverage/es_UT.c
Outdated
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
| * Functional CFE_ES_StatusToString test | ||
| *--------------------------------------------------------------------------------*/ | ||
| void TestStatusToString(void) | ||
| { |
Check warning
Code scanning / CodeQL-coding-standard
Unchecked return value
| { | ||
| /* NULL test */ | ||
| UtAssert_ADDRESS_EQ(CFE_ES_StatusToString(CFE_SUCCESS, NULL), NULL); | ||
|
|
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