{
DetectIcmpSeqData *iseq = NULL;
iseq = DetectIcmpSeqParse(NULL, "300");
- if (iseq != NULL && htons(iseq->seq) == 300) {
- DetectIcmpSeqFree(NULL, iseq);
- return 1;
- }
- return 0;
+ FAIL_IF_NULL(iseq);
+ FAIL_IF_NOT(htons(iseq->seq) == 300);
+ DetectIcmpSeqFree(NULL, iseq);
+ PASS;
}
/**
{
DetectIcmpSeqData *iseq = NULL;
iseq = DetectIcmpSeqParse(NULL, " 300 ");
- if (iseq != NULL && htons(iseq->seq) == 300) {
- DetectIcmpSeqFree(NULL, iseq);
- return 1;
- }
- return 0;
+ FAIL_IF_NULL(iseq);
+ FAIL_IF_NOT(htons(iseq->seq) == 300);
+ DetectIcmpSeqFree(NULL, iseq);
+ PASS;
}
/**
*/
static int DetectIcmpSeqParseTest03 (void)
{
- DetectIcmpSeqData *iseq = NULL;
- iseq = DetectIcmpSeqParse(NULL, "badc");
- if (iseq != NULL) {
- DetectIcmpSeqFree(NULL, iseq);
- return 0;
- }
- return 1;
+ DetectIcmpSeqData *iseq = DetectIcmpSeqParse(NULL, "badc");
+ FAIL_IF_NOT_NULL(iseq);
+ PASS;
}
/**