From: Justin Viiret Date: Mon, 23 May 2016 01:58:01 +0000 (+1000) Subject: detect-engine: adjust unit tests for hs mpm X-Git-Tag: suricata-3.1RC1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31d8d4b0a1cf686d1271c8781c160a7e69bb932e;p=thirdparty%2Fsuricata.git detect-engine: adjust unit tests for hs mpm The Hyperscan MPM does match deduplication internally (using HS_FLAG_SINGLEMATCH) and only returns the number of unique matches, unlike AC. --- diff --git a/src/detect-engine-hhd.c b/src/detect-engine-hhd.c index 9419989938..d5863ecf4b 100644 --- a/src/detect-engine-hhd.c +++ b/src/detect-engine-hhd.c @@ -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; } diff --git a/src/detect-engine-hrhd.c b/src/detect-engine-hrhd.c index 7395cbfa61..e4d6c5e20a 100644 --- a/src/detect-engine-hrhd.c +++ b/src/detect-engine-hrhd.c @@ -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; } diff --git a/src/detect-engine-hrud.c b/src/detect-engine-hrud.c index 38d7ea7867..352923593e 100644 --- a/src/detect-engine-hrud.c +++ b/src/detect-engine-hrud.c @@ -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; }