-
Notifications
You must be signed in to change notification settings - Fork 217
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 #982, Add test for object id inline functions #990
Fix #982, Add test for object id inline functions #990
Conversation
286dc92
to
dbd78d3
Compare
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.
Some comments noted inline.
I would also suggest just doing one record of each type. "maxing it out" by calling OS_ObjectIdAllocateNew until it fails seems like overdoing it. These inline functions are just simple ops and generally have no conditionals, there isn't a real benefit to testing it with every possible value.
I prefer maxing out for the comparison test. Would catch any strange rollover bugs, or bug in creating the unique IDs. This isn't a huge number, so seems reasonable for the additional "black box" coverage to ensure uniqueness. |
That's done by the existing test cases for If the objective of these tests should be to check the inline functions, just a few choice values should be enough (I'd consider adding |
dbd78d3
to
cf3b645
Compare
I still don't see any harm to confirm all the ID's across all the types are never equal except to themselves. It adds very little complexity to the test. The test for equality after the conversion from/to index across all IDs that can be allocated also shows the conversion doesn't change anything or cause loss of info. Why skip when there's such little "cost"? Plus it's already implemented... so is it really worth backing out a more thorough test? I don't really care that it may be caught by some other test somewhere based on how it's implemented, that other test doesn't also exercise the conversions so I'd rather keep the full range i here. Also avoids dependencies on other tests (say the other test changes, could make a reduced test here now miss something else). |
CCB:2021-05-12 CHANGES REQUESTED
|
@zanzaben do we want to change this to draft since there more work to do? |
41281d0
to
9191298
Compare
All requested changes have been made. |
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.
Getting better, but still a few more concerns.
recordscount++; | ||
} | ||
|
||
} while (actual == OS_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.
The other thing I'd like to see as part of this loop is a check that recordscount
does not exceed OS_MAX_TOTAL_RECORDS
. It shouldn't when things are working right.... but should confirm that.
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.
fixed
9191298
to
3ec2c2e
Compare
I merged this into my branch and ran it, looks OK .... BUT - I still think we should reconsider testing all the values. In my test this produced 79243 test cases, which all get written to the log file. Yes, it runs pretty fast on Linux where the console is local. But the log file ends up being almost 6MB in size. If running this on VxWorks on a 9600 baud serial connection, this will likely take 1-2 hours to print all those messages to the console. IMO no test should produce more than 1000 cases (there are 3 digits allocated in the template). Even that is a little excessive. Can we just limit it to 5 IDs of each type? |
Alternatively - if we can switch the "does not equal" test (noted in my previous comment) to only assert if it fails. In other words, something like
|
f4e02e2
to
b9be5b0
Compare
This cuts the number of logged test cases from nearly 80k to about 580.
b9be5b0
to
b18dcc6
Compare
nasa/cFE#1482, Resolve sequence count auto-increment rollover bug nasa/osal#985, rename hooks to handlers nasa/osal#1000, propagate status code in OS_rmdir nasa/osal#1001, rework "unit-tests" to use macros nasa/osal#1003, remove extra newlines in utassert logs nasa/osal#990, Add test for object id inline functions nasa/osal#998, fixed invalid inputs for OS_mkdir nasa/osal#812, Improves config guide documentation
Combines: nasa/cFE#1508, cFE v6.8.0-rc1+dev580 nasa/osal#1006, osal v5.1.0-rc1+dev452 Includes: nasa/cFE#1482, Resolve sequence count auto-increment rollover bug nasa/cFE#1491, Correctly format code block section terminator nasa/cFE#1530, Fix typos in developer guide nasa/osal#985, rename hooks to handlers nasa/osal#1000, propagate status code in OS_rmdir nasa/osal#1001, rework "unit-tests" to use macros nasa/osal#1003, remove extra newlines in utassert logs nasa/osal#990, Add test for object id inline functions nasa/osal#998, fixed invalid inputs for OS_mkdir nasa/osal#812, Improves config guide documentation nasa/osal#987, Show CodeQL Preview
Combines: nasa/cFE#1508, cFE v6.8.0-rc1+dev580 nasa/osal#1006, osal v5.1.0-rc1+dev452 Includes: nasa/cFE#1482, Resolve sequence count auto-increment rollover bug nasa/cFE#1491, Correctly format code block section terminator nasa/cFE#1530, Fix typos in developer guide nasa/osal#985, rename hooks to handlers nasa/osal#1000, propagate status code in OS_rmdir nasa/osal#1001, rework "unit-tests" to use macros nasa/osal#1003, remove extra newlines in utassert logs nasa/osal#990, Add test for object id inline functions nasa/osal#998, fixed invalid inputs for OS_mkdir nasa/osal#812, Improves config guide documentation nasa/osal#987, Show CodeQL Preview Co-Authored-By: Jake Hageman <skliper@users.noreply.github.com> Co-Authored-By: Joseph Hickey <joseph.p.hickey@nasa.gov> Co-Authored-By: Ariel Adams <ArielSAdamsNASA@users.noreply.github.com> Co-Authored-By: Alex Campbell <zanzaben@users.noreply.github.com> Co-Authored-By: Tobias Nießen <tniessen@users.noreply.github.com> Co-Authored-By: Jonathan Bohren <jbohren-hbr@users.noreply.github.com> Co-Authored-By: Andrei Tumbar <Kronos3@users.noreply.github.com>
Fix nasa#988, add casts on printf calls
Describe the contribution
Fixes #982
Adds test for inline object id functions
Testing performed
Build and run unit test
Expected behavior changes
No impact to behavior
System(s) tested on
Ubuntu 20.04
Contributor Info - All information REQUIRED for consideration of pull request
Alex Campbell GSFC