From d7c93ec95027b24fe6822d5261e1ea8b1e285b61 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 20 Feb 2019 10:11:18 +0100 Subject: [PATCH] test: fix distribution of settings in ntp_core unit test --- test/unit/ntp_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/unit/ntp_core.c b/test/unit/ntp_core.c index c977a78..ac01205 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);