fix invalid unittests with mixed relative and non-relative content modifiers and other issues; DetectContentParse19 still contains some failing dce_stub tests which are commented out.
remotes/origin/master
Eileen Donlon14 years agocommitted byVictor Julien
printf("failed dce iface, stub_data with content, offset, depth");
result=0;
gotoend;
}
@ -1301,7 +1304,7 @@ int DetectContentParseTest19(void)
if(data->flags&DETECT_CONTENT_RAWBYTES||
data->flags&DETECT_CONTENT_NOCASE||
data->flags&DETECT_CONTENT_WITHIN||
!(data->flags&DETECT_CONTENT_DISTANCE)||
data->flags&DETECT_CONTENT_DISTANCE||
data->flags&DETECT_CONTENT_FAST_PATTERN||
data->flags&DETECT_CONTENT_NEGATED||
result==0){
@ -1309,11 +1312,12 @@ int DetectContentParseTest19(void)
gotoend;
}
result&=(data->offset==10&&data->depth==13);
*/
s->next=SigInit(de_ctx,"alert tcp any any -> any any "
"(msg:\"Testing bytejump_body\"; "
"(msg:\"Testing content\"; "
"content:\"one\"; sid:1;)");
if(s->next==NULL){
printf("failed testing content");
result=0;
gotoend;
}
@ -2294,7 +2298,7 @@ static int SigTest61TestNegatedContent(void)
*/
staticintSigTest62TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:49; depth:52; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:49; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
}
staticintSigTest63TestNegatedContent(void)
@ -2304,7 +2308,7 @@ static int SigTest63TestNegatedContent(void)
staticintSigTest64TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:30; depth:30; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:30; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
}
/** \test Test negation in combination with within and depth
@ -2316,12 +2320,12 @@ static int SigTest64TestNegatedContent(void)
*/
staticintSigTest65TestNegatedContent(void)
{
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; distance:0; within:49; offset:46; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestNegativeTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; distance:0; within:49; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
}
staticintSigTest66TestNegatedContent(void)
{
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:30; offset:56; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");
returnSigTestPositiveTestContent("alert tcp any any -> any any (content:\"one\"; depth:10; content:!\"fourty\"; within:30; sid:1;)",(uint8_t*)"one four nine fourteen twentythree thirtyfive fourtysix fiftysix");