Skip to content

Commit

Permalink
Merge pull request #50 from thnkslprpt/fix-49-variables-declared-mid-…
Browse files Browse the repository at this point in the history
…function

Fix #49, Move variables declared mid-function to the top
  • Loading branch information
dzbaker authored May 4, 2023
2 parents 17987cc + 6049cf3 commit 40f9480
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 150 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 @@ -1686,12 +1686,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 @@ -1345,12 +1345,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 @@ -1369,12 +1368,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 @@ -1393,12 +1391,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 40f9480

Please sign in to comment.