Fixing unittests for fast_pattern options compatibility

remotes/origin/master-1.0.x
Pablo Rincon 15 years ago committed by Victor Julien
parent bfd167521e
commit e7b537cec3

@ -385,7 +385,7 @@ end:
/** /**
* \test Checks if a http_cookie is registered in a Signature, when fast_pattern * \test Checks if a http_cookie is registered in a Signature, when fast_pattern
* is also specified in the signature * is also specified in the signature (now it should)
*/ */
int DetectHttpCookieTest04(void) int DetectHttpCookieTest04(void)
{ {
@ -399,12 +399,12 @@ int DetectHttpCookieTest04(void)
de_ctx->sig_list = SigInit(de_ctx, "alert icmp any any -> any any " de_ctx->sig_list = SigInit(de_ctx, "alert icmp any any -> any any "
"(msg:\"Testing http_cookie\"; content:\"one\"; " "(msg:\"Testing http_cookie\"; content:\"one\"; "
"fast_pattern; http_cookie; sid:1;)"); "fast_pattern; http_cookie; sid:1;)");
if (de_ctx->sig_list == NULL) if (de_ctx->sig_list != NULL)
result = 1; result = 1;
end: end:
if (de_ctx != NULL) if (de_ctx != NULL) SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx); if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
return result; return result;
} }

@ -336,7 +336,7 @@ int DetectHttpMethodTest03(void)
return result; return result;
} }
/** \test Check a signature with fast_pattern (fail) */ /** \test Check a signature with fast_pattern (should work) */
int DetectHttpMethodTest04(void) int DetectHttpMethodTest04(void)
{ {
DetectEngineCtx *de_ctx = NULL; DetectEngineCtx *de_ctx = NULL;
@ -353,7 +353,7 @@ int DetectHttpMethodTest04(void)
"fast_pattern; " "fast_pattern; "
"http_method; sid:1;)"); "http_method; sid:1;)");
if (de_ctx->sig_list == NULL) { if (de_ctx->sig_list != NULL) {
result = 1; result = 1;
} }

Loading…
Cancel
Save