Skip to content

Commit a7654a2

Browse files
committed
Fix #2478, Add missing deafult/break to switch statements
1 parent ed1faf4 commit a7654a2

File tree

23 files changed

+60
-32
lines changed

23 files changed

+60
-32
lines changed

.github/workflows/code-coverage.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ jobs:
104104
105105
- name: Confirm Minimum Coverage
106106
run: |
107-
missed_branches=50
108-
missed_lines=17
107+
missed_branches=47
108+
missed_lines=36
109109
branch_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep branches | grep -oP "[0-9]+[0-9]*")
110110
line_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep lines | grep -oP "[0-9]+[0-9]*")
111111

.github/workflows/codeql-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
codeql:
1313
uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main
14-
with:
14+
with:
1515
component-path: cfe
1616
make: make -j8
1717
test: true

.github/workflows/icbundle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
done
6060
changelog_entry="${changelog_entry}\n${see_entry}\n"
6161
sed -ir "s|# Changelog|$changelog_entry|" CHANGELOG.md
62-
62+
6363
buildnumber_entry=$'#define CFE_BUILD_NUMBER '${rev_num}$' /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */'
6464
sed -ir "s|#define CFE_BUILD_NUMBER.*|$buildnumber_entry|" modules/core_api/fsw/inc/cfe_version.h
6565
- name: Commit and Push Updates to IC Branch

docs/cFS_IdentifierNamingConvention.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ Common command/event descriptions include:
247247
| `LEN_ERR` | Incorrect Message Length | Error |
248248
| `CC_ERR` | Invalid Command Code Received | Error |
249249
| `NOOP_INF` | No-op Command Success | Informational |
250-
| `INIT_INF` | Applicaiton Initialization Success | Informational |
250+
| `INIT_INF` | Application Initialization Success | Informational |
251251
| `RESET_INF` | Reset Command Counters Command Success | Informational |
252252

253253
# Appendix: Abbreviation Guide

modules/cfe_assert/src/cfe_assert_runner.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ bool CFE_Assert_Status_DeferredCheck(CFE_Status_t Status, UtAssert_CaseType_t Ca
138138
}
139139
else
140140
{
141-
/* if condition was false add an exta marker so user does not necessarily need to decode the string */
141+
/* if condition was false add an extra marker so user does not necessarily need to decode the string */
142142
ExtraTag = " [false]";
143143
}
144144

modules/cfe_testcase/src/cfe_test.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void CFE_TestMain(void)
5858
* Register test cases in UtAssert
5959
*/
6060
ESApplicationControlTestSetup();
61-
ESBehaviorestSetup();
61+
ESBehaviorTestSetup();
6262
ESCDSTestSetup();
6363
ESCounterTestSetup();
6464
ESErrorTestSetup();

modules/cfe_testcase/src/cfe_test.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void TimeInRange(CFE_TIME_SysTime_t Start, CFE_TIME_SysTime_t Time, CFE_TIME_Sys
7272

7373
void CFE_TestMain(void);
7474
void ESApplicationControlTestSetup(void);
75-
void ESBehaviorestSetup(void);
75+
void ESBehaviorTestSetup(void);
7676
void ESCDSTestSetup(void);
7777
void ESCounterTestSetup(void);
7878
void ESErrorTestSetup(void);

modules/cfe_testcase/src/es_behavior_test.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void TestWaitBehavior(void)
8282
UtAssert_UINT32_EQ(CFE_TIME_Compare(TimePassed, TimeExpected), CFE_TIME_A_LT_B);
8383
}
8484

85-
void ESBehaviorestSetup(void)
85+
void ESBehaviorTestSetup(void)
8686
{
8787
UtTest_Add(TestRunCounter, NULL, NULL, "Test Run Counter");
8888
UtTest_Add(TestWaitBehavior, NULL, NULL, "Test Wait Behavior");

modules/cfe_testcase/src/sb_pipe_mang_test.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void TestPipeCreateMax(void)
7474
* Normally, this will return CFE_SUCCESS, until the max number of pipes is reached.
7575
* Confirm that the last creation attempt returned CFE_SB_MAX_PIPES_MET
7676
*
77-
* NOTE: this also mimics the same format as UtAssert_INT32_EQ so that any post-procesing
77+
* NOTE: this also mimics the same format as UtAssert_INT32_EQ so that any post-processing
7878
* test log analysis tools will see this call as well.
7979
*/
8080
if (CFE_Assert_STATUS_MAY_BE(CFE_SB_MAX_PIPES_MET))

modules/cfe_testcase/tables/cfe_test_tbl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
/*
3232
* The test table data should contain some identifiable numeric values,
33-
* so any issues with paritial loading/byteswapping are morely likely
33+
* so any issues with partial loading/byteswapping are more likely
3434
* to be detected.
3535
*/
3636
CFE_TEST_TestTable_t TestTable = {0xf007, 0xba11};

modules/core_api/config/default_cfe_core_api_interface_cfg.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@
129129
*/
130130
#define CFE_MISSION_MAX_NUM_FILES 50
131131

132-
#endif /* SAMPLE_MISSION_CFG_H */
132+
#endif /* CFE_CORE_API_INTERFACE_CFG_H */

modules/core_private/ut-stubs/inc/ut_support.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ extern const char *UT_OSP_MESSAGES[];
9696
*/
9797
#define UT_LITTLE_ENDIAN 1
9898
#define UT_BIG_ENDIAN 2
99-
extern uint8 UT_Endianess;
99+
extern uint8 UT_Endianness;
100100

101101
typedef struct
102102
{

modules/core_private/ut-stubs/src/ut_support.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
/*
3939
** Global variables
4040
*/
41-
uint8 UT_Endianess;
41+
uint8 UT_Endianness;
4242

4343
static char UT_appname[80];
4444
static char UT_subsys[5];
@@ -110,11 +110,11 @@ void UT_Init(const char *subsys)
110110

111111
if ((*(char *)&EndianCheck) == 0x04)
112112
{
113-
UT_Endianess = UT_LITTLE_ENDIAN;
113+
UT_Endianness = UT_LITTLE_ENDIAN;
114114
}
115115
else
116116
{
117-
UT_Endianess = UT_BIG_ENDIAN;
117+
UT_Endianness = UT_BIG_ENDIAN;
118118
}
119119
}
120120

modules/es/fsw/src/cfe_es_erlog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ bool CFE_ES_RunExceptionScan(uint32 ElapsedTime, void *Arg)
295295
if (PspStatus != CFE_PSP_SUCCESS)
296296
{
297297
/* reason string is not available - populate with something for the PspStatus*/
298-
snprintf(ReasonString, sizeof(ReasonString), "Unknown - CFE_PSP_ExceptionGetSummary() error %ld",
298+
snprintf(ReasonString, sizeof(ReasonString), "Unknown - CFE_PSP_Exception_GetSummary() error %ld",
299299
(long)PspStatus);
300300
PspContextId = 0;
301301
ExceptionTaskID = OS_OBJECT_ID_UNDEFINED;

modules/es/ut-coverage/es_UT.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4237,7 +4237,7 @@ void TestAPI(void)
42374237
AppId = CFE_ES_AppRecordGetID(UtAppRecPtr);
42384238
CFE_UtAssert_SUCCESS(CFE_ES_GetAppName(AppName, AppId, sizeof(AppName)));
42394239

4240-
/* Bad arguement calls */
4240+
/* Bad argument calls */
42414241
UtAssert_INT32_EQ(CFE_ES_GetAppName(NULL, AppId, sizeof(AppName)), CFE_ES_BAD_ARGUMENT);
42424242
UtAssert_INT32_EQ(CFE_ES_GetAppName(AppName, AppId, 0), CFE_ES_BAD_ARGUMENT);
42434243

modules/evs/ut-coverage/evs_UT.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void UT_InitData_EVS(void)
160160
UT_SetHandlerFunction(UT_KEY(CFE_MSG_GetMsgTime), UT_CFE_MSG_GetMsgTime_CustomHandler, NULL);
161161
}
162162

163-
/* Message init hook to stora last MsgId passed in */
163+
/* Message init hook to store last MsgId passed in */
164164
static int32 UT_EVS_MSGInitHook(void *UserObj, int32 StubRetcode, uint32 CallCount, const UT_StubContext_t *Context)
165165
{
166166
UT_EVS_MSGInitData_t *msgdataptr = UserObj;

modules/fs/config/default_cfe_fs_filedef.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,4 @@ typedef struct CFE_FS_Header
195195
char Description[CFE_FS_HDR_DESC_MAX_LEN]; /**< \brief File description */
196196
} CFE_FS_Header_t;
197197

198-
#endif /* CFE_FS_EXTERN_TYPEDEFS_H */
198+
#endif /* CFE_FS_FILEHDR_H */

modules/msg/fsw/src/cfe_msg_ccsdspri.c

+2
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ CFE_Status_t CFE_MSG_GetSegmentationFlag(const CFE_MSG_Message_t *MsgPtr, CFE_MS
262262
case CFE_MSG_SEGFLG_UNSEG:
263263
default:
264264
*SegFlag = CFE_MSG_SegFlag_Unsegmented;
265+
break;
265266
}
266267

267268
return CFE_SUCCESS;
@@ -300,6 +301,7 @@ CFE_Status_t CFE_MSG_SetSegmentationFlag(CFE_MSG_Message_t *MsgPtr, CFE_MSG_Segm
300301
case CFE_MSG_SegFlag_Invalid:
301302
default:
302303
status = CFE_MSG_BAD_ARGUMENT;
304+
break;
303305
}
304306

305307
if (status == CFE_SUCCESS)

modules/sb/fsw/src/cfe_sb_api.c

+22-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ CFE_Status_t CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const c
245245
CFE_SB_GetAppTskName(TskId, FullName), (unsigned long)PipeIdPtr, (int)Depth,
246246
OS_QUEUE_MAX_DEPTH);
247247
break;
248-
249248
case CFE_SB_MAX_PIPES_MET_EID:
250249
CFE_EVS_SendEventWithAppID(CFE_SB_MAX_PIPES_MET_EID, CFE_EVS_EventType_ERROR, CFE_SB_Global.AppId,
251250
"CreatePipeErr:Max Pipes(%d)In Use.app %s", CFE_PLATFORM_SB_MAX_PIPES,
@@ -266,6 +265,8 @@ CFE_Status_t CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const c
266265
"CreatePipeErr:OS_QueueCreate returned %ld,app %s", (long)OsStatus,
267266
CFE_SB_GetAppTskName(TskId, FullName));
268267
break;
268+
default:
269+
break;
269270
}
270271
}
271272

@@ -469,6 +470,8 @@ int32 CFE_SB_DeletePipeFull(CFE_SB_PipeId_t PipeId, CFE_ES_AppId_t AppId)
469470
"Pipe Delete Error:Caller(%s) is not the owner of pipe %ld", FullName,
470471
CFE_RESOURCEID_TO_ULONG(PipeId));
471472
break;
473+
default:
474+
break;
472475
}
473476
}
474477

@@ -556,6 +559,8 @@ CFE_Status_t CFE_SB_SetPipeOpts(CFE_SB_PipeId_t PipeId, uint8 Opts)
556559
"Pipe Opts Set Error: Caller(%s) is not the owner of pipe %lu",
557560
CFE_SB_GetAppTskName(TskId, FullName), CFE_RESOURCEID_TO_ULONG(PipeId));
558561
break;
562+
default:
563+
break;
559564
}
560565
}
561566

@@ -631,6 +636,8 @@ CFE_Status_t CFE_SB_GetPipeOpts(CFE_SB_PipeId_t PipeId, uint8 *OptsPtr)
631636
"Pipe Opts Error:Bad Argument,PipedId %lu,Requestor %s",
632637
CFE_RESOURCEID_TO_ULONG(PipeId), CFE_SB_GetAppTskName(TskId, FullName));
633638
break;
639+
default:
640+
break;
634641
}
635642
}
636643

@@ -719,6 +726,8 @@ CFE_Status_t CFE_SB_GetPipeName(char *PipeNameBuf, size_t PipeNameSize, CFE_SB_P
719726
"Pipe Id Error:Bad Argument,Id=%lu,Requestor %s",
720727
CFE_RESOURCEID_TO_ULONG(PipeId), CFE_SB_GetAppTskName(TskId, FullName));
721728
break;
729+
default:
730+
break;
722731
}
723732

724733
if (PipeNameBuf != NULL && PipeNameSize > 0)
@@ -828,6 +837,8 @@ CFE_Status_t CFE_SB_GetPipeIdByName(CFE_SB_PipeId_t *PipeIdPtr, const char *Pipe
828837
CFE_SB_Global.AppId, "Pipe ID By Name Error:Bad Argument,Requestor %s",
829838
CFE_SB_GetAppTskName(TskId, FullName));
830839
break;
840+
default:
841+
break;
831842
}
832843
}
833844

@@ -1023,6 +1034,8 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, CFE_SB_
10231034
case CFE_SB_DUP_SUBSCRIP_EID:
10241035
CFE_SB_Global.HKTlmMsg.Payload.DuplicateSubscriptionsCounter++;
10251036
break;
1037+
default:
1038+
break;
10261039
}
10271040

10281041
CFE_SB_UnlockSharedData(__func__, __LINE__);
@@ -1081,6 +1094,8 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, CFE_SB_
10811094
(unsigned int)CFE_SB_MsgIdToValue(MsgId), CFE_RESOURCEID_TO_ULONG(PipeId),
10821095
CFE_SB_GetAppTskName(TskId, FullName), Scope);
10831096
break;
1097+
default:
1098+
break;
10841099
}
10851100
}
10861101
else if (Status == CFE_SUCCESS)
@@ -1268,6 +1283,8 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId, uint8
12681283
(unsigned int)CFE_SB_MsgIdToValue(MsgId), CFE_RESOURCEID_TO_ULONG(PipeId),
12691284
CFE_SB_GetAppTskName(TskId, FullName), (int)Scope);
12701285
break;
1286+
default:
1287+
break;
12711288
}
12721289
}
12731290
else if (Status == CFE_SUCCESS)
@@ -1513,6 +1530,8 @@ int32 CFE_SB_TransmitMsgValidate(const CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t
15131530
CFE_SB_FinishSendEvent(TskId, CFE_SB_SEND_NO_SUBS_EID_BIT);
15141531
}
15151532
break;
1533+
default:
1534+
break;
15161535
}
15171536
}
15181537

@@ -1983,6 +2002,8 @@ CFE_Status_t CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t Pipe
19832002
"Rcv Err:PipeId %lu does not exist,app %s", CFE_RESOURCEID_TO_ULONG(PipeId),
19842003
CFE_SB_GetAppTskName(TskId, FullName));
19852004
break;
2005+
default:
2006+
break;
19862007
}
19872008
}
19882009

modules/sb/fsw/src/cfe_sb_task.c

+4
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ int32 CFE_SB_EnableRouteCmd(const CFE_SB_EnableRouteCmd_t *data)
442442
CFE_EVS_SendEvent(CFE_SB_ENBL_RTE2_EID, CFE_EVS_EventType_DEBUG, "Enabling Route,Msg 0x%x,Pipe %lu",
443443
(unsigned int)CFE_SB_MsgIdToValue(MsgId), CFE_RESOURCEID_TO_ULONG(CmdPtr->Pipe));
444444
break;
445+
default:
446+
break;
445447
}
446448

447449
return CFE_SUCCESS;
@@ -509,6 +511,8 @@ int32 CFE_SB_DisableRouteCmd(const CFE_SB_DisableRouteCmd_t *data)
509511
CFE_EVS_SendEvent(CFE_SB_DSBL_RTE2_EID, CFE_EVS_EventType_DEBUG, "Route Disabled,Msg 0x%x,Pipe %lu",
510512
(unsigned int)CFE_SB_MsgIdToValue(MsgId), CFE_RESOURCEID_TO_ULONG(CmdPtr->Pipe));
511513
break;
514+
default:
515+
break;
512516
}
513517

514518
return CFE_SUCCESS;

modules/sb/ut-coverage/sb_UT.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ void Test_SB_EarlyInit_NoErrors(void)
16141614
CFE_SB_EarlyInit();
16151615
CFE_UtAssert_SUCCESS(CFE_SB_EarlyInit());
16161616

1617-
/* Confirm reset of values to cover reset requirements that are challenging operationaly */
1617+
/* Confirm reset of values to cover reset requirements that are challenging operationally */
16181618
UtAssert_ZERO(CFE_SB_Global.HKTlmMsg.Payload.CommandErrorCounter);
16191619
UtAssert_ZERO(CFE_SB_Global.HKTlmMsg.Payload.NoSubscribersCounter);
16201620
UtAssert_ZERO(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter);
@@ -3647,7 +3647,7 @@ static void SB_UT_PipeIdModifyHandler(void *UserObj, UT_EntryKey_t FuncKey, cons
36473647
PipeDscPtr->PipeId = CFE_SB_INVALID_PIPE;
36483648
}
36493649

3650-
/* Special handler to hit OS_QueueGet error casses */
3650+
/* Special handler to hit OS_QueueGet error cases */
36513651
static void SB_UT_QueueGetHandler(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
36523652
{
36533653
size_t **data = (size_t **)UT_Hook_GetArgValueByName(Context, "data", void *);
@@ -4238,14 +4238,14 @@ void Test_SB_SpecialCases(void)
42384238
}
42394239

42404240
/*
4241-
* Test the use count rollover prevetion
4241+
* Test the use count rollover prevention
42424242
*/
42434243
void Test_UseCount_Rollover_Prevention(void)
42444244
{
42454245
CFE_SB_BufferD_t bd;
42464246
uint16 usecount_expected = 0x7FFF;
42474247

4248-
/* Note this is just for coverage, limit can not be reached in nomal ops (would be a bug) */
4248+
/* Note this is just for coverage, limit can not be reached in normal ops (would be a bug) */
42494249
bd.UseCount = usecount_expected;
42504250
UtAssert_VOIDCALL(CFE_SB_IncrBufUseCnt(&bd));
42514251
UtAssert_UINT32_EQ(bd.UseCount, usecount_expected);

modules/tbl/fsw/src/cfe_tbl_api.c

+1
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ CFE_Status_t CFE_TBL_Load(CFE_TBL_Handle_t TblHandle, CFE_TBL_SrcEnum_t SrcType,
504504
"%s: Attempted to load from illegal source type=%d", AppName, (int)SrcType);
505505

506506
Status = CFE_TBL_ERR_ILLEGAL_SRC_TYPE;
507+
break;
507508
}
508509

509510
/* If the data was successfully loaded, then validate its contents */

0 commit comments

Comments
 (0)