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

file api unit test uses osal_id_t as integer #929

Closed
jphickey opened this issue Mar 25, 2021 · 0 comments · Fixed by #930 or #927
Closed

file api unit test uses osal_id_t as integer #929

jphickey opened this issue Mar 25, 2021 · 0 comments · Fixed by #930 or #927
Assignees
Labels
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
The type osal_id_t should not be used as an integer, and normal integer operations or comparisons should not be used with this type. However it looks like a couple cases in file API test were recently added which are comparing this to a uint32 type directly.

To Reproduce
Build OSAL with a type-safe osal_id_t, fails to build in file_api_test.c

Expected behavior
Build should succeed.

Code snips
Comparisons to uint32:

UtAssert_UINT32_EQ(fd, OS_OBJECT_ID_UNDEFINED);

UtAssert_UINT32_EQ(fd, OS_OBJECT_ID_UNDEFINED);

System observed on:
Ubuntu 20.04

Additional context
Should use !OS_ObjectIdDefined() inline function to test.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Mar 25, 2021
@jphickey jphickey added the bug label Mar 25, 2021
jphickey added a commit to jphickey/osal that referenced this issue Mar 25, 2021
Do not initialize or compare osal_id_t directly to integers,
use the provided comparison function.
@jphickey jphickey linked a pull request Mar 25, 2021 that will close this issue
jphickey added a commit to jphickey/osal that referenced this issue Mar 31, 2021
jphickey added a commit to jphickey/osal that referenced this issue Mar 31, 2021
astrogeco added a commit that referenced this issue Mar 31, 2021
Fix #929, use test function for osal_id_t
@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
- Message map size based on used routes
- Oversized (4x) to limit collisions while retaining
  resonable size related to routing table (still smaller)
- ~10% single collisions seen for full routing table
  with realistic message ID use
- Oversizing means map can never fill, simplifies logic
- Observed approximately 10%-20% performance hit, trade
  against memory use (can now use full 32 bit MsgId space)
- Hash intended for 32 bit, if CFE_SB_MsgId_Atom_t size
  changes may require modification to hash
- Also added full coverage unit tests
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Fix nasa#928 and nasa#929 - Modularize software bus routing, add msg map hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants