From 314ec77f88325a4e8989e898991b9af493cad3dc Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Thu, 29 Apr 2021 08:55:45 -0400 Subject: [PATCH] unittests/template: Register template unittests --- src/app-layer-template.c | 3 +++ src/detect-template-buffer.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/app-layer-template.c b/src/app-layer-template.c index 234d7affbd..2a9e372030 100644 --- a/src/app-layer-template.c +++ b/src/app-layer-template.c @@ -472,9 +472,12 @@ void RegisterTemplateParsers(void) const char *proto_name = "template"; /* TEMPLATE_START_REMOVE */ +#ifndef UNITTESTS + /* Ensure template registration for unittests */ if (ConfGetNode("app-layer.protocols.template") == NULL) { return; } +#endif /* TEMPLATE_END_REMOVE */ /* Check if Template TCP detection is enabled. If it does not exist in * the configuration file then it will be enabled by default. */ diff --git a/src/detect-template-buffer.c b/src/detect-template-buffer.c index c294bb1fe6..4e5bcd66e6 100644 --- a/src/detect-template-buffer.c +++ b/src/detect-template-buffer.c @@ -53,9 +53,12 @@ static int g_template_buffer_id = 0; void DetectTemplateBufferRegister(void) { /* TEMPLATE_START_REMOVE */ +#ifndef UNITTESTS + /* Ensure registration when running unittests */ if (ConfGetNode("app-layer.protocols.template") == NULL) { return; } +#endif /* TEMPLATE_END_REMOVE */ sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_buffer"; sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc = -- 2.47.2