Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect-icmp-seq: convert unittests to FAIL/PASS APIs #8080

Closed

Conversation

AkakiAlice
Copy link
Contributor

Task: #4043

Make sure these boxes are signed before submitting your Pull Request -- thank you.

Link to redmine ticket: https://redmine.openinfosecfoundation.org/issues/4043

Describe changes:

  • Update detect-icmp-seq to use FAIL/PASS API

@jufajardini jufajardini added the outreachy Contributions made by Outreachy applicants label Oct 24, 2022
@AkakiAlice
Copy link
Contributor Author

AkakiAlice commented Oct 24, 2022

I see the DetectIcmpSeqMatchTest01 test present in this file as a good candidate to be converted to a Suricata-Verify test. I would like to work on it, should I create a task?

@jufajardini
Copy link
Contributor

I see the DetectIcmpSeqMatchTest01 test present in this file as a good candidate to be converted to a Suricata-Verify test. I would like to work on it, should I create a task?

If there isn't one yet, yes, that's a good idea :)

return 1;
}
return 0;
FAIL_IF_NOT(iseq != NULL && htons(iseq->seq) == 300);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please break this into 2 checks

return 1;
}
return 0;
FAIL_IF_NOT(iseq != NULL && htons(iseq->seq) == 300);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

}
return 1;
FAIL_IF_NOT_NULL(iseq);
DetectIcmpSeqFree(NULL, iseq);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless statement? It will only be called with iseq == NULL

@@ -366,11 +362,9 @@ static int DetectIcmpSeqParseTest03 (void)
{
DetectIcmpSeqData *iseq = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in your next PR, could you change these to a single line, e.g.
DetectIcmpSeqData *iseq = DetectIcmpSeqParse(NULL, "badc");

Copy link
Member

@victorjulien victorjulien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see inline comments

@AkakiAlice
Copy link
Contributor Author

see inline comments

Thanks for the feedback, I will make the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
outreachy Contributions made by Outreachy applicants
3 participants