Skip to content

Commit 6fe676f

Browse files
moonlight83340carlescufi
authored andcommitted
posix: sched: Implement tests for sched_rr_get_interval
Implement tests for `sched_rr_get_interval()` . Function is actually placeholders and just return `ENOSYS` since Zephyr does not yet support processes or process scheduling. signed-off-by: Gaetan Perrot <[email protected]>
1 parent 3ded1c3 commit 6fe676f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/posix/common/src/pthread.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,18 @@ ZTEST(pthread, test_sched_setscheduler)
428428
zassert_true((rc == -1 && err == ENOSYS));
429429
}
430430

431+
ZTEST(pthread, test_sched_rr_get_interval)
432+
{
433+
struct timespec interval = {
434+
.tv_sec = 0,
435+
.tv_nsec = 0,
436+
};
437+
int rc = sched_rr_get_interval(0, &interval);
438+
int err = errno;
439+
440+
zassert_true((rc == -1 && err == ENOSYS));
441+
}
442+
431443
ZTEST(pthread, test_pthread_equal)
432444
{
433445
zassert_true(pthread_equal(pthread_self(), pthread_self()));

tests/posix/headers/src/sched_h.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ZTEST(posix_headers, test_sched_h)
3333
zassert_not_null(sched_getparam);
3434
zassert_not_null(sched_getscheduler);
3535

36-
/* zassert_not_null(sched_rr_get_interval); */ /* not implemented */
36+
zassert_not_null(sched_rr_get_interval);
3737

3838
zassert_not_null(sched_setparam);
3939
zassert_not_null(sched_setscheduler);

0 commit comments

Comments
 (0)