Lines Matching +full:hi +full:- +full:z
5 * SPDX-License-Identifier: Apache-2.0
15 #define CLOCK_INVALID -1
19 /* Set a particular time. In this case, the output of: `date +%s -d 2018-01-01T15:45:01Z` */
33 return ts->tv_sec * NSEC_PER_SEC + ts->tv_nsec; in ts_to_ns()
38 ts->tv_sec = tv->tv_sec; in tv_to_ts()
39 ts->tv_nsec = tv->tv_usec * NSEC_PER_USEC; in tv_to_ts()
55 _decl_op(int64_t, tp_diff, -); /* a - b */
57 /* lo <= (a - b) < hi */
59 int64_t lo, int64_t hi) in tp_diff_in_range_ns() argument
63 return diff >= lo && diff < hi; in tp_diff_in_range_ns()
72 zassert_equal(clock_gettime(CLOCK_INVALID, &ts), -1); in ZTEST()
78 zassert_equal(clock_gettime(clocks[0], NULL), -1); in ZTEST()
85 ts = (struct timespec){-1, -1}; in ZTEST()
87 zassert_not_equal(ts.tv_sec, -1); in ZTEST()
88 zassert_not_equal(ts.tv_nsec, -1); in ZTEST()
101 zassert_equal(gettimeofday(NULL, NULL), -1); in ZTEST()
126 zassert_equal(clock_settime(CLOCK_INVALID, &ts), -1); in ZTEST()
132 zassert_equal(clock_settime(CLOCK_REALTIME, NULL), -1); in ZTEST()
139 zassert_equal(clock_settime(CLOCK_REALTIME, &ts), -1); in ZTEST()
142 ts = (struct timespec){0, -1}; in ZTEST()
143 zassert_equal(clock_settime(CLOCK_REALTIME, &ts), -1); in ZTEST()
151 zassert_equal(clock_settime(clocks[i], &ts), -1); in ZTEST()
158 /* read-back the time */ in ZTEST()
180 int64_t hi = CONFIG_TEST_CLOCK_RT_SLEEP_MS + CONFIG_TEST_CLOCK_RT_ERROR_MS; in ZTEST() local
211 LOG_INF("n: %d, sleep: %d, margin: %d, lo: %lld, avg: %lld, hi: %lld", in ZTEST()
214 zassert_between_inclusive(cma, lo, hi); in ZTEST()
247 {CLOCK_INVALID, NULL, -1}, in ZTEST()
248 {CLOCK_INVALID, &res, -1}, in ZTEST()
262 ret = clock_getres(arg->clock_id, arg->res); in ZTEST()
263 zassert_equal(ret, arg->expect); in ZTEST()
268 if (arg->res != NULL) { in ZTEST()
269 zassert_true(tp_ge(arg->res, &one_ns)); in ZTEST()