-
Notifications
You must be signed in to change notification settings - Fork 0
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
[nasa/nos3#176] Unit Tests #2
Conversation
Fix nasa#116, Removed command header from payload struct
Fix nasa#111: Use correct length filename for too large test
Any nonzero value will work
Fix nasa#119, remove dependency on MID_BASE defines
Fix nasa#121, correct casting on printf format strings
Fix nasa#115, Adds distinct identifiers from command name
Fix nasa#125, Adds utassert macro for logging function calls
Fix nasa#95, Replaces conditionally compiled code with runtime conditional logic
… snprintf This commit addresses issues flagged during static analysis by: - Adding JSC 2.1 disposition comments. - Replacing strncpy with snprintf to enhance safety and compliance. - Changes DS_TABLE_VERIFY_ERR from 0xFFFFFFFF to -1
Fix nasa#127, Adds static analysis comments and replace strncpy with snprintf
@@ -1145,7 +1145,7 @@ | |||
CFE_EVS_SendEvent(DS_ADD_MID_CMD_ERR_EID, CFE_EVS_EventType_ERROR, | |||
"Invalid ADD MID command: filter table is not loaded"); | |||
} | |||
else if ((FilterTableIndex = DS_TableFindMsgID(DS_AddMidCmd->MessageID)) != DS_INDEX_NONE) | |||
else if ((FilterTableIndex = DS_TableFindMsgID(PayloadPtr->MessageID)) != DS_INDEX_NONE) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression Warning
@@ -53,15 +53,15 @@ | |||
/* Apply common filter algorithm to Software Bus packet */ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
bool DS_IsPacketFiltered(CFE_MSG_Message_t *MessagePtr, uint16 FilterType, uint16 Algorithm_N, uint16 Algorithm_X, | |||
int32 DS_IsPacketFiltered(CFE_MSG_Message_t *MessagePtr, uint16 FilterType, uint16 Algorithm_N, uint16 Algorithm_X, |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -77,7 +77,7 @@ | |||
|
|||
#include <stdio.h> | |||
|
|||
bool DS_VerifyLength(const CFE_SB_Buffer_t *BufPtr, size_t ExpectedLength, uint16 FailEventID, const char *CommandName) | |||
int32 DS_VerifyLength(const CFE_SB_Buffer_t *BufPtr, size_t ExpectedLength, uint16 FailEventID, const char *CommandName) |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -681,9 +682,9 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
bool DS_TableVerifyParms(uint16 Algorithm_N, uint16 Algorithm_X, uint16 Algorithm_O) | |||
int32 DS_TableVerifyParms(uint16 Algorithm_N, uint16 Algorithm_X, uint16 Algorithm_O) |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -639,10 +640,10 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
bool DS_TableEntryUnused(const void *TableEntry, int32 BufferSize) | |||
int32 DS_TableEntryUnused(const void *TableEntry, int32 BufferSize) |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -562,11 +563,11 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
bool DS_TableVerifyFilterEntry(DS_PacketEntry_t *PacketEntry, int32 TableIndex, int32 ErrorCount) | |||
int32 DS_TableVerifyFilterEntry(DS_PacketEntry_t *PacketEntry, int32 TableIndex, int32 ErrorCount) |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -440,10 +441,10 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
bool DS_TableVerifyDestFileEntry(DS_DestFileEntry_t *DestFileEntry, uint8 TableIndex, int32 ErrorCount) | |||
int32 DS_TableVerifyDestFileEntry(DS_DestFileEntry_t *DestFileEntry, uint8 TableIndex, int32 ErrorCount) |
Check notice
Code scanning / CodeQL
Long function without assertion Note
@@ -53,15 +53,15 @@ | |||
/* Apply common filter algorithm to Software Bus packet */ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
bool DS_IsPacketFiltered(CFE_MSG_Message_t *MessagePtr, uint16 FilterType, uint16 Algorithm_N, uint16 Algorithm_X, | |||
int32 DS_IsPacketFiltered(CFE_MSG_Message_t *MessagePtr, uint16 FilterType, uint16 Algorithm_N, uint16 Algorithm_X, |
Check notice
Code scanning / CodeQL
Function too long Note
@@ -562,11 +563,11 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
bool DS_TableVerifyFilterEntry(DS_PacketEntry_t *PacketEntry, int32 TableIndex, int32 ErrorCount) | |||
int32 DS_TableVerifyFilterEntry(DS_PacketEntry_t *PacketEntry, int32 TableIndex, int32 ErrorCount) |
Check notice
Code scanning / CodeQL
Function too long Note
@@ -440,10 +441,10 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
bool DS_TableVerifyDestFileEntry(DS_DestFileEntry_t *DestFileEntry, uint8 TableIndex, int32 ErrorCount) | |||
int32 DS_TableVerifyDestFileEntry(DS_DestFileEntry_t *DestFileEntry, uint8 TableIndex, int32 ErrorCount) |
Check notice
Code scanning / CodeQL
Function too long Note
No description provided.