From edc19a15ad021d8dc5f7ba22fe61e7406b61d519 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 24 Feb 2026 16:24:02 +0100 Subject: [PATCH] detect/parse: convert unittest to fail/pass API --- src/detect-parse.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/detect-parse.c b/src/detect-parse.c index c2f513ae37..43df59f239 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -5112,26 +5112,16 @@ end: */ static int SigParseTestAppLayerTLS03(void) { - int result = 0; - DetectEngineCtx *de_ctx; - Signature *s=NULL; - - de_ctx = DetectEngineCtxInit(); - if (de_ctx == NULL) - goto end; + DetectEngineCtx *de_ctx = DetectEngineCtxInit(); + FAIL_IF_NULL(de_ctx); de_ctx->flags |= DE_QUIET; - s = SigInit(de_ctx,"alert tls any any -> any any (msg:\"SigParseTestAppLayerTLS03 \"; tls.version:2.5; sid:410006; rev:1;)"); - if (s != NULL) { - SigFree(de_ctx, s); - goto end; - } - - result = 1; -end: - if (de_ctx != NULL) - DetectEngineCtxFree(de_ctx); - return result; + Signature *s = DetectEngineAppendSig(de_ctx, + "alert tls any any -> any any (msg:\"SigParseTestAppLayerTLS03 \"; " + "tls.version:2.5; sid:410006; rev:1;)"); + FAIL_IF_NOT_NULL(s); + DetectEngineCtxFree(de_ctx); + PASS; } static int SigParseTestUnbalancedQuotes01(void)