Skip to content

Commit

Permalink
Merge pull request #2555 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
cFE Integration candidate: Equuleus-rc1+dev13
  • Loading branch information
dzbaker authored Jul 2, 2024
2 parents 505baa1 + 0c7b073 commit 00fe82a
Show file tree
Hide file tree
Showing 67 changed files with 4,165 additions and 2,085 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ jobs:
- name: Confirm Minimum Coverage
run: |
missed_branches=50
missed_lines=17
missed_branches=39
missed_lines=19
branch_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep branches | grep -oP "[0-9]+[0-9]*")
line_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines | grep -oP "[0-9]+[0-9]*")
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## Development Build: equuleus-rc1+dev163
- Improve CFE_SB_AllocateMessageBuffer error report
- Update CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE macro in es_verify.h
- Update comment re. limits of CFE_PLATFORM_SB_HIGHEST_VALID_MSGID
- Use size_t for variables/parameters representing size
- Remove superfluous status assignment in CFE_SB_CreatePipe
- null value in vsnprintf
- Adds JSC 2.1 Static Analysis comments
- Reduces CFE_EVS_MAX_PORT_MSG_LENGTH to prevent new line character truncation
- See <https://github.com/nasa/cFE/pull/2560>, <https://github.com/nasa/cFE/pull/2344>, <https://github.com/nasa/cFE/pull/2359>, <https://github.com/nasa/cFE/pull/2376>, <https://github.com/nasa/cFE/pull/2496>, <https://github.com/nasa/cFE/pull/2554>, <https://github.com/nasa/cFE/pull/2568>, and <https://github.com/nasa/cFE/pull/2566>

## Development Build: equuleus-rc1+dev141
- use resourceids for internal table validation and dump control blocks
- refactor SB to support additional use cases
- msg api test buffer overrun
- See <2551>, <2381>, and <2537>

## Development Build: equuleus-rc1+dev137
- msg api test buffer overrun
- send CMake message to stdout instead of stderr
Expand Down
4 changes: 2 additions & 2 deletions modules/cfe_testcase/src/tbl_content_mang_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ void TblTest_GenerateTblFiles(void)
{
osal_id_t fh1 = OS_OBJECT_ID_UNDEFINED;
osal_id_t fh2 = OS_OBJECT_ID_UNDEFINED;
uint32 PartialOffset;
uint32 PartialSize;
size_t PartialOffset;
size_t PartialSize;
union
{
uint8 u8;
Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define CFE_VERSION_H

/* Development Build Macro Definitions */
#define CFE_BUILD_NUMBER 137 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_NUMBER 163 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_BASELINE "equuleus-rc1" /**< @brief Development: Reference git tag for build number */
#define CFE_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */
#define CFE_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */
Expand Down
6 changes: 3 additions & 3 deletions modules/core_api/ut-stubs/src/cfe_sb_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
typedef struct
{
CFE_SB_MsgId_t MsgId;
uint32 UserLength;
uint32 TotalLength;
size_t UserLength;
size_t TotalLength;
uint16 CommandCode;
CFE_TIME_SysTime_t TimeStamp;
} CFE_SB_StubMsg_MetaData_t;
Expand Down Expand Up @@ -482,7 +482,7 @@ void UT_DefaultHandler_CFE_SB_GetUserData(void *UserObj, UT_EntryKey_t FuncKey,
CFE_MSG_Message_t *MsgPtr = UT_Hook_GetArgValueByName(Context, "MsgPtr", CFE_MSG_Message_t *);
uint8 * BytePtr;
void * Result;
uint16 HdrSize;
size_t HdrSize;

if (UT_Stub_CopyToLocal(UT_KEY(CFE_SB_GetUserData), &Result, sizeof(Result)) != sizeof(Result))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* to items in this file only affect the local module and will be transparent
* to external entities that are using the public interface(s).
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
Expand Down
10 changes: 5 additions & 5 deletions modules/core_private/ut-stubs/inc/ut_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ typedef struct
{
CFE_SB_MsgId_t MsgId;
uint16 SnapshotOffset;
uint16 SnapshotSize;
size_t SnapshotSize;
uint16 Count;
void * SnapshotBuffer;
} UT_SoftwareBusSnapshot_Entry_t;
Expand Down Expand Up @@ -394,7 +394,7 @@ void UT_SetStatusBSPResetArea(int32 status, uint32 Signature, uint32 ClockSignal
** This function does not return a value.
**
******************************************************************************/
void UT_SetReadBuffer(void *Buff, int NumBytes);
void UT_SetReadBuffer(void *Buff, size_t NumBytes);

/*****************************************************************************/
/**
Expand All @@ -414,7 +414,7 @@ void UT_SetReadBuffer(void *Buff, int NumBytes);
** This function does not return a value.
**
******************************************************************************/
void UT_SetReadHeader(void *Hdr, int NumBytes);
void UT_SetReadHeader(void *Hdr, size_t NumBytes);

/*****************************************************************************/
/**
Expand Down Expand Up @@ -454,7 +454,7 @@ void UT_SetDummyFuncRtn(int Return);
** \sa
**
******************************************************************************/
void UT_SetSizeofESResetArea(int32 Size);
void UT_SetSizeofESResetArea(size_t Size);

/*****************************************************************************/
/**
Expand All @@ -472,7 +472,7 @@ void UT_SetSizeofESResetArea(int32 Size);
** This function does not return a value.
**
******************************************************************************/
uint8 *UT_SetCDSSize(int32 Size);
uint8 *UT_SetCDSSize(size_t Size);

/*****************************************************************************/
/**
Expand Down
18 changes: 9 additions & 9 deletions modules/core_private/ut-stubs/src/ut_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ uint8 UT_Endianess;
static char UT_appname[80];
static char UT_subsys[5];
static CFE_ES_AppId_t UT_AppID;
static uint32 UT_LastCDSSize = 0;
static size_t UT_LastCDSSize = 0;

typedef union
{
Expand Down Expand Up @@ -387,15 +387,15 @@ void UT_SetStatusBSPResetArea(int32 status, uint32 Signature, uint32 ClockSignal
/*
** Set the contents of the buffer to read
*/
void UT_SetReadBuffer(void *Buff, int NumBytes)
void UT_SetReadBuffer(void *Buff, size_t NumBytes)
{
UT_SetDataBuffer(UT_KEY(OS_read), Buff, NumBytes, true);
}

/*
** Set the contents of the header to read
*/
void UT_SetReadHeader(void *Hdr, int NumBytes)
void UT_SetReadHeader(void *Hdr, size_t NumBytes)
{
UT_SetDataBuffer(UT_KEY(CFE_FS_ReadHeader), Hdr, NumBytes, true);
}
Expand All @@ -411,7 +411,7 @@ void UT_SetDummyFuncRtn(int Return)
/*
** Set the size of the ES reset area
*/
void UT_SetSizeofESResetArea(int32 Size)
void UT_SetSizeofESResetArea(size_t Size)
{
UT_ResetState(UT_KEY(CFE_PSP_GetResetArea));
if (Size > 0)
Expand All @@ -428,12 +428,12 @@ void UT_SetSizeofESResetArea(int32 Size)
/*
** Set the CDS size returned by the BSP
*/
uint8 *UT_SetCDSSize(int32 Size)
uint8 *UT_SetCDSSize(size_t Size)
{
UT_ResetState(UT_KEY(CFE_PSP_GetCDSSize));
UT_ResetState(UT_KEY(CFE_PSP_ReadFromCDS));
UT_ResetState(UT_KEY(CFE_PSP_WriteToCDS));
if (Size <= 0)
if (Size == 0)
{
UT_LastCDSSize = 0;
return NULL;
Expand Down Expand Up @@ -584,7 +584,7 @@ CFE_ES_ResetData_t *UT_GetResetDataPtr(void)
** But on the upside this concession avoids a far more complicated issue of
** needing a fully-fledged implementation of printf in the OS_printf stub.
*/
static int UT_StrCmpFormatStr(const char *FormatStr, const char *TestStr, uint32 FormatLength, uint32 TestLength)
static int UT_StrCmpFormatStr(const char *FormatStr, const char *TestStr, size_t FormatLength, size_t TestLength)
{
const char *ChunkStart;
const char *ChunkEnd;
Expand Down Expand Up @@ -684,13 +684,13 @@ static int UT_StrCmpFormatStr(const char *FormatStr, const char *TestStr, uint32
* A string comparison function that will match exact strings only
* (Printf style conversion strings are compared literally)
*/
static int UT_StrCmpExact(const char *RefStr, const char *TestStr, uint32 RefLength, uint32 TestLength)
static int UT_StrCmpExact(const char *RefStr, const char *TestStr, size_t RefLength, size_t TestLength)
{
return (RefLength == TestLength && memcmp(RefStr, TestStr, RefLength) == 0);
}

static uint32 UT_GetMessageCount(const char *Msg, UT_Buffer_t *Buf,
int (*Comparator)(const char *, const char *, uint32, uint32))
int (*Comparator)(const char *, const char *, size_t, size_t))
{
uint32 Count = 0;
uint32 MsgLen = strlen(Msg);
Expand Down
2 changes: 1 addition & 1 deletion modules/es/config/default_cfe_es_interface_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* interface, tables definitions, and any other data products that
* serve to exchange information with other entities.
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/es/config/default_cfe_es_internal_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* to items in this file only affect the local module and will be transparent
* to external entities that are using the public interface(s).
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/es/config/default_cfe_es_mission_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* This is a compatibility header for the "mission_cfg.h" file that has
* traditionally provided public config definitions for each CFS app.
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/es/config/default_cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* This is a compatibility header for the "cfe_es_msg.h" file that has
* traditionally provided the message definitions for cFS apps.
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/es/config/default_cfe_es_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* These definitions are now provided in two separate files, one for
* the public/mission scope and one for internal scope.
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void CFE_ES_StartApplications(uint32 ResetType, const char *StartFilePath)
const char *TokenList[CFE_ES_STARTSCRIPT_MAX_TOKENS_PER_LINE];
uint32 NumTokens;
uint32 NumLines;
uint32 BuffLen; /* Length of the current buffer */
size_t BuffLen; /* Length of the current buffer */
osal_id_t AppFile = OS_OBJECT_ID_UNDEFINED;
int32 Status;
int32 OsStatus;
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_start.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typedef struct
char ObjectName[OS_MAX_API_NAME]; /* task or OS object name */
CFE_ES_FuncPtrUnion_t FuncPtrUnion; /* task or function reference */
uint32 ObjectPriority; /* object priority */
uint32 ObjectSize; /* size used for stack, queue size, etc. */
size_t ObjectSize; /* size used for stack, queue size, etc. */
uint32 ObjectFlags; /* extra flags to pass */
} CFE_ES_ObjectTable_t;

Expand Down
12 changes: 6 additions & 6 deletions modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data)
osal_id_t FileDescriptor = OS_OBJECT_ID_UNDEFINED;
uint32 i;
uint32 EntryCount = 0;
uint32 FileSize = 0;
size_t FileSize = 0;
int32 OsStatus;
int32 Result;
CFE_ES_AppInfo_t AppInfo;
Expand Down Expand Up @@ -1093,8 +1093,8 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data)
OS_close(FileDescriptor);
CFE_ES_Global.TaskData.CommandCounter++;
CFE_EVS_SendEvent(CFE_ES_ALL_APPS_EID, CFE_EVS_EventType_DEBUG,
"App Info file written to %s, Entries=%d, FileSize=%d", QueryAllFilename, (int)EntryCount,
(int)FileSize);
"App Info file written to %s, Entries=%d, FileSize=%lu", QueryAllFilename, (int)EntryCount,
(unsigned long)FileSize);
}
else
{
Expand All @@ -1116,7 +1116,7 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data)
osal_id_t FileDescriptor = OS_OBJECT_ID_UNDEFINED;
uint32 i;
uint32 EntryCount = 0;
uint32 FileSize = 0;
size_t FileSize = 0;
int32 OsStatus;
int32 Result;
CFE_ES_TaskInfo_t TaskInfo;
Expand Down Expand Up @@ -1245,8 +1245,8 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data)
OS_close(FileDescriptor);
CFE_ES_Global.TaskData.CommandCounter++;
CFE_EVS_SendEvent(CFE_ES_TASKINFO_EID, CFE_EVS_EventType_DEBUG,
"Task Info file written to %s, Entries=%d, FileSize=%d", QueryAllFilename, (int)EntryCount,
(int)FileSize);
"Task Info file written to %s, Entries=%d, FileSize=%lu", QueryAllFilename, (int)EntryCount,
(unsigned long)FileSize);
}
else
{
Expand Down
19 changes: 14 additions & 5 deletions modules/es/fsw/src/cfe_es_verify.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,21 @@
#endif

/*
** SysLog mode
** Default System Log Mode following Power On Reset
*/
#if CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE < 0
#error CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE cannot be less than 0!
#elif CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE > 1
#error CFE_PLATFORM_ES_DEFAULT_SYSLOG_MODE cannot be greater than 1!
#if CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE < 0
#error CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE cannot be less than 0!
#elif CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE > 1
#error CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE cannot be greater than 1!
#endif

/*
** Default System Log Mode following Processor Reset
*/
#if CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE < 0
#error CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE cannot be less than 0!
#elif CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE > 1
#error CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE cannot be greater than 1!
#endif

/*
Expand Down
12 changes: 6 additions & 6 deletions modules/es/ut-coverage/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void ES_UT_SetupMemPoolId(CFE_ES_MemPoolRecord_t **OutPoolRecPtr)
}
}

void ES_UT_SetupCDSGlobal(uint32 CDS_Size)
void ES_UT_SetupCDSGlobal(size_t CDS_Size)
{
CFE_ES_CDS_Instance_t *CDS = &CFE_ES_Global.CDSVars;

Expand Down Expand Up @@ -1145,7 +1145,7 @@ static void ES_UT_Config_IterateAll(void *UserObj, UT_EntryKey_t FuncKey, const

void TestApps(void)
{
int NumBytes;
size_t NumBytes;
CFE_ES_AppInfo_t AppInfo;
CFE_ES_AppId_t AppId;
CFE_ES_TaskId_t TaskId;
Expand Down Expand Up @@ -3996,7 +3996,7 @@ void TestAPI(void)
osal_id_t TestObjId;
char AppName[OS_MAX_API_NAME + 12];
char SysLogBuf[CFE_TIME_PRINTED_STRING_SIZE + 20];
uint32 SysLogBufSize;
size_t SysLogBufSize;
uint32 StackBuf[8];
uint8 Data[12];
uint32 ResetType;
Expand Down Expand Up @@ -4554,9 +4554,9 @@ void TestAPI(void)
UT_SetHandlerFunction(UT_KEY(CFE_TIME_Print), ES_UT_FillBuffer, &SysLogBufSize);
UtAssert_VOIDCALL(ES_UT_SysLog_snprintf(SysLogBuf, sizeof(SysLogBuf), "b"));

/* Force a vsnprintf failure */
/* Force a vsnprintf to return 0 */
ES_ResetUnitTest();
UtAssert_VOIDCALL(ES_UT_SysLog_snprintf(SysLogBuf, sizeof(SysLogBuf), NULL));
UtAssert_VOIDCALL(ES_UT_SysLog_snprintf(SysLogBuf, sizeof(SysLogBuf), ""));

/* Test run loop with an application error status */
ES_ResetUnitTest();
Expand Down Expand Up @@ -4739,7 +4739,7 @@ void TestCDS()
CFE_ES_CDSHandle_t CDSHandle;
CFE_ES_CDS_RegRec_t *UtCDSRegRecPtr;
uint32 i;
uint32 TempSize;
size_t TempSize;
uint8 BlockData[ES_UT_CDS_BLOCK_SIZE];

UtPrintf("Begin Test CDS");
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/config/default_cfe_evs_interface_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* interface, tables definitions, and any other data products that
* serve to exchange information with other entities.
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/config/default_cfe_evs_internal_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* to items in this file only affect the local module and will be transparent
* to external entities that are using the public interface(s).
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
Expand Down
Loading

0 comments on commit 00fe82a

Please sign in to comment.