-
Notifications
You must be signed in to change notification settings - Fork 203
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 #503, better events for CFE_TBL_Load() #606
Fix #503, better events for CFE_TBL_Load() #606
Conversation
6867eb9
to
a524e99
Compare
Updated the unit tests, removing "draft" status from pull request. |
|
||
/* Initialize return pointer to NULL */ | ||
WorkingBufferPtr = NULL; | ||
|
||
/* Verify access rights and get a valid Application ID for calling App */ | ||
Status = CFE_TBL_ValidateAccess(TblHandle, &ThisAppId); | ||
|
||
if (Status == CFE_SUCCESS) | ||
if (Status != CFE_SUCCESS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]