]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect-engine: adjust unit tests for hs mpm
authorJustin Viiret <justin.viiret@intel.com>
Mon, 23 May 2016 01:58:01 +0000 (11:58 +1000)
committerVictor Julien <victor@inliniac.net>
Fri, 27 May 2016 13:13:54 +0000 (15:13 +0200)
The Hyperscan MPM does match deduplication internally (using
HS_FLAG_SINGLEMATCH) and only returns the number of unique matches,
unlike AC.

src/detect-engine-hhd.c
src/detect-engine-hrhd.c
src/detect-engine-hrud.c

index 9419989938fd13d1b23111f60fcc9fd0a4ce9a3c..d5863ecf4b8443e473df98bbb8063c8d7ef2f3f2 100644 (file)
@@ -2016,8 +2016,8 @@ static int DetectEngineHttpHeaderTest18(void)
     /* start the search phase */
     det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p);
     uint32_t r = HttpHeaderPatternSearch(det_ctx, http_buf, http_len, STREAM_TOSERVER);
-    if (r != 2) {
-        printf("expected result 2, got %"PRIu32": ", r);
+    if (r < 1) {
+        printf("expected result >= 1, got %"PRIu32": ", r);
         goto end;
     }
 
index 7395cbfa6177bd07c2fddf1327590a1b6e337ca5..e4d6c5e20a4006402c9856765c1946e32edf90e1 100644 (file)
@@ -1888,8 +1888,8 @@ static int DetectEngineHttpRawHeaderTest18(void)
     /* start the search phase */
     det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p);
     uint32_t r = HttpRawHeaderPatternSearch(det_ctx, http_buf, http_len, STREAM_TOSERVER);
-    if (r != 2) {
-        printf("expected result 2, got %"PRIu32": ", r);
+    if (r < 1) {
+        printf("expected result >= 1, got %"PRIu32": ", r);
         goto end;
     }
 
index 38d7ea7867ec73a4b2e131161bd0ed0fd3c29231..352923593e09bec114a45128c8a1b9ff07224ba8 100644 (file)
@@ -2448,8 +2448,8 @@ static int DetectEngineHttpRawUriTest20(void)
     /* start the search phase */
     det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1);
     uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len, STREAM_TOSERVER);
-    if (r != 2) {
-        printf("expected 2 result, got %"PRIu32": ", r);
+    if (r < 1) {
+        printf("expected result >= 1, got %"PRIu32": ", r);
         goto end;
     }