From: Jeff Lucovsky Date: Thu, 29 Apr 2021 12:55:45 +0000 (-0400) Subject: unittests/template: Register template unittests X-Git-Tag: suricata-7.0.0-beta1~1309 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6436%2Fhead;p=thirdparty%2Fsuricata.git unittests/template: Register template unittests --- 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 =