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 #1690, Tests for time conversion api #1707

Conversation

paulober
Copy link
Contributor

@paulober paulober commented Jul 25, 2021

Describe the contribution

Expected behavior changes

  • No impact on behavior

Additional context
Hi, I'm new to this repository and tried my hand at a "good first issue". I would be very grateful if someone who knows about this repo can have a quick look and tell me if my first commit for this issue works like this. That's why the unit test is commented so much.
Thanks already :)

Contributor Info
Paul Oberosler, Individual

@paulober paulober force-pushed the fix-1690-uts-for-time-conversion-api branch 2 times, most recently from ca08831 to 5263aed Compare July 25, 2021 21:02
@paulober paulober marked this pull request as ready for review July 25, 2021 21:07
@paulober paulober changed the title Fix #1690 uts for time conversion api Fix #1690, uts for time conversion api Jul 25, 2021
@astrogeco astrogeco added CCB:Ready Ready for discussion at the Configuration Control Board (CCB) community Community contribution, YAY! labels Jul 27, 2021
@astrogeco astrogeco requested a review from zanzaben July 27, 2021 23:38
Copy link
Contributor

@astrogeco astrogeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the contribution!

Can you change the c++ style comments // to use /* blocks?

@paulober
Copy link
Contributor Author

Can you change the c++ style comments // to use /* blocks?

Done...

@paulober paulober requested a review from astrogeco July 28, 2021 12:39
@astrogeco
Copy link
Contributor

@PavLL looks like you still have some checks failing, I recommend "enabling actions" in your fork.

modules/cfe_testcase/src/time_conversion_test.c Outdated Show resolved Hide resolved
modules/cfe_testcase/src/time_conversion_test.c Outdated Show resolved Hide resolved
modules/cfe_testcase/src/cfe_test.c Show resolved Hide resolved
modules/cfe_testcase/src/time_conversion_test.c Outdated Show resolved Hide resolved
modules/cfe_testcase/src/time_conversion_test.c Outdated Show resolved Hide resolved
@astrogeco
Copy link
Contributor

CCB:2021-06-27, looking good, revisit after edits are done

@paulober paulober requested a review from zanzaben July 28, 2021 17:37
modules/cfe_testcase/src/time_conversion_test.c Outdated Show resolved Hide resolved
modules/cfe_testcase/src/time_conversion_test.c Outdated Show resolved Hide resolved
@paulober paulober requested a review from zanzaben July 28, 2021 19:29
@astrogeco astrogeco changed the title Fix #1690, uts for time conversion api Fix #1690, Unit Tests for time conversion api Jul 29, 2021
@astrogeco astrogeco changed the title Fix #1690, Unit Tests for time conversion api Fix #1690, Tests for time conversion api Jul 29, 2021
Copy link
Contributor

@zanzaben zanzaben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks all good. Last thing you need to do is squash your commits down to 1 with the message "Fix #1690, Add Time Conversion Functional Test"

@paulober
Copy link
Contributor Author

Ok, I just removed the TimeInRange again from the cfe_test.h header because I replaced it with CFE_Time_Compare in my ut.

@paulober paulober force-pushed the fix-1690-uts-for-time-conversion-api branch 2 times, most recently from 6278928 to 8274e59 Compare July 29, 2021 14:56
@paulober
Copy link
Contributor Author

Ok, done. I squashed the commits.

@paulober paulober requested a review from zanzaben July 29, 2021 14:57
@zanzaben
Copy link
Contributor

You can't use Time Compare there, that only returns -1, 0, or 1 so it passes as true only when the two times are different. You need to use time in range.

@paulober
Copy link
Contributor Author

Ok, I revert this.

@paulober paulober force-pushed the fix-1690-uts-for-time-conversion-api branch from 83d3476 to 0ea4ab8 Compare July 29, 2021 15:11
@paulober
Copy link
Contributor Author

You can't use Time Compare there, that only returns -1, 0, or 1 so it passes as true only when the two times are different. You need to use time in range.

Ok, done. I now use TimeInRange again.

/* write UTC into first buffer */
CFE_TIME_Print(timeBuf1, UTC);

UtAssert_True(TimeInRange(SCTime, UTC, difference), "TAI (%s) = MET2SCTime (%s)", timeBuf1, timeBuf2);
Copy link
Contributor

@zanzaben zanzaben Jul 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be UTC in the printout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fixed. What a stupid mistake.

@paulober paulober force-pushed the fix-1690-uts-for-time-conversion-api branch from 0ea4ab8 to a0a23aa Compare July 29, 2021 15:51
@paulober paulober requested a review from zanzaben July 29, 2021 15:52
@paulober paulober force-pushed the fix-1690-uts-for-time-conversion-api branch from a0a23aa to f4510c4 Compare July 29, 2021 15:55
@paulober paulober force-pushed the fix-1690-uts-for-time-conversion-api branch from f4510c4 to 9e16d16 Compare July 29, 2021 15:58
@astrogeco astrogeco added CCB:Approved Indicates code review and approval by community CCB and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Aug 4, 2021
@astrogeco
Copy link
Contributor

CCB:2021-08-04 APPROVED

@astrogeco astrogeco changed the base branch from main to integration-candidate August 4, 2021 22:42
@astrogeco astrogeco merged commit 47e591a into nasa:integration-candidate Aug 4, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Aug 4, 2021
nasa/cFE#1742, Remove SB get last message sender info requirement

nasa/cFE#1732, Fix #1725 Update UTs to use UtAssert_MIR

nasa/cFE#1736, Add Functional Tests cFE Message ID

nasa/cFE#1707, Add Time Conversion Functional Test
astrogeco added a commit to nasa/cFS that referenced this pull request Aug 6, 2021
**Combines**

nasa/cFE#1759, v6.8.0-rc1+dev810
nasa/osal#1126, v5.1.0-rc1+dev586

**Includes**

*cFE*

- nasa/cFE#1752, Add null pointer check to table GetAddresses and ReleaseAddresses
- nasa/cFE#1742, Remove SB get last message sender info requirement
- nasa/cFE#1732, Fix #1725 Update UTs to use UtAssert_MIR
- nasa/cFE#1736, Add Functional Tests cFE Message ID
- nasa/cFE#1707, Add Time Conversion Functional Test
- nasa/cFE#1739, Add cast to MIR prints

*osal*

- nasa/osal#1122, Add UtAssert_MIR macro
- nasa/osal#1125, add generic asserts from CFE coverage testing
- nasa/osal#1121, add osapi-shell-stubs.c to OSAL stub library

Co-authored-by: Jacob Hageman <skliper@users.noreply.github.com>
Co-authored-by: Joseph Hickey <jphickey@users.noreply.github.com>
Co-authored-by: Alex Campbell <zanzaben@users.noreply.github.com>
Co-authored-by: Jose F Martinez Pedraza <pepepr08@users.noreply.github.com>
Co-authored-by: Niall Mullane <nmullane@users.noreply.github.com>
Co-authored-by: Ariel Adams <ArielSAdamsNASA@users.noreply.github.com>
Co-authored-by: Paul <pavll@users.noreply.github.com>
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB community Community contribution, YAY!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add functional tests for cFE Time Conversion APIs
4 participants