Lines Matching refs:ss

45 	struct timeutil_sync_state ss = { 0 };  in test_state_update()  local
46 int rv = timeutil_sync_state_update(&ss, &si); in test_state_update()
50 zassert_equal(ss.base.ref, 0, in test_state_update()
52 zassert_equal(ss.skew, 0, in test_state_update()
56 rv = timeutil_sync_state_update(&ss, &si); in test_state_update()
59 zassert_equal(ss.base.ref, 1, in test_state_update()
61 zassert_equal(ss.latest.ref, 0, in test_state_update()
63 zassert_equal(ss.skew, 1.0, in test_state_update()
66 rv = timeutil_sync_state_update(&ss, &si); in test_state_update()
69 zassert_equal(ss.base.ref, 1, in test_state_update()
71 zassert_equal(ss.base.local, 0, in test_state_update()
73 zassert_equal(ss.latest.ref, 0, in test_state_update()
77 rv = timeutil_sync_state_update(&ss, &si); in test_state_update()
80 zassert_equal(ss.latest.ref, 0, in test_state_update()
84 rv = timeutil_sync_state_update(&ss, &si); in test_state_update()
87 zassert_equal(ss.base.ref, 1, in test_state_update()
89 zassert_equal(ss.base.local, 0, in test_state_update()
91 zassert_equal(ss.latest.ref, si.ref, in test_state_update()
93 zassert_equal(ss.latest.local, si.local, in test_state_update()
102 struct timeutil_sync_state ss = { in test_state_set_skew() local
106 int rv = timeutil_sync_state_update(&ss, &si); in test_state_set_skew()
110 zassert_equal(ss.skew, 1.0, in test_state_set_skew()
113 rv = timeutil_sync_state_set_skew(&ss, -1.0, NULL); in test_state_set_skew()
116 zassert_equal(ss.skew, 1.0, in test_state_set_skew()
119 rv = timeutil_sync_state_set_skew(&ss, 0.0, NULL); in test_state_set_skew()
122 zassert_equal(ss.skew, 1.0, in test_state_set_skew()
125 rv = timeutil_sync_state_set_skew(&ss, skew, NULL); in test_state_set_skew()
128 zassert_equal(ss.skew, skew, in test_state_set_skew()
130 zassert_equal(ss.base.ref, si.ref, in test_state_set_skew()
132 zassert_equal(ss.base.local, si.local, in test_state_set_skew()
139 rv = timeutil_sync_state_set_skew(&ss, skew, &si); in test_state_set_skew()
142 zassert_equal(ss.skew, skew, in test_state_set_skew()
144 zassert_equal(ss.base.ref, si.ref, in test_state_set_skew()
146 zassert_equal(ss.base.local, si.local, in test_state_set_skew()
148 zassert_equal(ss.latest.ref, 0, in test_state_set_skew()
150 zassert_equal(ss.latest.local, 0, in test_state_set_skew()
156 struct timeutil_sync_state ss = { in test_estimate_skew() local
168 skew = timeutil_sync_estimate_skew(&ss); in test_estimate_skew()
172 int rv = timeutil_sync_state_update(&ss, &si0); in test_estimate_skew()
177 skew = timeutil_sync_estimate_skew(&ss); in test_estimate_skew()
181 rv = timeutil_sync_state_update(&ss, &si1); in test_estimate_skew()
185 zassert_equal(ss.base.ref, si0.ref, in test_estimate_skew()
187 zassert_equal(ss.base.local, si0.local, in test_estimate_skew()
189 zassert_equal(ss.latest.ref, si1.ref, in test_estimate_skew()
191 zassert_equal(ss.latest.local, si1.local, in test_estimate_skew()
194 skew = timeutil_sync_estimate_skew(&ss); in test_estimate_skew()
201 ss.latest.local = scale_local(1, ss.cfg) / 2; in test_estimate_skew()
202 skew = timeutil_sync_estimate_skew(&ss); in test_estimate_skew()
209 ss.latest.local = scale_local(2, ss.cfg); in test_estimate_skew()
210 skew = timeutil_sync_estimate_skew(&ss); in test_estimate_skew()
218 struct timeutil_sync_state ss = { in tref_from_local() local
227 int rv = timeutil_sync_ref_from_local(&ss, 0, &ref); in tref_from_local()
232 rv = timeutil_sync_state_update(&ss, &si0); in tref_from_local()
235 zassert_equal(ss.skew, 1.0, 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()
245 zassert_equal(ref, ss.base.ref, in tref_from_local()
248 rv = timeutil_sync_ref_from_local(&ss, 0, &ref); in tref_from_local()
254 rv = timeutil_sync_ref_from_local(&ss, ss.base.local, &ref); in tref_from_local()
257 zassert_equal(ref, ss.base.ref, in tref_from_local()
260 rv = timeutil_sync_ref_from_local(&ss, ss.base.local in tref_from_local()
264 zassert_equal(ref, ss.base.ref + scale_ref(2, cfg), in tref_from_local()
267 rv = timeutil_sync_ref_from_local(&ss, (int64_t)ss.base.local in tref_from_local()
273 rv = timeutil_sync_state_set_skew(&ss, 0.5, NULL); in tref_from_local()
278 rv = timeutil_sync_ref_from_local(&ss, ss.base.local in tref_from_local()
282 zassert_equal(ref, ss.base.ref + cfg->ref_Hz, in tref_from_local()
295 struct timeutil_sync_state ss = { in tlocal_from_ref() local
304 int rv = timeutil_sync_local_from_ref(&ss, 0, &local); in tlocal_from_ref()
309 rv = timeutil_sync_state_update(&ss, &si0); in tlocal_from_ref()
312 zassert_equal(ss.skew, 1.0, in tlocal_from_ref()
315 rv = timeutil_sync_local_from_ref(&ss, ss.base.ref, NULL); 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()
325 rv = timeutil_sync_local_from_ref(&ss, ss.base.ref in tlocal_from_ref()
329 zassert_equal(local, ss.base.local + scale_local(2, cfg), in tlocal_from_ref()
332 rv = timeutil_sync_local_from_ref(&ss, ss.base.ref in tlocal_from_ref()
341 rv = timeutil_sync_state_set_skew(&ss, 0.5, NULL); in tlocal_from_ref()
346 rv = timeutil_sync_local_from_ref(&ss, ss.base.ref in tlocal_from_ref()
350 zassert_equal(local, ss.base.local + scale_local(1, cfg), in tlocal_from_ref()
381 struct timeutil_sync_state ss = { in test_large_linearity() local
386 timeutil_sync_state_set_skew(&ss, 1.0f, &inst); in test_large_linearity()
389 rv = timeutil_sync_ref_from_local(&ss, inputs[i], &ref_out); in test_large_linearity()
394 rv = timeutil_sync_local_from_ref(&ss, inputs[i], &loc_out); in test_large_linearity()