[chrony-dev] [PATCH] test: extend frequency in ntp_adjtime() test

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


Extend the frequency range in the test to cover negative frequencies.
---
 test/kernel/ntpadjtime.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/kernel/ntpadjtime.c b/test/kernel/ntpadjtime.c
index d6be154..4af96b4 100644
--- a/test/kernel/ntpadjtime.c
+++ b/test/kernel/ntpadjtime.c
@@ -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");
   }
 }
 
-- 
2.24.3 (Apple Git-128)


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/