Skip to content
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

Fix #2341, Rename TimeA/TimeB parameter to improve consistency #2342

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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_SetupReturnBuffer(CFE_TIME_Compare, CFE_TIME_Compare_t);

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 Warning

The function CFE_TIME_Compare is indirectly recursive via this call to
UT_Stub_RegisterContextWithMetaData
.
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 Warning

The function CFE_TIME_Compare is indirectly recursive via this call to
UT_Stub_RegisterContextWithMetaData
.
@@ -614,7 +614,7 @@
/*
** 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 Warning

The function CFE_TIME_GetReference is indirectly recursive via this call to
CFE_TIME_Compare
.
The function CFE_TIME_GetReference is indirectly recursive via this call to
CFE_TIME_Compare
.
@@ -614,7 +614,7 @@
/*
** 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 Warning

This Boolean expression is not side-effect free.
@@ -57,12 +57,12 @@
* Generated stub function for CFE_TIME_Compare()
* ----------------------------------------------------
*/
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 Note

All functions of more than 10 lines should have at least one assertion.
@@ -452,50 +452,50 @@
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
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 Note

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