-
Notifications
You must be signed in to change notification settings - Fork 202
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 #2316 - CFE_TIME_Print() calls strftime() #2390
base: main
Are you sure you want to change the base?
Conversation
UT_GenStub_AddParam(CFE_TIME_Print, char *, PrintBuffer); | ||
UT_GenStub_AddParam(CFE_TIME_Print, CFE_TIME_SysTime_t, TimeToPrint); | ||
|
||
UT_GenStub_Execute(CFE_TIME_Print, Basic, UT_DefaultHandler_CFE_TIME_Print); | ||
|
||
return UT_GenStub_GetReturnValue(CFE_TIME_Print, CFE_Status_t); |
Check warning
Code scanning / CodeQL
Uses of recursion
{ | ||
UT_GenStub_SetupReturnBuffer(CFE_TIME_Print, CFE_Status_t); |
Check warning
Code scanning / CodeQL
Uses of recursion
@@ -305,12 +305,16 @@ | |||
* Generated stub function for CFE_TIME_Print() | |||
* ---------------------------------------------------- | |||
*/ | |||
void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) | |||
CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) |
Check notice
Code scanning / CodeQL
Long function without assertion
@@ -563,150 +565,30 @@ | |||
* See description in header file for argument/return detail | |||
* | |||
*-----------------------------------------------------------------*/ | |||
void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) | |||
CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) |
Check notice
Code scanning / CodeQL
Long function without assertion
Checklist (Please check before submitting)
Describe the contribution
CFE_TIME_Print() calls strftime to format times and returns a status code rather than creating a syslog entry. Note that this may be expanded to allow this to be configurable or parameterized (although EVS may just call strftime directly.)
Re-introduced from #2356. #2388, #2389 reverted this PR.
Also collapsed epoch defines to SECONDS and MICROS for more performance and simpler configuration.
Testing performed
Standard build and UT tests updated.
Expected behavior changes
Function returns CFE_Status_t status.
NOTE strftime uses time_t which may be 32- or 64-bit and may be signed or unsigned, depending on the platform.
System(s) tested on
Ubuntu 22.04LTS
Additional context
https://en.wikipedia.org/w/index.php?title=Time_t&oldid=450752800
Third party code
None.
Contributor Info - All information REQUIRED for consideration of pull request
Christopher.D.Knight@nasa.gov