From: Victor Julien Date: Sat, 17 May 2025 10:21:57 +0000 (+0200) Subject: detect: only reset packet alert things in unittest mode X-Git-Tag: suricata-8.0.0-rc1~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=860bb1169243d32f033cefc79f4eb126cae80d5a;p=thirdparty%2Fsuricata.git detect: only reset packet alert things in unittest mode --- diff --git a/src/detect.c b/src/detect.c index 571e03a9d8..4fcb84e008 100644 --- a/src/detect.c +++ b/src/detect.c @@ -875,9 +875,11 @@ static DetectRunScratchpad DetectRunSetup( PACKET_PROFILING_DETECT_START(p, PROF_DETECT_SETUP); #ifdef UNITTESTS - p->alerts.cnt = 0; - p->alerts.discarded = 0; - p->alerts.suppressed = 0; + if (RunmodeIsUnittests()) { + p->alerts.cnt = 0; + p->alerts.discarded = 0; + p->alerts.suppressed = 0; + } #endif det_ctx->filestore_cnt = 0; det_ctx->base64_decoded_len = 0;