Skip to content

SCH Unit Tests #584

Answered by jeffstjean
jeffstjean asked this question in Q&A
Sep 28, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

While it should've been obvious, anything outside the c file you're testing, will be stubbed out by default. Some of the older unit tests (not sure what it was called) will trigger failure conditions from CFE calls to cause a function fail (eg. a custom init from another c file) to return a failure. With the new framework, you can just directly set the return code of any function (assuming you've created the required stubs with the generator or by hand).

Changing UT_SetDefaultReturnValue(UT_KEY(CFE_TIME_RegisterSynchCallback), !CFE_SUCCESS); to UT_SetDefaultReturnValue(UT_KEY(SCH_CustomLateInit), !CFE_SUCCESS); fixed it

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@LucienMorey
Comment options

@jeffstjean
Comment options

Answer selected by jeffstjean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants