-
Notifications
You must be signed in to change notification settings - Fork 215
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
new osal_id_t code and unit tests using osal stubs #597
Comments
Well, the fact that If all you want is a valid task ID - just call What's interesting is that this will be a different value than what you'd get by calling |
I believe this will work for SBN, however if the code under test was calling |
Yeah, I can see that as being a possible future issue ... what we really should have is the ability for more control of what ID the N.B. that despite using a typedef, the osal_id_t is still fundamentally an integer - right now it is just a typedef to Did this actually break something or is this more of a future concern? |
Incorrect -- you should be able to use a deferred return code just fine. Did this not work? In the current version of the stubs - the "status" you set reflects the integer index (0-based) and the stub converts this to a "fake task ID" ... maybe that is not appropriate for all use cases? |
See nasa/SBN@7305e53 -- I was calling |
Right - the stub is interpreting the given value as an index - which is then converting to a UT-style task ID - which is actually different than normal task ID - as it uses In retrospect - I do think this stub is doing too much. Importantly there is no way to have it actually fail and have it return Also note that the first call to |
Describe the bug
The SBN application's coverage tests include tests of tasks, such as:
The issue is, now, the result of OS_TaskGetId() is an osal_id_t value that I need to compute to put into the SendTaskID field above. There is a helper function
UT_ObjIdCompose()
that could be used by unit tests but it is not currently exposed. For now, I've removed theUT_SetDeferredRetcode(...TaskGetId)...)
call and instead I hand-copied the ID to write it...SendTaskID = 1073807361
(the value returned byObjIdCompose()
) which is clearly not sustainable.Expected behavior
Expose the ObjIdCompose() function from the OSAL stubs so that unit test code can generate matching ID's.
Reporter Info
Christopher.D.Knight@nasa.gov
The text was updated successfully, but these errors were encountered: