-
Notifications
You must be signed in to change notification settings - Fork 253
Labels
unit-testTickets related to the OSAL unit testing (functional and/or coverage)Tickets related to the OSAL unit testing (functional and/or coverage)
Milestone
Description
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.
osal/src/unit-test-coverage/shared/src/coveragetest-printf.c
Lines 35 to 57 in 09a2c5e
| 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
Requester Info
Jacob Hageman - NASA/GSFC
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
unit-testTickets related to the OSAL unit testing (functional and/or coverage)Tickets related to the OSAL unit testing (functional and/or coverage)