]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
test: fix distribution of settings in ntp_core unit test
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 20 Feb 2019 09:11:18 +0000 (10:11 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 20 Feb 2019 09:11:58 +0000 (10:11 +0100)
test/unit/ntp_core.c

index c977a7866e64003c32fe432805a188d1cabdba39..ac01205b27701318a288b4adf2da8ddeb61c18da 100644 (file)
@@ -334,10 +334,8 @@ test_unit(void)
   CPS_ParseNTPSourceAdd(source_line, &source);
 
   for (i = 0; i < 1000; i++) {
-    if (random() % 2)
-      source.params.interleaved = 1;
-    if (random() % 2)
-      source.params.authkey = get_random_key_id();
+    source.params.interleaved = random() % 2;
+    source.params.authkey = random() % 2 ? get_random_key_id() : INACTIVE_AUTHKEY;
     source.params.version = random() % 4 + 1;
 
     UTI_ZeroTimespec(&current_time);