From 479078d377cad201fb65a10a1555b0199a126426 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 21 Oct 2020 15:46:58 +0200 Subject: [PATCH] detect/content: add more negation tests --- src/tests/detect-engine-content-inspection.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- 2.47.3