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 #1678 Add Functional Tests for cFE Message ID APIs #1736

Conversation

ArielSAdamsNASA
Copy link

Describe the contribution
Fixes #1678
Add functional tests for cFE Message Id APIs
CFE_MSG_GetMsgId - Gets the message id from a message.
CFE_MSG_SetMsgId - Sets the message id bits in a message.
CFE_MSG_GetTypeFromMsgId - Gets message type using message ID.

Testing performed
Tested in functional tests and format check workflows on fork.

Expected behavior changes
Tests functionality for cFE Message Id APIs

Contributor Info - All information REQUIRED for consideration of pull request
Ariel Adams, ASRC Federal

Copy link
Contributor

@skliper skliper left a comment

Choose a reason for hiding this comment

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

Good work! See suggestions.

modules/cfe_testcase/src/message_id_test.c Show resolved Hide resolved
modules/cfe_testcase/src/message_id_test.c Outdated Show resolved Hide resolved
modules/cfe_testcase/src/message_id_test.c Outdated Show resolved Hide resolved
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-1678-functional-test-cfe-message-id branch 6 times, most recently from 2b72fcf to c73d8da Compare August 2, 2021 19:23
@ArielSAdamsNASA ArielSAdamsNASA added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Aug 3, 2021
* the msg to type relationship is also implementation defined, black box test just calls the routine
* to confirm things don't "break" with full range values and the implementation exists.
*/
CFE_MSG_GetTypeFromMsgId(msgid, &msgtype);
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't just be not checked at all. It could be checked that the returns equals either CFE_SUCCESS or CFE_MSG_BAD_ARGUMENT, or could use UtAssert_NOT_NULL.

CFE_MSG_Message_t msg;
CFE_SB_MsgId_t msgid = CFE_SB_ValueToMsgId(1);

UtAssert_INT32_EQ(CFE_MSG_SetMsgId(&msg, msgid), CFE_SUCCESS);
Copy link
Contributor

Choose a reason for hiding this comment

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

You should use GetMsgId to check that the value you set it to is also correct.

@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-1678-functional-test-cfe-message-id branch 5 times, most recently from dd8e730 to abca091 Compare August 3, 2021 19:55
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-1678-functional-test-cfe-message-id branch from abca091 to 73c1565 Compare August 3, 2021 19:57
@astrogeco astrogeco changed the base branch from main to integration-candidate August 4, 2021 22:40
@astrogeco astrogeco merged commit 3011100 into nasa:integration-candidate Aug 4, 2021
@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 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 unit-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add functional tests for cFE Message Id APIs
5 participants