Fix #503, better events for CFE_TBL_Load()#606
Fix #503, better events for CFE_TBL_Load()#606astrogeco merged 1 commit intonasa:integration-candidatefrom
Conversation
6867eb9 to
a524e99
Compare
|
Updated the unit tests, removing "draft" status from pull request. |
| Status = CFE_TBL_ValidateAccess(TblHandle, &ThisAppId); | ||
|
|
||
| if (Status == CFE_SUCCESS) | ||
| if (Status != CFE_SUCCESS) |
There was a problem hiding this comment.
This routine mixes use of status and returns throughout that make's it hard to follow. Could it be refactored to clarify flow? Consider doing all the checks first to decide what work to do (or error to return), then do the work?
There was a problem hiding this comment.
There's quite a lot of conditional logic (whether loading the table from a file or memory block, whether the load is partial, etc) so can't do a lot "up-front". I've refactored to do fail=>event+return to reduce deeply-nested if struct of original code. Unsure if it could be further refactored without changing/removing behavior.
a524e99 to
2940ece
Compare
2cca257 to
72dcd3a
Compare
|
CCB 20200422 - Approve and open a new ticket to refactor and reduce complexity. There's lots of return statements and we probably don't want to add more. |
|
#600 is the table load refactor, I'll hijack and include the complexity reduction effort |
|
This is breaking the integration-candidate build for me, it is using "ThisAppId" variable uninitialized: |
Describe the contribution
Addresses #503 but this is a draft, still need UT code updates. Simplified changes for CFE_TBL_Load() to make the code a bit easier to follow (hey, events generated when results are off-nominal, instead of at the end?)
Partially addresses #607
Testing performed
Initial build/run, UT not updated yet.
Expected behavior changes
Internal CFE_TBL_LoadFromFile() API changed slightly to add AppName as a parameter. Return value from LoadFromFile() no longer relevant for event generation.
System(s) tested on
Debian 9
Contributor Info - All information REQUIRED for consideration of pull request
[email protected]