You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe. CFE_TBL_Update function contains two hard to reach lines (953-954) that remains untested, preventing us from reaching 100% line coverage. It's actually just one uncovered line, but lcov thinks it's two.
: 919: /* Verify access rights and get a valid Application ID for calling App */
6: 920: Status = CFE_TBL_ValidateAccess(TblHandle, &ThisAppId);
: 921:
6: 922: if (Status == CFE_SUCCESS)
: 923: {
: 924: /* Get pointers to pertinent records in registry and handles */
4: 925: AccessDescPtr = &CFE_TBL_Global.Handles[TblHandle];
4: 926: RegRecPtr = &CFE_TBL_Global.Registry[AccessDescPtr->RegIndex];
: 927:
4: 928: Status = CFE_TBL_UpdateInternal(TblHandle, RegRecPtr, AccessDescPtr);
: 929:
4: 930: if (Status != CFE_SUCCESS)
: 931: {
2: 932: CFE_ES_WriteToSysLog("%s: App(%lu) fail to update Tbl '%s' (Stat=0x%08X)\n", __func__,
2: 933: CFE_RESOURCEID_TO_ULONG(ThisAppId), RegRecPtr->Name, (unsigned int)Status);
: 934: }
: 935: }
: 936: else
: 937: {
2: 938: CFE_ES_WriteToSysLog("%s: App(%lu) does not have access to Tbl Handle=%d\n", __func__,
: 939: CFE_RESOURCEID_TO_ULONG(ThisAppId), (int)TblHandle);
: 940: }
: 941:
6: 942: if (Status != CFE_TBL_ERR_BAD_APP_ID)
: 943: {
: 944: /* Translate AppID of caller into App Name */
6: 945: CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName));
: 946: }
: 947:
: 948: /* On Error conditions, notify ground of screw up */
6: 949: if (Status < 0)
: 950: {
2: 951: if (RegRecPtr != NULL)
: 952: {
## 0: 953: CFE_EVS_SendEventWithAppID(CFE_TBL_UPDATE_ERR_EID, CFE_EVS_EventType_ERROR, CFE_TBL_Global.TableTaskAppId,
## 0: 954: "%s Failed to Update '%s', Status=0x%08X", AppName, RegRecPtr->Name,
: 955: (unsigned int)Status);
: 956: }
: 957: else
: 958: {
2: 959: CFE_EVS_SendEventWithAppID(CFE_TBL_UPDATE_ERR_EID, CFE_EVS_EventType_ERROR, CFE_TBL_Global.TableTaskAppId,
: 960: "%s Failed to Update '?', Status=0x%08X", AppName, (unsigned int)Status);
: 961: }
: 962: }
Describe the solution you'd like
These lines should be safe to leave uncovered because they do not contain any potential to access a NULL pointer or anything else similarly dangerous.
Additional context
Line 953 is currently impossible to reach because CFE_TBL_UpdateInternal does not throw any error status codes (< 0), so the only way to trigger the if statement on line 949 is from CFE_TBL_ValidateAccess on line 920 which would always mean RegRecPtr is NULL. Thus the if statement on line 951 can never be true, leaving line 953 uncovered.
Requester Info
Niall Mullane - GSFC 582 Intern
The text was updated successfully, but these errors were encountered:
skliper
changed the title
Missing coverage in cfe_tbl_api.c function CFE_TBL_Update
TBL missing coverage in cfe_tbl_api.c function CFE_TBL_Update
Aug 26, 2021
CFE_TBL_UpdateInternal (Not a stub) also updates "Status" but only with the following possible value:
a. CFE_SUCCESS 0
b. CFE_TBL_INFO_NO_UPDATE_PENDING 0x4c000017
c. CFE_TBL_INFO_TABLE_LOCKED 0x4c000018
There is no way to have both Status < 0 and RegRecPtr != NULL without changing the implementation. Code Coverage is not possible.
Is your feature request related to a problem? Please describe.
CFE_TBL_Update
function contains two hard to reach lines (953-954) that remains untested, preventing us from reaching 100% line coverage. It's actually just one uncovered line, but lcov thinks it's two.Describe the solution you'd like
These lines should be safe to leave uncovered because they do not contain any potential to access a NULL pointer or anything else similarly dangerous.
Additional context
Line 953 is currently impossible to reach because
CFE_TBL_UpdateInternal
does not throw any error status codes (< 0), so the only way to trigger the if statement on line 949 is fromCFE_TBL_ValidateAccess
on line 920 which would always meanRegRecPtr
is NULL. Thus the if statement on line 951 can never be true, leaving line 953 uncovered.Requester Info
Niall Mullane - GSFC 582 Intern
The text was updated successfully, but these errors were encountered: