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

Update OS_VxWorks_SigWait test case #322

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/unit-test-coverage/ut-stubs/src/posix-time-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ int OCS_timer_settime (OCS_timer_t timerid, int flags, const struct OCS_itimersp
int32 Status;

Status = UT_DEFAULT_IMPL(OCS_timer_settime);
if (Status == 0)
{
UT_Stub_CopyFromLocal(UT_KEY(OCS_timer_settime), value, sizeof(*value));
}

return Status;
}
Expand Down
12 changes: 9 additions & 3 deletions src/unit-test-coverage/vxworks/src/coveragetest-ostimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,24 @@ void Test_OS_VxWorks_SigWait(void)
* (invocation of static function through a wrapper)
*/
int signo = OCS_SIGRTMIN;
struct OCS_itimerspec config_value;

OS_global_timebase_table[0].active_id = 0x12345;
OS_timebase_table[0].nominal_start_time = 8888;
OS_timebase_table[0].nominal_interval_time = 5555;

memset(&config_value, 0, sizeof(config_value));
UT_SetDataBuffer(UT_KEY(OCS_timer_settime),&config_value,sizeof(config_value),false);
UT_SetDataBuffer(UT_KEY(OCS_timer_gettime),&config_value,sizeof(config_value),false);
Osapi_Internal_Setup(0, signo, true);
OS_TimeBaseSet_Impl(0, 1111111, 2222222);

UT_SetDataBuffer(UT_KEY(OCS_sigwait),&signo,sizeof(signo),false);
OSAPI_TEST_FUNCTION_RC(Osapi_Internal_CallSigWaitFunc(0), 8888);
OSAPI_TEST_FUNCTION_RC(Osapi_Internal_CallSigWaitFunc(0), 1111111);
UT_SetDataBuffer(UT_KEY(OCS_sigwait),&signo,sizeof(signo),false);
OSAPI_TEST_FUNCTION_RC(Osapi_Internal_CallSigWaitFunc(0), 5555);
OSAPI_TEST_FUNCTION_RC(Osapi_Internal_CallSigWaitFunc(0), 2222222);
UT_SetDataBuffer(UT_KEY(OCS_sigwait),&signo,sizeof(signo),false);
OSAPI_TEST_FUNCTION_RC(Osapi_Internal_CallSigWaitFunc(0), 5555);
OSAPI_TEST_FUNCTION_RC(Osapi_Internal_CallSigWaitFunc(0), 2222222);

Osapi_Internal_Setup(0, 0, false);
OS_global_timebase_table[0].active_id = 0;
Expand Down