From 8e24232c8674837195bddc4e65a65501480e8fd4 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 29 Sep 2021 10:09:15 -0400 Subject: [PATCH] Fix #1982, extended header definitions and test updates Do not double-typedef the CFE_MSG types when using extended headers. This also corrects a call to UT_SetForceFail in the extended header test, which was renamed. --- .../msg/option_inc/default_cfe_msg_hdr_priext.h | 17 +++++++---------- modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/modules/msg/option_inc/default_cfe_msg_hdr_priext.h b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h index 3205aca87..bea3c3f0a 100644 --- a/modules/msg/option_inc/default_cfe_msg_hdr_priext.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h @@ -36,6 +36,7 @@ #include "common_types.h" #include "ccsds_hdr.h" #include "cfe_msg_sechdr.h" +#include "cfe_msg_api_typedefs.h" /* * Type Definitions @@ -60,34 +61,30 @@ typedef struct /** * \brief cFS generic base message */ -typedef union +union CFE_MSG_Message { CCSDS_SpacePacket_t CCSDS; /**< \brief CCSDS Header (Pri or Pri + Ext) */ uint8 Byte[sizeof(CCSDS_SpacePacket_t)]; /**< \brief Byte level access */ -} CFE_MSG_Message_t; +}; /** * \brief cFS command header */ -typedef struct +struct CFE_MSG_CommandHeader { - CFE_MSG_Message_t Msg; /**< \brief Base message */ CFE_MSG_CommandSecondaryHeader_t Sec; /**< \brief Secondary header */ uint8 Spare[4]; /**< /brief Pad to avoid compiler padding if payload requires 64 bit alignment */ - -} CFE_MSG_CommandHeader_t; +}; /** * \brief cFS telemetry header */ -typedef struct +struct CFE_MSG_TelemetryHeader { - CFE_MSG_Message_t Msg; /**< \brief Base message */ CFE_MSG_TelemetrySecondaryHeader_t Sec; /**< \brief Secondary header */ - -} CFE_MSG_TelemetryHeader_t; +}; #endif /* DEFAULT_CFE_MSG_HDR_PRIEXT_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c index 146b34cab..7003bc5c3 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.c @@ -66,7 +66,7 @@ void Test_MSG_Init_Ext(void) is_v1 = !hassec; /* Set up return */ - UT_SetForceFail(UT_KEY(CFE_PSP_GetSpacecraftId), sc_id); + UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_GetSpacecraftId), sc_id); UtPrintf("Set to all F's, msgid value = 0"); memset(&msg, 0xFF, sizeof(msg));