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

Replace CFE_SB_ValueToMsgId(0) with CFE_SB_INVALID_MSG_ID #2039

Closed
skliper opened this issue Jan 27, 2022 · 0 comments · Fixed by #2042 or #2043
Closed

Replace CFE_SB_ValueToMsgId(0) with CFE_SB_INVALID_MSG_ID #2039

skliper opened this issue Jan 27, 2022 · 0 comments · Fixed by #2042 or #2043
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Jan 27, 2022

Is your feature request related to a problem? Please describe.
Using zero explicitly isn't great, for the most part all cases should be replace with just using the invalid macro:

cfe/modules/cfe_testcase/src/msg_api_test.c:    UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT);
cfe/modules/cfe_testcase/src/msg_api_test.c:    msgId = CFE_SB_ValueToMsgId(0);
cfe/modules/cfe_testcase/src/message_id_test.c:    CFE_SB_MsgId_t msgid = CFE_SB_ValueToMsgId(0);
cfe/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c:    CFE_UtAssert_SUCCESS(CFE_MSG_SetMsgId(&msg, CFE_SB_ValueToMsgId(0)));
cfe/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.c:    CFE_SB_MsgId_t    msgid  = CFE_SB_ValueToMsgId(0);
cfe/modules/msg/ut-coverage/test_cfe_msg_init.c:    UtAssert_INT32_EQ(CFE_MSG_Init(NULL, CFE_SB_ValueToMsgId(0), sizeof(cmd)), CFE_MSG_BAD_ARGUMENT);
cfe/modules/msg/ut-coverage/test_cfe_msg_init.c:    UtAssert_INT32_EQ(CFE_MSG_Init(CFE_MSG_PTR(cmd), CFE_SB_ValueToMsgId(0), 0), CFE_MSG_BAD_ARGUMENT);
cfe/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c:    UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0);
cfe/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c:    UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0))));
cfe/modules/sbr/ut-coverage/test_cfe_sbr_map_hash.c:    msgid[0]   = CFE_SB_ValueToMsgId(0);
cfe/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c:    UtAssert_INT32_EQ(CFE_SBR_SetRouteId(CFE_SB_ValueToMsgId(0), CFE_SBR_ValueToRouteId(0)), 0);
cfe/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c:    UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_GetRouteId(CFE_SB_ValueToMsgId(0))));
cfe/modules/sbr/ut-coverage/test_cfe_sbr_map_direct.c:    msgid   = CFE_SB_ValueToMsgId(0);
cfe/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c:    UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), NULL)));
cfe/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c:    UtAssert_BOOL_FALSE(CFE_SBR_IsValidRouteId(CFE_SBR_AddRoute(CFE_SB_ValueToMsgId(0), &collisions)));
cfe/modules/sbr/ut-coverage/test_cfe_sbr_route_unsorted.c:    msgid[0] = CFE_SB_ValueToMsgId(0);
cfe/modules/tbl/fsw/src/cfe_tbl_task.c:    CFE_MSG_Init(CFE_MSG_PTR(CFE_TBL_Global.NotifyMsg.CommandHeader), CFE_SB_ValueToMsgId(0),

Describe the solution you'd like
Replace with CFE_SB_INVALID_MSG_ID

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant