-
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 #380, Add OS_TimeBase Api Functional Tests #481
Fix #380, Add OS_TimeBase Api Functional Tests #481
Conversation
CCB 2020-05-27 APPROVED |
++TimerSyncCount; | ||
return TimerSyncRetVal; | ||
} | ||
|
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.
Note this sync function is going to immediately return 0, which causes a "spin loop" in the timebase. There is some protection against this but its really not something you should do, its just to protect against locking the CPU.
objid = 0x00000000; | ||
actual = OS_TimeBaseCreate(&objid, "maxTimeBase", 0); | ||
UtAssert_True(actual == expected, "OS_TimeBaseCreate() (%ld) == OS_SUCCESS", (long)actual); | ||
|
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 OS_MAX_TIMEBASES is a configurable parameter. Could we turn this into a loop based on OS_MAX_TIMEBASES so that this test case still works if the user changes this value?
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.
I read in the OS_MAX_TIMEBASES, so shouldn't it automatically always read in the max value if the user reconfigured it it before this point?
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 idea is to confirm that one can create entities all the way up to OS_MAX_TIMEBASES (i.e. all OS_SUCCESS), then attempt to create one more which should return an error. The point at which this happens is user configurable so this would have to be converted into a loop. This is currently hardcoding 5 timebase objects, so it will fail with OS_MAX_TIMEBASES set to anything other than 5.
I realize this has been developed and approved but I am wondering if this could leverage the macros in https://github.com/nasa/osal/blob/master/src/unit-tests/inc/ut_os_support.h (namely: UT_NOMINAL(), UT_RETVAL(), ...) |
Let's merge this and open a new PR specifically for using the macros Edit: New PR #484 |
@yammajamma I switched this to draft. Can you address @jphickey comments and remove the draft status once done? |
@astrogeco Yep, working on that right now. |
@jphickey do these look good? |
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.
Looks good
Fix #380, Add OS_TimeBase Api Functional Tests
Describe the contribution
Added OS_TimeBase Api Functional Tests for OS_TimeBaseCreate, OS_TimeBaseSet, OS_TimeBaseDelete, OS_TimeBaseGetIdByName, OS_TimeBaseGetInfo, OS_TimeBaseGetFreeRun
Testing performed
Steps taken to test the contribution:
System(s) tested on
cFS Dev Server
OS: Ubuntu 18.04
Versions: OSAL 5.0.11.0
Contributor Info - All information REQUIRED for consideration of pull request
Yasir Khan
NASA GSFC