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

Ensure all unit test cases for invalid ID use UNDEFINED plus another value #1052

Closed
jphickey opened this issue May 25, 2021 · 2 comments · Fixed by #1066 or #1079
Closed

Ensure all unit test cases for invalid ID use UNDEFINED plus another value #1052

jphickey opened this issue May 25, 2021 · 2 comments · Fixed by #1066 or #1079
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When checking for proper ID validation, the specific value OS_OBJECT_ID_UNDEFINED must be rejected as it is always invalid. However, the set of values that should be rejected is much larger than this - proper ID validation should only permit a small subset of values to be accepted.

Describe the solution you'd like
In order to confirm that ID values are being validated properly, test cases checking for OS_ERR_INVALID_ID should pass in OS_OBJECT_ID_UNDEFINED as well as some other value, which should be nonzero, but also not in the valid range - to confirm that the implementation is doing the proper validation and not simply checking for equality with OS_OBJECT_ID_UNDEFINED.

Additional context
This came up as part of return/status code validation efforts - test cases are currently inconsistent, some tests are only using OS_OBJECT_ID_UNDEFINED, while some only use UT_OBJID_INCORRECT.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey
Copy link
Contributor Author

jphickey commented Jun 3, 2021

I have created a script which examines the test logs and identifies both overloaded and missing validations in this regard. Rather than submit individual tickets for each subsystem, I will just update this issue with a list of findings for each.

@jphickey
Copy link
Contributor Author

jphickey commented Jun 3, 2021

For BinSem:

OVERLOADED TEST: coveragetest-binsem.c:64 (02.003)
 --> matches OS_BinSemCreate[NULL@0]=>OS_INVALID_POINTER
 --> matches OS_BinSemCreate[NULL@1]=>OS_INVALID_POINTER
RETCODE: OS_BinSemCreate[NULL@0]=>OS_INVALID_POINTER
 --> validated by ut_oscore_binsem_test.c:76 (06.001)
RETCODE: OS_BinSemCreate[NULL@1]=>OS_INVALID_POINTER
 --> validated by ut_oscore_binsem_test.c:79 (06.002)
RETCODE: OS_BinSemDelete[OS_OBJECT_ID_UNDEFINED@0]=>OS_ERR_INVALID_ID
  NOT VALIDATED!!
RETCODE: OS_BinSemDelete[UT_OBJID_INCORRECT@0]=>OS_ERR_INVALID_ID
 --> validated by ut_oscore_binsem_test.c:136 (07.001)
RETCODE: OS_BinSemFlush[OS_OBJECT_ID_UNDEFINED@0]=>OS_ERR_INVALID_ID
  NOT VALIDATED!!
RETCODE: OS_BinSemFlush[UT_OBJID_INCORRECT@0]=>OS_ERR_INVALID_ID
 --> validated by ut_oscore_binsem_test.c:159 (08.001)
RETCODE: OS_BinSemGetIdByName[NULL@1]=>OS_INVALID_POINTER
 --> validated by coveragetest-binsem.c:159 (08.004)
 --> validated by ut_oscore_binsem_test.c:268 (12.002)
RETCODE: OS_BinSemGetInfo[NULL@1]=>OS_INVALID_POINTER
 --> validated by coveragetest-binsem.c:180 (09.004)
 --> validated by ut_oscore_binsem_test.c:306 (13.002)
RETCODE: OS_BinSemGetInfo[OS_OBJECT_ID_UNDEFINED@0]=>OS_ERR_INVALID_ID
  NOT VALIDATED!!
RETCODE: OS_BinSemGetInfo[UT_OBJID_INCORRECT@0]=>OS_ERR_INVALID_ID
 --> validated by ut_oscore_binsem_test.c:301 (13.001)
RETCODE: OS_BinSemGive[OS_OBJECT_ID_UNDEFINED@0]=>OS_ERR_INVALID_ID
  NOT VALIDATED!!
RETCODE: OS_BinSemGive[UT_OBJID_INCORRECT@0]=>OS_ERR_INVALID_ID
 --> validated by ut_oscore_binsem_test.c:183 (09.001)
RETCODE: OS_BinSemTake[OS_OBJECT_ID_UNDEFINED@0]=>OS_ERR_INVALID_ID
  NOT VALIDATED!!
RETCODE: OS_BinSemTake[UT_OBJID_INCORRECT@0]=>OS_ERR_INVALID_ID
 --> validated by ut_oscore_binsem_test.c:208 (10.001)
RETCODE: OS_BinSemTimedWait[OS_OBJECT_ID_UNDEFINED@0]=>OS_ERR_INVALID_ID
  NOT VALIDATED!!
RETCODE: OS_BinSemTimedWait[UT_OBJID_INCORRECT@0]=>OS_ERR_INVALID_ID
 --> validated by ut_oscore_binsem_test.c:232 (11.001)

jphickey added a commit to jphickey/osal that referenced this issue Jun 3, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 3, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 3, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 3, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 3, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 3, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 4, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 8, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
jphickey added a commit to jphickey/osal that referenced this issue Jun 17, 2021
astrogeco added a commit that referenced this issue Jun 20, 2021
Fix #1052, implement missing parameter/retcode test permutations
@skliper skliper added this to the 6.0.0 milestone Sep 24, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
…ceFail

Fix nasa#1052, Refactor UT_ClearForceFail to UT_ClearDefaultReturnValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants