nasa / cFE

The Core Flight System (cFS) Core Flight Executive (cFE)
Apache License 2.0
413 stars 203 forks source link

SB line coverage for collision reporting in CFE_SB_SubscribeFull requires alternate config #1916

Open skliper opened 3 years ago

skliper commented 3 years ago

Is your feature request related to a problem? Please describe. Default config doesn't use the hash implementation, so there's no way to get collisions:

    1129         [ -  + ]:        451 :     if (Collisions != 0)
    1130                 :            :     {
    1131                 :          0 :         CFE_EVS_SendEventWithAppID(CFE_SB_HASHCOLLISION_EID, CFE_EVS_EventType_DEBUG, CFE_SB_Global.AppId,
    1132                 :            :                                    "Msg hash collision: MsgId = 0x%x, collisions = %u",
    1133                 :          0 :                                    (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)Collisions);
    1134                 :            :     }

here: https://github.com/nasa/cFE/blob/5e41330979586bcdb113f491ea6c38ff9975fc72/modules/sb/fsw/src/cfe_sb_api.c#L1129-L1134

Describe the solution you'd like

1462

Describe alternatives you've considered None.

Additional context None

Requester Info Jacob Hageman - NASA/GSFC

avan989 commented 1 year ago

Code Coverage is not possible. "Collisions" is always set to 0. To set collision the following path is taken:

  1. Initialize Collisions = 0 -> CFE_SBR_AddRoute (Not A Stub) -> CFE_SBR_SetRouteId (in cfe_sbr_map_direct.c)

CFE_SBR_SetRouteId is how "collisions" is set but it will always return 0.