summaryrefslogtreecommitdiff
path: root/test/unit/ntp_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/ntp_core.c')
-rw-r--r--test/unit/ntp_core.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/unit/ntp_core.c b/test/unit/ntp_core.c
index 5e519e5..ac01205 100644
--- a/test/unit/ntp_core.c
+++ b/test/unit/ntp_core.c
@@ -28,6 +28,8 @@
#include <local.h>
#include "test.h"
+#ifdef FEAT_NTP
+
static struct timespec current_time;
static NTP_Receive_Buffer req_buffer, res_buffer;
static int req_length, res_length;
@@ -332,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);
@@ -475,3 +475,11 @@ test_unit(void)
CNF_Finalise();
HSH_Finalise();
}
+
+#else
+void
+test_unit(void)
+{
+ TEST_REQUIRE(0);
+}
+#endif