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

Implement 100% branch coverage with return verification #791

Closed
skliper opened this issue Feb 10, 2021 · 0 comments · Fixed by #1114 or #1116
Closed

Implement 100% branch coverage with return verification #791

skliper opened this issue Feb 10, 2021 · 0 comments · Fixed by #1114 or #1116
Assignees
Labels
unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Feb 10, 2021

Is your feature request related to a problem? Please describe.
See OS_ConsoleAPI_Init test, called once with no return checking... doesn't meet expectations for coverage (current minimum goal is all lines, all branches). Note future standards may require MC/DC.

void Test_OS_ConsoleAPI_Init(void)
{
/*
* Test Case For:
* int32 OS_ConsoleAPI_Init(void)
*/
uint32 CallCount = 0;
OS_object_token_t token;
/* make a custom token to force use of array index 0 */
token.lock_mode = OS_LOCK_MODE_NONE;
token.obj_type = OS_OBJECT_TYPE_OS_CONSOLE;
token.obj_idx = UT_INDEX_0;
token.obj_id = UT_OBJID_1;
UT_SetDataBuffer(UT_KEY(OS_ObjectIdAllocateNew), &token, sizeof(token), false);
/* call for coverage */
OS_ConsoleAPI_Init();
CallCount = UT_GetStubCount(UT_KEY(OS_ConsoleCreate_Impl));
UtAssert_True(CallCount == 1, "OS_ConsoleCreate_Impl() call count (%lu) == 1", (unsigned long)CallCount);
}

Describe the solution you'd like
Add full branch coverage to unit tests

Describe alternatives you've considered
Add MC/DC coverage to unit tests

Additional context
#790, #792

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added the unit-test Tickets related to the OSAL unit testing (functional and/or coverage) label Feb 10, 2021
@skliper skliper added this to the 6.0.0 milestone Feb 10, 2021
@skliper skliper self-assigned this Jul 19, 2021
skliper added a commit to skliper/osal that referenced this issue Jul 21, 2021
skliper added a commit to skliper/osal that referenced this issue Jul 21, 2021
skliper added a commit to skliper/osal that referenced this issue Jul 21, 2021
skliper added a commit to skliper/osal that referenced this issue Jul 21, 2021
astrogeco added a commit that referenced this issue Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
1 participant