mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 19:45:07 -05:00
test: extend frequency in ntp_adjtime() test
Extend the frequency range in the test to cover negative frequencies.
This commit is contained in:
committed by
Miroslav Lichvar
parent
538e1c5eb1
commit
bd3b36865e
@@ -52,15 +52,15 @@ test_freqrange(void)
|
||||
|
||||
printf("freq range:\n");
|
||||
|
||||
for (i = 0; i <= 1000; i += 50) {
|
||||
for (i = -1000; i <= 1000; i += 50) {
|
||||
t.modes = MOD_FREQUENCY;
|
||||
t.freq = i << 16;
|
||||
t.freq = i * (1 << 16);
|
||||
printf("%4d ppm => ", i);
|
||||
if (try_ntpadjtime(&t) < 0)
|
||||
continue;
|
||||
|
||||
printf("%4ld ppm : ", t.freq / (1 << 16));
|
||||
printf("%s\n", t.freq == i << 16 ? "ok" : "fail");
|
||||
printf("%s\n", t.freq == i * (1 << 16) ? "ok" : "fail");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user