Skip to content

Commit 685511a

Browse files
committed
tests: posix: Add CLOCK_THREAD_CPUTIME_ID unittest
Add test for 'clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts)'. Signed-off-by: James Roy <rruuaanng@outlook.com>
1 parent 85e2ef8 commit 685511a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/posix/timers/src/clock.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ static const struct timespec ref_ts = {1514821501, NSEC_PER_SEC / 2U};
2626
static const clockid_t clocks[] = {
2727
CLOCK_MONOTONIC,
2828
CLOCK_REALTIME,
29+
#ifdef CONFIG_POSIX_THREAD_CPUTIME
30+
CLOCK_THREAD_CPUTIME_ID,
31+
#endif /* CONFIG_POSIX_THREAD_CPUTIME */
2932
};
3033

3134
static const bool settable[] = {
3235
false,
3336
true,
37+
#ifdef CONFIG_POSIX_THREAD_CPUTIME
38+
false,
39+
#endif /* CONFIG_POSIX_THREAD_CPUTIME */
3440
};
3541

3642
ZTEST(posix_timers, test_clock_gettime)

0 commit comments

Comments
 (0)