diff --git a/tests/posix/common/src/clock.c b/tests/posix/common/src/clock.c index d36c74fe0ded3a..07a825434c5eba 100644 --- a/tests/posix/common/src/clock.c +++ b/tests/posix/common/src/clock.c @@ -217,10 +217,11 @@ ZTEST(clock, test_realtime) ZTEST(clock, test_clock_getcpuclockid) { int ret = 0; - clockid_t clock_id; + clockid_t clock_id = CLOCK_INVALID; ret = clock_getcpuclockid((pid_t)0, &clock_id); zassert_equal(ret, 0, "POSIX clock_getcpuclock id failed"); + zassert_equal(clock_id, CLOCK_PROCESS_CPUTIME_ID, "POSIX clock_getcpuclock id failed"); ret = clock_getcpuclockid((pid_t)2482, &clock_id); zassert_equal(ret, EPERM, "POSIX clock_getcpuclock id failed");