Skip to content

Fix nasa#146, When managing the Filter and Dest file tables, the retu…#147

Open
myc-yang wants to merge 1 commit into
nasa:devfrom
myc-yang:146-filter-dest-file-table-getaddress-return-value-check
Open

Fix nasa#146, When managing the Filter and Dest file tables, the retu…#147
myc-yang wants to merge 1 commit into
nasa:devfrom
myc-yang:146-filter-dest-file-table-getaddress-return-value-check

Conversation

@myc-yang
Copy link
Copy Markdown

Checklist (Please check before submitting)

Describe the contribution
When managing the Filter and Dest file tables, the return value of CFE_TBL_GetAddress() after the tables have already been loaded will be checked. Fixes #146

Testing performed
Updated and ran the unit tests DS_TableManageDestFile_Test_TableInfoUpdatePending() and DS_TableManageFilter_Test_TableInfoUpdatePending() in unit-test/ds_table_tests.c

Expected behavior changes

  • If either the dest file and filter tables have already been loaded and there is an update pending but the call to CFE_TBL_GetAddress() fails, an error event message (id = DS_TBL_GET_ADDR_ERR_EID) will be issued.

System(s) tested on

  • Hardware: PC
  • OS: Ubuntu 18.04
  • Versions: [e.g. cFE 6.6, OSAL 4.2, PSP 1.3 for mcp750, any related apps or tools]

Additional context
Add any other context about the contribution here.

Third party code
If included, identify any third party code and provide text file of license

Contributor Info - All information REQUIRED for consideration of pull request
Michael Yang, NASA/GSFC

…rn value of CFE_TBL_GetAddress() after the tables have already been loaded will be checked
Copy link
Copy Markdown
Contributor

@jphickey jphickey left a comment

Choose a reason for hiding this comment

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

First of all -- in this case I agree that the return value of CFE_TBL_GetAddress absolutely needs to be checked.

My concern with this approach is that adding this many if/else branches significantly increases the code complexity of these functions. I didn't run the numbers but I suspect this will trigger other analysis warnings about this.

Can we simplify this code by splitting this into some subroutines or something so that we don't have if/else logic this deep in one function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When managing the Filter and Dest file tables, the return value of CFE_TBL_GetAddress() after the tables have already been loaded is ignored.

3 participants