mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-07 11:35:07 -05:00
sources: update stratum with leap status
Remove stratum from the NTP sample and update it together with the leap status. This enables a faster update when samples are dropped by the NTP filters.
This commit is contained in:
@@ -59,7 +59,6 @@ test_unit(void)
|
||||
sample_in.root_dispersion = TST_GetRandomDouble(1.0e-3, 2.0e-3);
|
||||
sample_in.peer_delay = TST_GetRandomDouble(1.0e-2, 2.0e-2);
|
||||
sample_in.root_delay = TST_GetRandomDouble(1.0e-1, 2.0e-1);
|
||||
sample_in.stratum = random() % 16;
|
||||
|
||||
TEST_CHECK(SPF_AccumulateSample(filter, &sample_in));
|
||||
TEST_CHECK(!SPF_AccumulateSample(filter, &sample_in));
|
||||
@@ -97,7 +96,6 @@ test_unit(void)
|
||||
sample_out.peer_delay <= 2.0e-2);
|
||||
TEST_CHECK(sample_out.root_delay >= 1.0e-1 &&
|
||||
sample_out.root_delay <= 2.0e-1);
|
||||
TEST_CHECK(sample_out.stratum >= 0 && sample_out.stratum <= 15);
|
||||
|
||||
if (max_samples == 1)
|
||||
TEST_CHECK(!memcmp(&sample_in, &sample_out, sizeof (sample_in)));
|
||||
|
||||
@@ -79,10 +79,9 @@ test_unit(void)
|
||||
sample.peer_dispersion = TST_GetRandomDouble(1.0e-6, 1.0e-1);
|
||||
sample.root_delay = sample.peer_delay;
|
||||
sample.root_dispersion = sample.peer_dispersion;
|
||||
sample.stratum = 1;
|
||||
|
||||
if (random() % 2)
|
||||
SRC_SetLeapStatus(srcs[j], random() % 4);
|
||||
SRC_UpdateStatus(srcs[j], 1, random() % 4);
|
||||
|
||||
DEBUG_LOG("source %d sample %d offset %f delay %f disp %f", j, k,
|
||||
sample.offset, sample.peer_delay, sample.peer_dispersion);
|
||||
|
||||
Reference in New Issue
Block a user