Skip to content

Commit

Permalink
Fix #49, Move variables declared mid-function to the top
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Apr 7, 2023
1 parent 4926ebd commit 7331b44
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 152 deletions.
3 changes: 2 additions & 1 deletion unit-test/lc_action_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1685,12 +1685,13 @@ void LC_ValidateRPN_Test_StackDepthZero2(void)

void LC_ValidateRPN_Test_MaxRPNSize(void)
{
int i;
uint8 Result;

int32 IndexValue = 0;
int32 StackDepthValue = 0;

for (int i = 0; i < LC_MAX_RPN_EQU_SIZE; i++)
for (i = 0; i < LC_MAX_RPN_EQU_SIZE; i++)
{
LC_OperData.ADTPtr[0].RPNEquation[i] = LC_MAX_WATCHPOINTS - 1;
}
Expand Down
15 changes: 6 additions & 9 deletions unit-test/lc_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,12 +1343,11 @@ void LC_CreateTaskCDS_Test_Nominal(void)
void LC_CreateTaskCDS_Test_WRTRegisterCDSError(void)
{
int32 Result;

UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterCDS), 1, -1);

int32 strCmpResult;
char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];

UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterCDS), 1, -1);

snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Error registering WRT CDS Area, RC=0x%%08X");

Result = LC_CreateTaskCDS();
Expand All @@ -1367,12 +1366,11 @@ void LC_CreateTaskCDS_Test_WRTRegisterCDSError(void)
void LC_CreateTaskCDS_Test_ARTRegisterCDSError(void)
{
int32 Result;

UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterCDS), 2, -1);

int32 strCmpResult;
char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];

UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterCDS), 2, -1);

snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Error registering ART CDS Area, RC=0x%%08X");

Result = LC_CreateTaskCDS();
Expand All @@ -1391,12 +1389,11 @@ void LC_CreateTaskCDS_Test_ARTRegisterCDSError(void)
void LC_CreateTaskCDS_Test_AppDataRegisterCDSError(void)
{
int32 Result;

UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterCDS), 3, -1);

int32 strCmpResult;
char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];

UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterCDS), 3, -1);

snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
"Error registering application data CDS Area, RC=0x%%08X");

Expand Down
Loading

0 comments on commit 7331b44

Please sign in to comment.