Lines Matching full:local
71 zassert_equal(ss.base.local, 0, in test_state_update()
72 "unexpected base local"); in test_state_update()
79 "non-increasing local got: %d", rv); in test_state_update()
83 si.local += 20; in test_state_update()
89 zassert_equal(ss.base.local, 0, in test_state_update()
90 "unexpected base local"); in test_state_update()
93 zassert_equal(ss.latest.local, si.local, in test_state_update()
94 "unexpected latest local"); in test_state_update()
132 zassert_equal(ss.base.local, si.local, in test_state_set_skew()
137 si.local += 3; in test_state_set_skew()
146 zassert_equal(ss.base.local, si.local, in test_state_set_skew()
150 zassert_equal(ss.latest.local, 0, in test_state_set_skew()
151 "uncleared latest local"); in test_state_set_skew()
164 .local = si0.local + cfg1.local_Hz, in test_estimate_skew()
187 zassert_equal(ss.base.local, si0.local, in test_estimate_skew()
188 "unexpected base local"); in test_estimate_skew()
191 zassert_equal(ss.latest.local, si1.local, in test_estimate_skew()
192 "unexpected latest local"); in test_estimate_skew()
198 /* Local advanced half as far as it should: scale by 2 to in test_estimate_skew()
201 ss.latest.local = scale_local(1, ss.cfg) / 2; in test_estimate_skew()
206 /* Local advanced twice as far as it should: scale by 1/2 to in test_estimate_skew()
209 ss.latest.local = scale_local(2, ss.cfg); in test_estimate_skew()
222 /* Absolute local 0 is 5 s ref */ in tref_from_local()
224 .local = scale_local(5, cfg), in tref_from_local()
238 rv = timeutil_sync_ref_from_local(&ss, ss.base.local, NULL); in tref_from_local()
242 rv = timeutil_sync_ref_from_local(&ss, ss.base.local, &ref); in tref_from_local()
250 "%s: unexpected local=0 fail", tag, rv); in tref_from_local()
252 "%s: unexpected local=0 ref", tag); in tref_from_local()
254 rv = timeutil_sync_ref_from_local(&ss, ss.base.local, &ref); in tref_from_local()
256 "%s: unexpected local=base fail", tag, rv); in tref_from_local()
258 "%s: unexpected local=base ref", tag); in tref_from_local()
260 rv = timeutil_sync_ref_from_local(&ss, ss.base.local in tref_from_local()
263 "%s: unexpected local=base+2s fail %d", tag, rv); in tref_from_local()
265 "%s: unexpected local=base+2s ref", tag); in tref_from_local()
267 rv = timeutil_sync_ref_from_local(&ss, (int64_t)ss.base.local in tref_from_local()
270 "%s: unexpected local=base-12s res %u", tag, rv); in tref_from_local()
272 /* Skew of 0.5 means local runs at double speed */ in tref_from_local()
277 /* Local at double speed corresponds to half advance in ref */ in tref_from_local()
278 rv = timeutil_sync_ref_from_local(&ss, ss.base.local in tref_from_local()
299 /* Absolute local 0 is 5 s ref */ in tlocal_from_ref()
301 .local = scale_local(5, cfg), in tlocal_from_ref()
303 int64_t local = 0; in tlocal_from_ref() local
304 int rv = timeutil_sync_local_from_ref(&ss, 0, &local); in tlocal_from_ref()
319 rv = timeutil_sync_local_from_ref(&ss, ss.base.ref, &local); in tlocal_from_ref()
322 zassert_equal(local, ss.base.local, in tlocal_from_ref()
326 + scale_ref(2, cfg), &local); in tlocal_from_ref()
329 zassert_equal(local, ss.base.local + scale_local(2, cfg), in tlocal_from_ref()
333 - scale_ref(7, cfg), &local); in tlocal_from_ref()
336 zassert_equal(local, scale_local_signed(-2, cfg), in tlocal_from_ref()
340 /* Skew of 0.5 means local runs at double speed */ in tlocal_from_ref()
345 /* Local at double speed corresponds to half advance in ref */ in tlocal_from_ref()
347 + scale_ref(1, cfg) / 2, &local); in tlocal_from_ref()
350 zassert_equal(local, ss.base.local + scale_local(1, cfg), in tlocal_from_ref()
379 .local = 100 in test_large_linearity()
384 uint64_t offset = inst.ref - inst.local; in test_large_linearity()
392 "Large unity local->ref conversion fail"); in test_large_linearity()
397 "Large unity ref->local conversion fail"); in test_large_linearity()