Skip to content

Conversation

@thnkslprpt
Copy link
Contributor

Checklist

Describe the contribution

  • Fixes Inconsistent use of Time1/Time2 TimeA/TimeB parameter names #2341
    • Converts TimeA/TimeB parameter names to Time1/Time2 - making all consistent across cFE (the other option is to reverse this and convert the others to TimeA/TimeB)
      • also converts the enumerated types CFE_TIME_A_GT_B and CFE_TIME_A_LT_B to CFE_TIME_1_GT_2 and CFE_TIME_1_LT_2 to remain consistent
      • some test strings using TimeA/TimeB also updated for consistency

Note: If this PR is merged it will require a minor update to SC which utilises the CFE_TIME_A_GT_B enumerated type here and in a couple of tests.

Testing performed
GitHub CI actions all passing successfully (incl. Build + Run, Coverage/Functional Tests etc.).

Expected behavior changes

Contributor Info
Avi Weiss @thnkslprpt


UT_GenStub_AddParam(CFE_TIME_Compare, CFE_TIME_SysTime_t, TimeA);
UT_GenStub_AddParam(CFE_TIME_Compare, CFE_TIME_SysTime_t, TimeB);
UT_GenStub_AddParam(CFE_TIME_Compare, CFE_TIME_SysTime_t, Time1);

Check warning

Code scanning / CodeQL

Uses of recursion

The function CFE_TIME_Compare is indirectly recursive via this call to [UT_Stub_RegisterContextWithMetaData](1).
UT_GenStub_AddParam(CFE_TIME_Compare, CFE_TIME_SysTime_t, TimeA);
UT_GenStub_AddParam(CFE_TIME_Compare, CFE_TIME_SysTime_t, TimeB);
UT_GenStub_AddParam(CFE_TIME_Compare, CFE_TIME_SysTime_t, Time1);
UT_GenStub_AddParam(CFE_TIME_Compare, CFE_TIME_SysTime_t, Time2);

Check warning

Code scanning / CodeQL

Uses of recursion

The function CFE_TIME_Compare is indirectly recursive via this call to [UT_Stub_RegisterContextWithMetaData](1).
** Compute the amount of time "since" the tone...
*/
if (CFE_TIME_Compare(Reference->CurrentLatch, Reference->AtToneLatch) == CFE_TIME_A_LT_B)
if (CFE_TIME_Compare(Reference->CurrentLatch, Reference->AtToneLatch) == CFE_TIME_1_LT_2)

Check warning

Code scanning / CodeQL

Uses of recursion

The function CFE_TIME_GetReference is indirectly recursive via this call to [CFE_TIME_Compare](1). The function CFE_TIME_GetReference is indirectly recursive via this call to [CFE_TIME_Compare](2).
** Compute the amount of time "since" the tone...
*/
if (CFE_TIME_Compare(Reference->CurrentLatch, Reference->AtToneLatch) == CFE_TIME_A_LT_B)
if (CFE_TIME_Compare(Reference->CurrentLatch, Reference->AtToneLatch) == CFE_TIME_1_LT_2)

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression

This Boolean expression is not side-effect free.
* ----------------------------------------------------
*/
CFE_TIME_Compare_t CFE_TIME_Compare(CFE_TIME_SysTime_t TimeA, CFE_TIME_SysTime_t TimeB)
CFE_TIME_Compare_t CFE_TIME_Compare(CFE_TIME_SysTime_t Time1, CFE_TIME_SysTime_t Time2)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
*
*-----------------------------------------------------------------*/
CFE_TIME_Compare_t CFE_TIME_Compare(CFE_TIME_SysTime_t TimeA, CFE_TIME_SysTime_t TimeB)
CFE_TIME_Compare_t CFE_TIME_Compare(CFE_TIME_SysTime_t Time1, CFE_TIME_SysTime_t Time2)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
@thnkslprpt thnkslprpt force-pushed the fix-2341-make-time1-time2-consistent branch from e7e04bf to 232e463 Compare April 19, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent use of Time1/Time2 TimeA/TimeB parameter names

2 participants