Lines Matching refs:nto

19 static void dump_nto(const struct net_timeout *nto)
21 uint64_t remaining = nto->timer_timeout;
22 uint64_t deadline = nto->timer_start;
24 remaining += NET_TIMEOUT_MAX_VALUE * nto->wrap_counter;
28 nto->timer_start, nto->wrap_counter,
29 NET_TIMEOUT_MAX_VALUE, nto->timer_timeout,
48 struct net_timeout nto; in ZTEST() local
53 memset(&nto, 0xa5, sizeof(nto)); in ZTEST()
54 net_timeout_set(&nto, 0, now); in ZTEST()
55 zassert_equal(nto.timer_start, now); in ZTEST()
56 zassert_equal(nto.wrap_counter, 0); in ZTEST()
57 zassert_equal(nto.timer_timeout, 0); in ZTEST()
62 memset(&nto, 0xa5, sizeof(nto)); in ZTEST()
63 net_timeout_set(&nto, lifetime, now); in ZTEST()
64 zassert_equal(nto.timer_start, now); in ZTEST()
65 zassert_equal(nto.wrap_counter, 0); in ZTEST()
66 zassert_equal(nto.timer_timeout, lifetime * MSEC_PER_SEC, in ZTEST()
72 memset(&nto, 0xa5, sizeof(nto)); in ZTEST()
73 net_timeout_set(&nto, lifetime, now); in ZTEST()
74 zassert_equal(nto.timer_start, now); in ZTEST()
75 zassert_equal(nto.wrap_counter, 0); in ZTEST()
76 zassert_equal(nto.timer_timeout, lifetime * MSEC_PER_SEC, in ZTEST()
82 memset(&nto, 0xa5, sizeof(nto)); in ZTEST()
83 net_timeout_set(&nto, lifetime, now); in ZTEST()
84 zassert_equal(nto.timer_start, now); in ZTEST()
85 zassert_equal(nto.wrap_counter, 1U); in ZTEST()
86 zassert_equal(nto.timer_timeout, in ZTEST()
93 memset(&nto, 0xa5, sizeof(nto)); in ZTEST()
94 net_timeout_set(&nto, lifetime, now); in ZTEST()
95 zassert_equal(nto.timer_start, now); in ZTEST()
96 zassert_equal(nto.wrap_counter, 1U); in ZTEST()
97 zassert_equal(nto.timer_timeout, in ZTEST()
104 memset(&nto, 0xa5, sizeof(nto)); in ZTEST()
105 net_timeout_set(&nto, lifetime, now); in ZTEST()
106 zassert_equal(nto.timer_start, now); in ZTEST()
107 zassert_equal(nto.wrap_counter, MSEC_PER_SEC - 1); in ZTEST()
108 zassert_equal(nto.timer_timeout, NET_TIMEOUT_MAX_VALUE); in ZTEST()
113 struct net_timeout nto; in ZTEST() local
119 net_timeout_set(&nto, lifetime, now); in ZTEST()
121 zassert_equal(net_timeout_deadline(&nto, now), in ZTEST()
126 zassert_equal(net_timeout_deadline(&nto, now + 23U), in ZTEST()
132 zassert_equal(net_timeout_deadline(&nto, now), in ZTEST()
141 zassert_equal(net_timeout_deadline(&nto, now), in ZTEST()
145 zassert_equal(net_timeout_deadline(&nto, now + 52), in ZTEST()
152 struct net_timeout nto; in ZTEST() local
157 memset(&nto, 0xa5, sizeof(nto)); in ZTEST()
158 net_timeout_set(&nto, 0, now); in ZTEST()
159 zassert_equal(net_timeout_remaining(&nto, now), 0U, in ZTEST()
164 memset(&nto, 0xa5, sizeof(nto)); in ZTEST()
165 net_timeout_set(&nto, lifetime, now); in ZTEST()
166 zassert_equal(nto.wrap_counter, 0); in ZTEST()
167 zassert_equal(net_timeout_remaining(&nto, now), lifetime, in ZTEST()
171 zassert_equal(net_timeout_remaining(&nto, now + 1U), in ZTEST()
174 zassert_equal(net_timeout_remaining(&nto, now + MSEC_PER_SEC - 1U), in ZTEST()
177 zassert_equal(net_timeout_remaining(&nto, now + MSEC_PER_SEC), in ZTEST()
180 zassert_equal(net_timeout_remaining(&nto, now + MSEC_PER_SEC + 1U), in ZTEST()
186 net_timeout_set(&nto, lifetime, now); in ZTEST()
187 zassert_equal(nto.wrap_counter, 7); in ZTEST()
188 zassert_equal(net_timeout_remaining(&nto, now), lifetime, in ZTEST()
194 struct net_timeout nto; in ZTEST() local
202 net_timeout_set(&nto, lifetime, now); in ZTEST()
203 zassert_equal(nto.timer_start, now, in ZTEST()
205 zassert_equal(nto.wrap_counter, 2, in ZTEST()
208 zassert_equal(nto.timer_timeout, remainder, in ZTEST()
210 deadline = net_timeout_deadline(&nto, now); in ZTEST()
214 delay = net_timeout_evaluate(&nto, now); in ZTEST()
217 zassert_equal(nto.timer_start, now, in ZTEST()
219 zassert_equal(nto.wrap_counter, 2, in ZTEST()
221 zassert_equal(nto.timer_timeout, remainder, in ZTEST()
223 zassert_equal(net_timeout_deadline(&nto, now), deadline, in ZTEST()
229 delay = net_timeout_evaluate(&nto, now + half_max); in ZTEST()
232 zassert_equal(nto.timer_start, now, in ZTEST()
234 zassert_equal(nto.wrap_counter, 2, in ZTEST()
236 zassert_equal(nto.timer_timeout, remainder, in ZTEST()
238 zassert_equal(net_timeout_deadline(&nto, now), deadline, in ZTEST()
244 delay = net_timeout_evaluate(&nto, now + NET_TIMEOUT_MAX_VALUE - 1U); in ZTEST()
247 zassert_equal(nto.timer_start, now, in ZTEST()
249 zassert_equal(nto.wrap_counter, 2, in ZTEST()
251 zassert_equal(nto.timer_timeout, remainder, in ZTEST()
253 zassert_equal(net_timeout_deadline(&nto, now), deadline, in ZTEST()
260 delay = net_timeout_evaluate(&nto, now); in ZTEST()
263 zassert_equal(nto.timer_start, now, in ZTEST()
265 zassert_equal(nto.wrap_counter, 1, in ZTEST()
267 zassert_equal(nto.timer_timeout, remainder, in ZTEST()
268 "remainder %u", nto.timer_timeout); in ZTEST()
269 zassert_equal(net_timeout_deadline(&nto, now), deadline, in ZTEST()
278 delay = net_timeout_evaluate(&nto, now); in ZTEST()
281 zassert_equal(nto.timer_start, (uint32_t)now, in ZTEST()
283 zassert_equal(nto.wrap_counter, 0, in ZTEST()
285 zassert_equal(nto.timer_timeout, remainder, in ZTEST()
287 zassert_equal(net_timeout_deadline(&nto, now), deadline, in ZTEST()
292 delay = net_timeout_evaluate(&nto, now); in ZTEST()
295 zassert_equal(net_timeout_deadline(&nto, now), deadline, in ZTEST()
305 struct net_timeout nto; in ZTEST() local
309 net_timeout_set(&nto, lifetime, now); in ZTEST()
310 zassert_equal(nto.timer_start, now); in ZTEST()
311 zassert_equal(nto.wrap_counter, 3); in ZTEST()
312 zassert_equal(nto.timer_timeout, 59); in ZTEST()
315 uint64_t deadline = net_timeout_deadline(&nto, now); in ZTEST()
317 uint32_t delay = net_timeout_evaluate(&nto, now); in ZTEST()
319 zassert_equal(net_timeout_deadline(&nto, now), in ZTEST()
326 delay = net_timeout_evaluate(&nto, now); in ZTEST()
327 zassert_equal(nto.timer_start, now); in ZTEST()
328 zassert_equal(nto.wrap_counter, 1); in ZTEST()
329 zassert_equal(nto.timer_timeout, 2147483606); in ZTEST()
330 zassert_equal(net_timeout_deadline(&nto, now), in ZTEST()
337 delay = net_timeout_evaluate(&nto, now); in ZTEST()
338 zassert_equal(nto.timer_start, (uint32_t)now); in ZTEST()
339 zassert_equal(nto.wrap_counter, 0); in ZTEST()
340 zassert_equal(nto.timer_timeout, 2147483483); in ZTEST()
341 zassert_equal(net_timeout_deadline(&nto, now), in ZTEST()
343 zassert_equal(delay, nto.timer_timeout); in ZTEST()
349 delay = net_timeout_evaluate(&nto, now); in ZTEST()
351 zassert_equal(net_timeout_deadline(&nto, now), in ZTEST()