unittests/template: Register template unittests

pull/6436/head
Jeff Lucovsky 5 years ago committed by Victor Julien
parent 6e149cdec3
commit 314ec77f88

@ -472,9 +472,12 @@ void RegisterTemplateParsers(void)
const char *proto_name = "template"; const char *proto_name = "template";
/* TEMPLATE_START_REMOVE */ /* TEMPLATE_START_REMOVE */
#ifndef UNITTESTS
/* Ensure template registration for unittests */
if (ConfGetNode("app-layer.protocols.template") == NULL) { if (ConfGetNode("app-layer.protocols.template") == NULL) {
return; return;
} }
#endif
/* TEMPLATE_END_REMOVE */ /* TEMPLATE_END_REMOVE */
/* Check if Template TCP detection is enabled. If it does not exist in /* Check if Template TCP detection is enabled. If it does not exist in
* the configuration file then it will be enabled by default. */ * the configuration file then it will be enabled by default. */

@ -53,9 +53,12 @@ static int g_template_buffer_id = 0;
void DetectTemplateBufferRegister(void) void DetectTemplateBufferRegister(void)
{ {
/* TEMPLATE_START_REMOVE */ /* TEMPLATE_START_REMOVE */
#ifndef UNITTESTS
/* Ensure registration when running unittests */
if (ConfGetNode("app-layer.protocols.template") == NULL) { if (ConfGetNode("app-layer.protocols.template") == NULL) {
return; return;
} }
#endif
/* TEMPLATE_END_REMOVE */ /* TEMPLATE_END_REMOVE */
sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_buffer"; sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].name = "template_buffer";
sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc = sigmatch_table[DETECT_AL_TEMPLATE_BUFFER].desc =

Loading…
Cancel
Save