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

Hard coded time print format checks fail when non-default epoch is used #1659

Closed
skliper opened this issue Jul 12, 2021 · 0 comments · Fixed by #1711 or #1701
Closed

Hard coded time print format checks fail when non-default epoch is used #1659

skliper opened this issue Jul 12, 2021 · 0 comments · Fixed by #1711 or #1701
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Jul 12, 2021

Is your feature request related to a problem? Please describe.
Epoch is configurable:

#define CFE_MISSION_TIME_EPOCH_YEAR 1980
#define CFE_MISSION_TIME_EPOCH_DAY 1
#define CFE_MISSION_TIME_EPOCH_HOUR 0
#define CFE_MISSION_TIME_EPOCH_MINUTE 0
#define CFE_MISSION_TIME_EPOCH_SECOND 0

Time unit tests hard-code checks that are impacted by epoch configuration, and fail when it's changed (example):

const char * expectedMET = "2013-001-02:03:14.56789";
const char * expectedTAI = "2013-001-03:03:14.56789";
const char * expectedUTC = "2013-001-03:02:42.56789";
const char * expectedSTCF = "1980-001-01:00:00.00000";
volatile CFE_TIME_ReferenceState_t *RefState;
UtPrintf("Begin Test Get Time");
CFE_TIME_Global.LastVersionCounter = 0x1000;
/* Test successfully retrieving the mission elapsed time */
UT_InitData();
UT_SetBSP_Time(seconds, microsecs);
RefState = CFE_TIME_StartReferenceUpdate();
RefState->AtToneMET.Seconds = 20; /* 20.00000 */
RefState->AtToneMET.Subseconds = 0;
RefState->AtToneSTCF.Seconds = 3600; /* 01:00:00.00000 */
RefState->AtToneSTCF.Subseconds = 0;
RefState->AtToneLeapSeconds = 32;
RefState->AtToneDelay.Seconds = 0; /* 0.00000 */
RefState->AtToneDelay.Subseconds = 0;
RefState->AtToneLatch.Seconds = 10; /* 10.00000 */
RefState->AtToneLatch.Subseconds = 0;
RefState->ClockSetState = CFE_TIME_SetState_NOT_SET; /* Force invalid time */
CFE_TIME_FinishReferenceUpdate(RefState);
CFE_TIME_Print(timeBuf, CFE_TIME_GetMET());
CFE_UtAssert_STRINGBUF_EQ(timeBuf, sizeof(timeBuf), expectedMET, strlen(expectedMET));

Describe the solution you'd like
Update tests to work with configured epoch. Either adjust for configured epoch or test the actual values (not print time).

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC, @excaliburtb

@skliper skliper added this to the 7.0.0 milestone Jul 12, 2021
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jul 26, 2021
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jul 26, 2021
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jul 26, 2021
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jul 26, 2021
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jul 26, 2021
pepepr08 added a commit to pepepr08/cFE that referenced this issue Jul 26, 2021
astrogeco added a commit that referenced this issue Jul 27, 2021
Fix #1659, Add custom epoch support to TIME UT
paulober pushed a commit to paulober/cFE that referenced this issue Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants