From: Victor Julien Date: Wed, 21 Oct 2020 13:46:58 +0000 (+0200) Subject: detect/content: add more negation tests X-Git-Tag: suricata-6.0.1~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=479078d377cad201fb65a10a1555b0199a126426;p=thirdparty%2Fsuricata.git detect/content: add more negation tests --- diff --git a/src/tests/detect-engine-content-inspection.c b/src/tests/detect-engine-content-inspection.c index 69389e0afb..ead4d34c07 100644 --- a/src/tests/detect-engine-content-inspection.c +++ b/src/tests/detect-engine-content-inspection.c @@ -189,6 +189,13 @@ static int DetectEngineContentInspectionTest08(void) { TEST_RUN("ababc", 5, "content:\"a\"; content:\"b\"; distance:0; within:1; content:!\"a\"; distance:0; within:1;", true, 5); TEST_RUN("ababc", 5, "content:\"a\"; content:\"b\"; distance:0; within:1; content:!\"a\"; distance:0; ", true, 5); + TEST_RUN("abcdefghy", 9, "content:\"a\"; content:!\"x\"; content:\"c\"; distance:0; within:2; ", + true, 3); + TEST_RUN("abcdefghx", 9, "content:\"a\"; content:!\"x\"; content:\"c\"; distance:0; within:2; ", + false, 2); + TEST_RUN("abcdefghy", 9, + "content:\"a\"; content:!\"x\"; content:!\"c\"; distance:2; within:1; ", true, 3); + TEST_FOOTER; }