Optimization #4066
closed
Add a PASS_IF_NULL macro to the FAIL/PASS API
Added by Shivani Bhardwaj about 4 years ago.
Updated about 2 years ago.
Label:
Beginner, C, Outreachy
Description
src/util-unittests.h contains a few macro definitions that are being used in the new tests. There is PASS, PASS_IF for the success paths. Add a `PASS_IF_NULL` macro. Its function should be as the name suggests. It should pass if the value provided to it is NULL.
- Subject changed from Add a FAIL_IF_NULL macro to the FAIL/PASS API to Add a PASS_IF_NULL macro to the FAIL/PASS API
- Assignee changed from Community Ticket to Janani Ramjee
- Status changed from New to In Review
This idea was discontinued after some further discussion (see https://github.com/OISF/suricata/pull/5485).
One of the reasons is that having PASS_IF macros could end up breaking the guideline of having PASS to be the last
thing called in a unit tests (as the PASS_IF macros could end up implicitly calling FAIL, internally).
The other is because it requires reverting the logic of the FAIL calls in order to be written, therefore making the process
more convoluted.
- Status changed from In Review to Closed
- Target version set to 7.0.0-beta1
Also available in: Atom
PDF