Skip to content

Commit 49cca9d

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 2803dac commit 49cca9d

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
@@ -22,11 +22,17 @@ static const struct timespec ref_ts = {1514821501, NSEC_PER_SEC / 2U};
2222
static const clockid_t clocks[] = {
2323
CLOCK_MONOTONIC,
2424
CLOCK_REALTIME,
25+
#ifdef CONFIG_POSIX_THREAD_CPUTIME
26+
CLOCK_THREAD_CPUTIME_ID,
27+
#endif /* CONFIG_POSIX_THREAD_CPUTIME */
2528
};
2629

2730
static const bool settable[] = {
2831
false,
2932
true,
33+
#ifdef CONFIG_POSIX_THREAD_CPUTIME
34+
false,
35+
#endif /* CONFIG_POSIX_THREAD_CPUTIME */
3036
};
3137

3238
static inline int64_t ts_to_ns(const struct timespec *ts)

0 commit comments

Comments
 (0)