From: Miroslav Lichvar Date: Wed, 20 Feb 2019 09:11:18 +0000 (+0100) Subject: test: fix distribution of settings in ntp_core unit test X-Git-Tag: 3.5-pre1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7c93ec95027b24fe6822d5261e1ea8b1e285b61;p=thirdparty%2Fchrony.git test: fix distribution of settings in ntp_core unit test --- diff --git a/test/unit/ntp_core.c b/test/unit/ntp_core.c index c977a786..ac01205b 100644 --- a/test/unit/ntp_core.c +++ b/test/unit/ntp_core.c @@ -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(¤t_time);