]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/filestore: Convert unittest to new FAIL/PASS API
authorJhonny Sousa <jjhonnyj@gmail.com>
Sun, 19 Oct 2025 01:19:48 +0000 (22:19 -0300)
committerVictor Julien <vjulien@oisf.net>
Wed, 29 Oct 2025 15:33:53 +0000 (15:33 +0000)
Ticket: #6317

src/detect-filestore.c

index fcfa19fb717719b2c10a18805ebd80612c113634..f76d8ad0153551916ffbf9ad215379bd95f352b7 100644 (file)
@@ -510,23 +510,20 @@ static void DetectFilestoreFree(DetectEngineCtx *de_ctx, void *ptr)
  */
 static int DetectFilestoreTest01(void)
 {
-    DetectEngineCtx *de_ctx = NULL;
-    int result = 1;
-
-    de_ctx = DetectEngineCtxInit();
+    DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     FAIL_IF(de_ctx == NULL);
 
     de_ctx->flags |= DE_QUIET;
 
-    de_ctx->sig_list = SigInit(de_ctx,"alert http any any -> any any "
-                               "(bypass; filestore; "
-                               "content:\"message\"; http_host; "
-                               "sid:1;)");
-    FAIL_IF_NOT_NULL(de_ctx->sig_list);
+    Signature *s = DetectEngineAppendSig(de_ctx, "alert http any any -> any any "
+                                                 "(bypass; filestore; "
+                                                 "content:\"message\"; http_host; "
+                                                 "sid:1;)");
+    FAIL_IF_NOT_NULL(s);
 
     DetectEngineCtxFree(de_ctx);
 
-    return result;
+    PASS;
 }
 
 void DetectFilestoreRegisterTests(void)